Choose a Protocol
Choosing between OpenAI-compatible and Anthropic-compatible, how Chat Completions and Responses differ, and the Responses-only models.
UnioAPI serves each protocol natively: whichever protocol you choose, you use that protocol's request, response, streaming events and error structure, with the same field semantics as the official API.
Endpoint overview
| Protocol family | Endpoint | Purpose |
|---|---|---|
| OpenAI-compatible | POST /v1/chat/completions | Chat completions, non-streaming and SSE |
| OpenAI-compatible | POST /v1/responses | Responses, non-streaming, SSE and WebSocket |
| OpenAI-compatible | GET /v1/models | List callable models, capability tags and endpoints |
| Anthropic-compatible | POST /v1/messages | Message generation, non-streaming and named SSE |
How to choose
- OpenAI models (
gpt-*): use OpenAI-compatible with base URLhttps://api.unioapi.com/v1. Works with OpenAI SDKs and tools such as Codex, Cursor, TRAE and OpenCode. - Claude models (
claude-*): use Anthropic-compatible with base URLhttps://api.unioapi.comand send theanthropic-versionheader. Works with Anthropic SDKs and Claude Code. - One API key works on every endpoint. The endpoints each model offers are listed in
endpoint_capabilitiesof GET /v1/models.
Chat Completions vs Responses
Both endpoints call OpenAI models and both run requests as-is in the official OpenAI format. They differ exactly as in the official API:
| Chat Completions | Responses | |
|---|---|---|
| Request shape | messages array | input (string or item array) |
| Streaming | data-only SSE ending with [DONE] | named SSE events, no [DONE]; WebSocket also available |
| 12-hour cache writes | Not available | Available — see Caching & TTL |
| Responses-only models | Return 404 | Callable |
| Server-stored Responses | — | Not stored; send the full input every time — see POST /v1/responses |
service_tier takes the same values and rules on both endpoints — see
Service Tiers.
Responses-only models
gpt-5.5-pro, gpt-5.4-pro and gpt-5.2-pro list only openai.responses in
endpoint_capabilities. Calling them through Chat Completions returns the same error as the
official API:
{
"error": {
"message": "This model is only supported in v1/responses and not in v1/chat/completions.",
"type": "invalid_request_error",
"param": "model",
"code": null
}
}The HTTP status is 404. Use POST /v1/responses instead.
Calling a model over the other vendor's protocol
If a model's endpoint_capabilities also lists the other vendor's endpoint (for example a Claude
model listing openai.chat_completions), requests through that endpoint are converted to the
model's native form:
- Only the meaning of that protocol's public fields is guaranteed; fields whose meaning cannot be
kept return 400
unsupported_parameter(400invalid_request_errorin the Anthropic shape); - Only the standard tier is available (
service_tieromitted,autoordefault;speedomitted orstandard); other values return 400; - For calls that depend on every field, use the model vendor's own protocol.
Boundaries
- Brand names only indicate the compatible protocol family; they do not imply official partnership or endorsement.
- Stateful Responses operations (retrieve, delete or cancel by ID) return 404 and
background: truereturns 400 — see POST /v1/responses.
Get an API Key
Create an API key in the console with a spend cap and expiry, the two equivalent authentication headers, and how to store and revoke keys.
Migrate from Another Platform
Move from the official OpenAI API, the official Anthropic API or another OpenAI-compatible platform to UnioAPI — change the base URL, API key and model ID; keep your code and SDKs.