canonical: https://jentic.com/apis/cometapi.com/cometapi

# CometAPI

Jentic publishes the only available OpenAPI specification for CometAPI, keeping it validated and agent-ready. CometAPI is an OpenAI-compatible gateway that fronts 500+ underlying models (GPT-4, Claude, Gemini, Llama, and more) behind a single bearer token. The surface mirrors the OpenAI v1 shape: chat completions, text completions, embeddings, image generation, and audio transcription or synthesis. It lets agents and applications swap or combine models without learning each provider's auth and request format.

## For AI agents

Call 500+ language, embedding, image, and audio models through one OpenAI-compatible endpoint with a single bearer token.

## Scope

Does not handle model fine-tuning, vector storage, or agent orchestration - use for OpenAI-compatible inference across multiple model providers only.

## Capabilities

- Generate chat completions across 500+ models via POST `/chat/completions`
- Create vector embeddings via POST /embeddings for retrieval and semantic search
- Generate images from text prompts via POST `/images/generations`
- Transcribe uploaded audio to text via POST `/audio/transcriptions`
- Synthesise speech from text via POST `/audio/speech`
- List and inspect available models via GET /models and GET `/models/{model}`

## Use cases

### Multi-Model A/B Routing

Route the same prompt to GPT-4, Claude, and Gemini through CometAPI's `/chat/completions` endpoint by changing only the model field. This makes it cheap to evaluate which model gives the best result for a specific task type without integrating three separate provider SDKs and three separate billing relationships.

Example prompt: Send the same prompt to `/chat/completions` three times with model values gpt-4o, claude-3-5-sonnet, and gemini-1.5-pro and return all three responses

### Embeddings Pipeline for RAG

Use POST /embeddings to vectorise a corpus of documents, then store the vectors in a downstream vector database for retrieval-augmented generation. Because CometAPI is OpenAI-compatible, existing LangChain, LlamaIndex, or custom RAG code that targets the OpenAI embeddings shape can point at CometAPI by changing only base URL and key.

Example prompt: Embed a list of 50 documents via /embeddings using the text-embedding-3-large model and return one vector per input

### Voice Note Transcription Bot

Build a Slack or Telegram bot that accepts voice notes and replies with a text transcript by uploading the audio to POST `/audio/transcriptions.` Combine with `/audio/speech` to produce spoken replies. The OpenAI-compatible shape means existing Whisper-based code can be reused without changes beyond auth.

Example prompt: Upload an mp3 file to `/audio/transcriptions` and return the transcribed text

### AI Agent Model Selection via Jentic

An AI agent connected to Jentic can pick the right CometAPI model at runtime: search Jentic for the chat completion operation, list available models via /models, and execute against the chosen one. Jentic stores the bearer token in your Jentic One instance so the agent never sees the raw key.

Example prompt: Search Jentic for 'send a chat completion through cometapi', load the operation, and execute with model gpt-4o and a user message

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/chat/completions` | Create a chat completion |
| POST | `/completions` | Create a text completion |
| POST | `/embeddings` | Create vector embeddings |
| GET | `/models` | List available models |
| GET | `/models/{model}` | Get model details |
| POST | `/images/generations` | Generate an image from a prompt |
| POST | `/audio/transcriptions` | Transcribe audio to text |
| POST | `/audio/speech` | Generate speech from text |

## Key resources

- **Chat** — OpenAI-compatible chat completions across 500+ models
- **Embeddings** — Generate vector embeddings for retrieval and semantic search
- **Images** — Text-to-image generation via `/images/generations`
- **Audio** — Transcription and text-to-speech endpoints
- **Models** — List and inspect available underlying models

## Why Jentic

- **Setup:** Wiring CometAPI by hand means setting its bearer token on the api.cometapi.com host and handling its OpenAI-compatible chat, embedding, image, and audio endpoints across multiple model providers yourself. Through Jentic you install once, import CometAPI from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** CometAPI takes the model and prompt target in the request body, so you scope by operations: limit the agent to the calls it needs, such as chat completions or embeddings, so operations like image or speech generation are not included unless you add them.
- **Credential handling:** Your CometAPI bearer token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'send a chat completion' or 'create text embeddings', and Jentic returns the matching CometAPI operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **OpenRouter** — OpenRouter is the closest equivalent multi-model gateway with the same OpenAI-compatible shape.
- **OpenAI API** — OpenAI is the upstream OpenAI-only API; CometAPI proxies it alongside other providers.
- **Groq API** — Groq is OpenAI-compatible but limited to its own hosted models with very low latency.

## FAQ

### Why is there no official OpenAPI spec for CometAPI?

CometAPI does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call CometAPI via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does CometAPI use?

CometAPI uses a bearer token in the Authorization header (Authorization: Bearer <key>), matching the OpenAI auth shape. Through Jentic the key is stored in your Jentic One instance and never enters the agent's context.

### Is CometAPI really OpenAI-compatible?

Yes. The `/chat/completions`, /completions, /embeddings, `/images/generations`, and /audio/* endpoints follow the same request and response shape as the OpenAI v1 API, so OpenAI client libraries work by overriding base_url to https://api.cometapi.com/v1.

### Can I switch models without changing my code?

Yes. Send the model field in the `/chat/completions` body to route to a different underlying model. Use GET /models to list every model available on your CometAPI key.

### What are the rate limits for CometAPI?

Rate limits depend on the plan tier and the underlying model. CometAPI returns 429 with a Retry-After header when limits are hit; clients should back off and retry. Heavy embeddings or image workloads should be batched.

### How do I send a chat completion through Jentic?

Search Jentic for 'send a chat completion through cometapi', load the schema for POST `/chat/completions`, and execute with model and messages. The Jentic Python SDK pattern is await client.search(...), await client.load(...), await client.execute(...).

### Can I limit what my agent is allowed to do with the CometAPI?

Yes. Because you run Jentic One yourself, your own rules decide which CometAPI operations and credentials the agent may use. CometAPI takes the model and prompt in the request body, so you scope by operation: grant only the calls the agent needs, such as chat completions (POST `/chat/completions`) or embeddings (POST /embeddings), and leave out image generation (POST `/images/generations`) or speech (POST `/audio/speech`) unless you deliberately add them.
