DOCS / API REFERENCE
Twelver API & MCP Reference
Wire-level HTTP endpoints, model series capabilities, reasoning_effort controls, async Media API schemas, remote MCP servers, and error codes — generated directly from live server contracts.
Authorization: Bearer <api-key>Three HTTP Surfaces on One Key
| Surface | Endpoint pattern | Config ID | Purpose |
|---|---|---|---|
| Chat Completions | https://twelver.app/api/ai/<config-id>/v1/chat/completions | Required | The OpenAI-compatible endpoint — what you paste into Cline, opencode, Cursor or any coding agent. |
| Media API | https://twelver.app/api/ai/<config-id>/v1/media/generations | Required | Images, video, music and speech from your own code: POST creates a job, GET on its id returns the finished files. |
| MCP | https://twelver.app/api/mcp/v1/<toolset> | No | A remote MCP server per toolset — connects to Claude, Cursor and other MCP clients. No config id needed. |
Quickstart Request
Reference by Topic
/docs/en/api/chat-completions/Twelver Chat Completions API: Model Series & reasoning_effort
Reference for POST/api/ai/<config-id>/v1/chat/completions and GET/v1/models: model series, live rates, reasoning_effort, max_tokens, vision, and tools.
/docs/en/api/media/Twelver Media Generation API: Image, Video, Music & Speech
Async request and response schema for POST/v1/media/files, POST/v1/media/generations, polling GET/v1/media/generations/:taskId, and media toolsets.
/docs/en/api/mcp/Twelver Remote MCP API: Streamable HTTP Toolset Servers
Endpoint pattern /api/mcp/v1/<toolset>, Bearer sk-… vs OAuth 2.1 authentication, plan tier gates, and the full catalog of MCP toolsets and methods.
/docs/en/api/errors/Error Codes, Streaming, Caching & Billing — Twelver API
OpenAI-compatible error envelopes (400, 401, 402, 404, 429, 502/503), in-band SSE stream errors, token reservation & settlement, and prompt caching.