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.

30-second switch from OpenAI

Use this two-setting diff when you switch an OpenAI SDK client to CometAPI:
- base_url="https://api.openai.com/v1"
- api_key=os.environ["OPENAI_API_KEY"]
+ base_url="https://api.cometapi.com/v1"
+ api_key="<COMETAPI_KEY>"
CometAPI uses OpenAI-compatible request formats for common text, image, audio, and video workflows. If your app already uses the OpenAI SDK, start by changing the base URL and API key.

Get your API key

To create your CometAPI API key, follow these steps:
  1. Open the CometAPI dashboard.
  2. In the dashboard, open the API key page.
  3. Click Add Token.
  4. Copy the API key and store it in your app or local environment.
For local testing, export your API key as an environment variable:
export COMETAPI_KEY="<COMETAPI_KEY>"

Base URL

Use this base URL for OpenAI-compatible SDKs and API calls:
https://api.cometapi.com/v1

Make your first call

Replace your-model-id with a current model ID from the Models page.
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 a one-sentence bedtime story."
      }
    ]
  }'

Pick a model

Choose a model ID from the Models page, then pass that value in the model field.
GoalWhere to start
Chat or general textUse a GPT, Claude, Gemini, DeepSeek, or other chat model with Chat Completions.
Coding and reasoningUse a coding or reasoning model with Responses when the model requires the Responses API.
Image generationUse an image model with Create image or a provider-specific image guide.
Video generationUse a video model with the video API page that matches the provider workflow, such as Create video.

What is next

FAQ

Open the API key page in the CometAPI dashboard, click Add Token, and copy the generated API key. Use <COMETAPI_KEY> in examples instead of a real API key.
Use https://api.cometapi.com/v1 for OpenAI-compatible SDKs and endpoints such as /v1/chat/completions.
Yes. Create an OpenAI client, set api_key to your CometAPI API key, and set base_url to https://api.cometapi.com/v1.
Change the base URL to https://api.cometapi.com/v1, replace the API key with your CometAPI API key, and use a CometAPI model ID from the Models page.
Choose the model ID by use case. Start from the Models page, then select a chat, coding, image, or video model that matches the API page that you plan to call.
CometAPI works with any programming language that can send HTTPS requests. Start with the curl, Python, and Node.js examples on this page, or use an OpenAI-compatible SDK that lets you override the base URL.
You can create a CometAPI API key from the dashboard. To check free trial availability, free trial credits, and billing details, see the CometAPI pricing page and About Pricing.