跳轉到主要內容

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.

當你需要 CometAPI 文件頁面的精簡索引時,請使用 llms.txt。當你的工具可以擷取完整文件文字以用於檢索、問答或程式設計協助時,請使用 llms-full.txt

取得精簡索引

以下請求會下載 CometAPI 的 llms.txt 索引:
curl https://apidoc.cometapi.com/llms.txt
回應會以文件標題和連結頁面清單開頭:
# 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)

取得完整文字

以下請求會下載完整文字匯出:
curl https://apidoc.cometapi.com/llms-full.txt
回應包含依來源 URL 分組的頁面內容:
# 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 範例會下載完整文字,並將其寫入本機檔案以供建立索引:
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))
結果會是已儲存的字元數。這只是範例輸出;每當文件變更時,你的數值都會不同:
449946

常見錯誤

錯誤修正方式
工具上下文過小先使用 llms.txt,再只擷取其中真正相關的連結頁面。
完整文字過大在建立索引前,先依標題或來源 URL 將 llms-full.txt 分塊。
本機快取損毀在你的文件同步工作期間重新整理該檔案。
AI 結果中缺少頁面確認該頁面有出現在導覽中,且也存在於 llms.txt

相關連結

Last modified on May 28, 2026