Skip to main content

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 text model docs by matching your request format to the page that implements it. For OpenAI-compatible chat, start with Chat Completions or Responses; for provider-native formats, use the matching provider page.

Choose a text API

GoalStart here
Send OpenAI-compatible chat messagesChat Completions
Use GPT reasoning, multimodal output, or built-in toolsResponses
Use Claude Messages formatAnthropic Messages
Use Gemini native content generationGemini Generating Content

List available text models

The public model catalog lets you discover available model IDs before you call a text endpoint:
curl https://api.cometapi.com/api/models
The response contains model records that you can inspect before selecting a model ID:
{
  "success": true,
  "page": 0,
  "page_size": 0,
  "total": 301,
  "data": [
    {
      "id": "deepseek-v4-pro",
      "provider": "DeepSeek",
      "model_type": "text",
      "features": [
        "text-to-text"
      ],
      "pricing": {
        "currency": "USD / M Tokens",
        "input": 0.416,
        "output": 0.832,
        "per_request": null,
        "per_second": null
      },
      "api_doc_url": "https://apidoc.cometapi.com/api/text/chat"
    }
  ]
}

Call a text model

The following example sends an OpenAI-compatible chat request:
curl https://api.cometapi.com/v1/chat/completions \
  -H "Authorization: Bearer $COMETAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "your-model-id",
    "messages": [
      {
        "role": "user",
        "content": "Write one sentence about CometAPI."
      }
    ]
  }'
The response includes a choice with the model output:
{
  "id": "chatcmpl_example",
  "object": "chat.completion",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "CometAPI lets developers route model requests through one API surface."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 14,
    "total_tokens": 26
  }
}

Common errors

ErrorFix
401Send Authorization: Bearer $COMETAPI_KEY.
404 or HTML responseUse https://api.cometapi.com/v1 as the base URL.
429Reduce burst concurrency and retry with backoff.
Provider-specific parameter errorRemove optional fields, then add the fields back one at a time.
Last updated: May 27, 2026