> ## Documentation Index
> Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# LLMで CometAPI ドキュメントを使う

> CometAPI の llms.txt と llms-full.txt を、コーディングアシスタント、検索システム、モデルプロンプトで使用します。

CometAPI のドキュメントページのコンパクトなインデックスが必要な場合は `llms.txt` を使用します。ツールが検索、質問応答、またはコーディング支援のために完全なドキュメント本文を取り込める場合は `llms-full.txt` を使用します。

## コンパクトなインデックスを取得する

以下のリクエストは CometAPI の `llms.txt` インデックスをダウンロードします:

```bash theme={null}
curl https://apidoc.cometapi.com/llms.txt
```

レスポンスは、ドキュメントのタイトルとリンクされたページ一覧から始まります:

```text theme={null}
# CometAPI Documentation

> CometAPI developer documentation for unified API access...

## Docs

- [Create a new API key](https://apidoc.cometapi.com/api/api-keys/create-api-key.md)
```

## 全文を取得する

以下のリクエストは全文エクスポートをダウンロードします:

```bash theme={null}
curl https://apidoc.cometapi.com/llms-full.txt
```

レスポンスには、ソース URL ごとにグループ化されたページ内容が含まれます:

```text theme={null}
# Create a new API key
Source: https://apidoc.cometapi.com/api/api-keys/create-api-key

Create a new CometAPI API key for the authenticated account.
```

## ドキュメントを検索ジョブに追加する

以下の Python 例では、全文をダウンロードし、インデックス作成のためにローカルファイルへ書き込みます:

```python theme={null}
from pathlib import Path

import requests

url = "https://apidoc.cometapi.com/llms-full.txt"
response = requests.get(url, timeout=60)
response.raise_for_status()

Path("cometapi-docs.txt").write_text(response.text, encoding="utf-8")
print(len(response.text))
```

結果は保存された文字数です。これは出力例にすぎません。ドキュメントが変更されるたびに値は異なります:

```text theme={null}
449946
```

## よくあるエラー

| Error             | Fix                                                   |
| ----------------- | ----------------------------------------------------- |
| ツールのコンテキストが小さすぎる  | まず `llms.txt` を使い、その後、重要なリンク先ページだけを取得してください。          |
| 全文が大きすぎる          | インデックス作成の前に、`llms-full.txt` を見出しかソース URL ごとに分割してください。 |
| ローカルキャッシュが壊れている   | ドキュメント同期ジョブ中にファイルを更新してください。                           |
| AI の結果にページが見つからない | そのページがナビゲーションと `llms.txt` に表示されていることを確認してください。        |

## 関連リンク

* [CometAPI docs ホーム](/)
* [Models ページ](/ja/overview/models)
* [モデルディレクトリ](https://www.cometapi.com/models/)
* [料金](https://www.cometapi.com/pricing/)
* [CometAPI クイックスタート](/ja/overview/quick-start)

<script type="application/ld+json">
  {`
    {
    "@context": "https://schema.org",
    "@graph": [
      {
        "@type": "TechArticle",
        "@id": "https://apidoc.cometapi.com/guides/how-to-use-cometapi-docs-with-llms",
        "headline": "LLMで CometAPI ドキュメントを使うには？",
        "description": "CometAPI の llms.txt と llms-full.txt を、コーディングアシスタント、検索システム、モデルプロンプトで使用します。",
        "url": "https://apidoc.cometapi.com/guides/how-to-use-cometapi-docs-with-llms",
        "author": {
          "@type": "Organization",
          "name": "CometAPI"
        },
        "publisher": {
          "@type": "Organization",
          "name": "CometAPI",
          "url": "https://www.cometapi.com"
        }
      },
      {
        "@type": "BreadcrumbList",
        "itemListElement": [
          {
            "@type": "ListItem",
            "position": 1,
            "name": "CometAPI Docs",
            "item": "https://apidoc.cometapi.com/"
          },
          {
            "@type": "ListItem",
            "position": 2,
            "name": "ガイド",
            "item": "https://apidoc.cometapi.com/guides/use-cometapi-with-openai-sdk"
          },
          {
            "@type": "ListItem",
            "position": 3,
            "name": "LLMで CometAPI ドキュメントを使うには？",
            "item": "https://apidoc.cometapi.com/guides/how-to-use-cometapi-docs-with-llms"
          }
        ]
      }
    ]
    }
    `}
</script>
