> ## 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.

# Use CometAPI docs with LLMs

> Use CometAPI llms.txt and llms-full.txt with coding assistants, retrieval systems, and model prompts.

Use `llms.txt` when you need a compact index of CometAPI documentation pages. Use `llms-full.txt` when your tool can ingest the full documentation text for retrieval, question answering, or coding assistance.

## Fetch the compact index

The following request downloads the CometAPI `llms.txt` index:

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

The response starts with the documentation title and linked page list:

```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)
```

## Fetch the full text

The following request downloads the full text export:

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

The response contains page content grouped by source 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.
```

## Add docs to a retrieval job

The following Python example downloads the full text and writes it to a local file for indexing:

```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))
```

The result is the number of characters saved. This is example output only; your value will differ whenever the documentation changes:

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

## Common errors

| Error                      | Fix                                                                 |
| -------------------------- | ------------------------------------------------------------------- |
| Tool context is too small  | Use `llms.txt` first, then fetch only the linked pages that matter. |
| Full text is too large     | Chunk `llms-full.txt` by heading or source URL before indexing.     |
| Broken local cache         | Refresh the file during your documentation sync job.                |
| Missing page in AI results | Confirm that the page appears in navigation and in `llms.txt`.      |

## Related links

* [CometAPI docs home](/)
* [Models page](/overview/models)
* [Model directory](https://www.cometapi.com/models/)
* [Pricing](https://www.cometapi.com/pricing/)
* [CometAPI quickstart](/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": "How do I use CometAPI docs with LLMs?",
        "description": "Use CometAPI llms.txt and llms-full.txt with coding assistants, retrieval systems, and model prompts.",
        "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": "Guides",
            "item": "https://apidoc.cometapi.com/guides/use-cometapi-with-openai-sdk"
          },
          {
            "@type": "ListItem",
            "position": 3,
            "name": "How do I use CometAPI docs with LLMs?",
            "item": "https://apidoc.cometapi.com/guides/how-to-use-cometapi-docs-with-llms"
          }
        ]
      }
    ]
    }
    `}
</script>
