Unitool API
One key and one token balance for text models, images, video and audio. Text models speak the OpenAI Chat Completions protocol: the official OpenAI SDK, LangChain, Open WebUI and any client with a configurable base URL work as they are. Media is generated asynchronously through /v1/generations.
https://api.unitool.ai/v1The API is in beta. Access opens after the first payment on the account. Changes are additive only, listed in the Changelog.
Start here
- Quickstart: a key, the first request, streaming.
- Authentication: sending the key, scopes, per-key spend limits.
- Models: model ids, the catalog and prices.
Reference
- Chat (LLM):
POST /v1/chat/completions. - Anthropic API and Claude Code:
POST /v1/messages. - Responses API and Codex CLI:
POST /v1/responses. - Web search for text models.
- Media generations:
POST /v1/generations,POST /v1/quotes,POST /v1/uploads. - Images and speech (OpenAI):
/v1/images/*,/v1/audio/speech. - Webhooks: events about finished generations instead of polling.
- Billing: what is charged and when.
- Errors: every code explained.
- Limits and headers.
Endpoints
| Method and path | What it does |
|---|---|
POST /v1/chat/completions | A text model answer, streamed or not |
POST /v1/messages, POST /v1/messages/count_tokens | The Anthropic format for Claude models and Claude Code |
POST /v1/responses | OpenAI's Responses API without stored state, Codex CLI |
GET /v1/models, GET /v1/models/{id} | Model catalog with prices |
POST /v1/generations, GET /v1/generations/{id}, GET /v1/generations | Image, video and audio generations |
POST /v1/generations/{id}/cancel | Cancel a generation before it reaches the model |
DELETE /v1/generations/{id} | Delete the files of a finished generation |
POST /v1/images/generations, POST /v1/images/edits, POST /v1/audio/speech | Images and speech in the OpenAI format |
GET /v1/files/... | A result file by a one-hour signed link, no key |
POST /v1/quotes | Exact price of a generation without running it |
POST /v1/uploads | Upload a file for a generation |
GET /v1/openapi.json | OpenAPI 3.1 with the media model schemas |
GET /v1/balance | Available balance and what running requests hold |
GET /v1/key | The current key: limit, spend, rate limits |
GET /v1/usage | Spend by day and model, JSON or CSV |
GET /v1/requests, GET /v1/requests/{id} | Receipts: what each request cost |
Embeddings, batches and file uploads through /v1/files are not available yet: those paths answer 404 unsupported_endpoint.
What we store
The API does not store conversation text. A request receipt keeps the model, token counts and price, never the content. Generation results stay in our storage for 7 days.
For agents
Agents are better off with Unitool MCP: the same models and balance, with sign-in or an API key with the mcp scope and no spend limit (details). The list of these docs for language models: llms.txt.