# CometAPI — how to use (mcp.ai)

Connect your CometAPI account and use 6 tools for AI models straight from your AI agent. Connect with your own API key. CometAPI provides a unified API gateway for text, image, audio, video, and other generative AI models from multiple providers.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_cometapi?ms=1787295660000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `cometapi_create_chat_completion`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/cometapi`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/cometapi/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/cometapi/create/chat/completion` — Create a non-streaming Chat Completions result for message-based conversations and function-calling workflows. Use this for models or integrations that require the OpenAI Chat Completions protocol. Re
  - body: { stop?: string|string[], user?: string, model: string, tools?: object[], top_p?: number, messages: object[], temperature?: number, tool_choice?: string|object, response_format?: object, reasoning_effort?: string, max_completion_tokens?: integer }
- `POST https://api.mcp.ai/api/cometapi/create/embeddings` — Create OpenAI-compatible embedding vectors for one text or a batch of texts. This metered operation requires funded organization balance.
  - body: { user?: string, input: string|string[], model: string, dimensions?: integer, encoding_format?: string }
- `POST https://api.mcp.ai/api/cometapi/create/response` — Create a non-streaming OpenAI Responses API result. Use this for stateful continuation via previous_response_id, reasoning controls, or structured text output; use Chat Completion for Chat Completions
  - body: { text?: object, input: string, model: string, store?: boolean, top_p?: number, reasoning?: object, truncation?: string, temperature?: number, instructions?: string, max_output_tokens?: integer, previous_response_id?: string }
- `POST https://api.mcp.ai/api/cometapi/get/api/key/usage` — Return quota, usage, expiration, and model restrictions for the connected CometAPI API key. This reports key-level limits, not the organization's spendable balance or commercial tier.
- `POST https://api.mcp.ai/api/cometapi/list/models` — List all models available to the connected API key, including provider ownership and supported protocol types when returned. Use this before generation to choose a compatible model; catalog presence d
- `POST https://api.mcp.ai/api/cometapi/moderate/content` — Classify one text or a batch of texts with an OpenAI-compatible moderation model. This text-only operation is metered and requires funded CometAPI organization balance.
  - body: { input: string|string[], model?: string }

## Example prompts
- "What can I do in CometAPI?"
- "Show me a summary of my CometAPI account"

## More
- Page: https://mcp.ai/cometapi
- Agent spec (llms.txt): https://mcp.ai/cometapi/llms.txt
- Postman collection: https://mcp.ai/cometapi/postman.json
