API reference
Introduction
Endpoints
- GET
/v1/modelsList models - POST
/v1/chat/completionsCreate a chat completion - POST
/v1/images/generationsCreate an image - POST
/v1/embeddingsCreate embeddings - POST
/v1/decisionsCreate a decision - POST
/v1/audio/speechCreate speech - POST
/v1/audio/transcriptionsTranscribe a recording - POST
/v1/images/editsImage editing In development - POST
/v1/video/generationsVideo generation In development
The API is served at https://api.useunbound.ai/v1. It follows the OpenAI request and response format for every endpoint it implements, so existing OpenAI clients work after changing the base URL and the key.
A machine-readable description of everything on these pages is available as OpenAPI 3.1.
Authentication
Send your key as a bearer token on every request:
Authorization: Bearer <your key>
- Keys are created and revoked in Settings → API → Keys. Revoking takes effect immediately.
- Unbound stores only a keyed hash of each key. The full value is shown once, when the key is created.
- A key can carry a spending limit. When the limit is reached, requests fail with
402and nothing is charged. - All live endpoints need the
inferencescope, which every key has by default.
| Endpoint | Method | Needs a key |
|---|---|---|
/v1/models | GET | Yes |
/v1/chat/completions | POST | Yes |
/v1/images/generations | POST | Yes |
OpenAI compatibility
Point any OpenAI client at the Unbound base URL.
from openai import OpenAI
client = OpenAI(base_url="https://api.useunbound.ai/v1", api_key="<your Unbound key>")
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.useunbound.ai/v1", apiKey: process.env.UNBOUND_API_KEY });
Model ids are Unbound ids, taken from GET /v1/models. An id from another service will return 404 model_not_found.
Unbound-specific fields
These are additions to the OpenAI format. Clients that do not know them can ignore them.
| Where | Field | Meaning |
|---|---|---|
GET /v1/models | name, type, context_length, max_output_tokens, input_modalities, output_modalities, capabilities | What the model is and what it accepts. |
GET /v1/models | privacy | The privacy level the model's route can substantiate: anonymized, private or e2ee. |
GET /v1/models | pricing | USD per one million tokens, as decimal strings. |
| Chat response | reasoning_content | Reasoning text, when the model returns it. Also sent in stream deltas. |
POST /v1/images/generations | aspect_ratio, resolution, negative_prompt, seed | Accepted only by models that declare them. |
POST /v1/images/generations | Idempotency-Key header | Makes a retry return the same images and charge once. |
| Image response | mime_type | Sent next to b64_json. |
Response headers
| Header | Sent on | Meaning |
|---|---|---|
x-request-id | Every response | Identifies the request. It matches the entry in your usage history. |
retry-after | 429 | Seconds to wait before retrying. |
x-ratelimit-limit-requests | 429 | The per-minute request limit of this key. |
x-ratelimit-remaining-requests | 429 | Always 0 on a rate-limited response. |
Rate-limit headers are sent only on rate-limited responses today; successful responses do not carry them yet.
Rate limits
Each key has a per-minute request limit. The default is 120 requests per minute; a key can be given its own limit. Your current limits are shown in Settings → API. There is no separate token-per-minute limit: spending is bounded by your balance and by the key's spending limit.
Errors
Errors use the OpenAI envelope:
{
"error": {
"message": "Not enough credits for this request.",
"type": "insufficient_quota",
"code": "insufficient_credits",
"param": null
}
}
| Status | type | Meaning | Charged |
|---|---|---|---|
| 400 | invalid_request_error | Malformed request, or a parameter the model does not support. | No |
| 401 | authentication_error | The key is missing, revoked or expired. | No |
| 402 | insufficient_quota | Not enough credit, or the key reached its spending limit. | No |
| 403 | permission_error | The key lacks the scope the endpoint needs. | No |
| 404 | model_not_found | The model does not exist or is not available through the API. | No |
| 413 | invalid_request_error | The body is too large: 4 MB, 1 MB for embeddings, decisions and speech, 24 MB for a recording. | No |
| 429 | rate_limit_error | Too many requests for this key. | No |
| 502 | server_error | The upstream provider failed. The hold was released. | No |
A stream that fails after it has started cannot change its status code. The failure arrives as a final data: event containing an error object, and you are charged only for output that was delivered before it.
Differences from OpenAI
- Only the endpoints listed in this reference exist. Video and image editing are in development and return
404today. - On chat completions, parameters that are not in the reference (for example
n,logprobsorlogit_bias) are not forwarded. - On image generation, a parameter the chosen model does not support is rejected with
400rather than ignored. - The
developerrole is accepted and treated assystem. - Image generation defaults to
b64_json. Ask for"response_format": "url"to get signed links, which expire after one hour. - Token usage on a stream is sent only when you ask for it with
stream_options.include_usage. - Speech is always MP3 and has no
speed. Transcription answers asjsonortext. Embeddings take texts, not token numbers.
Billing
Requests are billed from your account balance at the prices listed on the models page. Input and output tokens are priced separately. A hold is placed before a request runs and settled to actual usage afterwards; see Control what you spend.
Stability
The API is versioned in the path (/v1). Fields may be added to responses without notice; nothing documented here is removed or renamed without an entry in the changelog. Model availability changes as provider routes are added or retired, so read the model list rather than hard-coding assumptions about it.