The inference API accepts requests in the OpenAI chat completions shape, the OpenAI Responses shape, and the Anthropic Messages shape, and serves them through the routing engine. Existing SDKs work when pointed at the Inferbase base URL. This section documents the endpoints an application calls, in one shape: method and path, purpose, authentication, parameters, example, response, and errors. Endpoints that serve the portal itself, such as usage reports, receipts and agent runs, are not part of this reference.
Only chat routes. Embeddings, rerank, images, speech, transcription and video are chosen by the routing policy's pool rather than by evidence, because nothing Inferbase measures ranks those models against each other. See Embeddings and rerank and Images, audio and video.
Request shapes and formats
The Inferbase API accepts chat requests in three shapes: OpenAI Chat Completions, the OpenAI Responses API, and Anthropic Messages. It is OpenAI compatible and Anthropic compatible, so the OpenAI and Anthropic SDKs work when pointed at the Inferbase base URL; send the shape your SDK or framework already uses. All three reach the same router, take model: "auto" or a model id, and support streaming and tool calling.
| Shape | Endpoint | Typical clients |
|---|---|---|
| OpenAI Chat Completions | POST /chat/completions | OpenAI SDKs and any OpenAI-compatible client. See Chat completions. |
| OpenAI Responses | POST /responses | The OpenAI Agents SDK and Pydantic AI. See Responses. |
| Anthropic Messages | POST /v1/messages on https://api.inferbase.ai | Anthropic SDKs and Claude Code. See Anthropic Messages. |
The other surfaces use the OpenAI shape for their kind of request: embeddings, images, speech, transcription and video. Rerank uses the Cohere shape.
Base URLs
| Base URL | Use |
|---|---|
https://api.inferbase.ai/api/v1/inference | The full form. |
https://api.inferbase.ai/v1 | For SDKs that expect a base URL ending in /v1. Serves the model endpoints only: chat completions, Responses, messages, embeddings, rerank, images, audio, video, and the model list. |
https://api.inferbase.ai | For Anthropic SDKs, which append /v1/messages themselves. |
Both OpenAI-style base URLs serve the model endpoints with the same authentication, limits, and timeouts. Keys, credits, usage, routing decisions, and model health are served only under https://api.inferbase.ai/api/v1/inference. Use one base URL per integration.
Authentication
Send the key from Gateway › API keys as a bearer token.
Authorization: Bearer inf_your_api_keyEndpoints that create, change, or revoke keys require a signed-in session rather than a key, so a leaked key cannot mint another. Two endpoints need no credential: the model list and a model's health. Routing preview needs a signed-in session. See Authentication and idempotency.
Endpoints
| Method and path | Purpose | Auth |
|---|---|---|
POST /chat/completions | Chat completion, streaming or not. model: "auto" routes. | Key or session |
POST /responses | The OpenAI Responses shape, for the OpenAI Agents SDK and Pydantic AI. | Key or session |
POST /messages | The Anthropic Messages shape, for Anthropic SDKs and Claude Code. Served at https://api.inferbase.ai/v1/messages. | Key or session |
POST /embeddings | Embeddings, OpenAI shape. The pool decides; auto takes its first embedding model. | Key or session |
POST /rerank | Rerank, Cohere shape. The pool decides; auto takes its first rerank model. | Key or session |
POST /images/generations | Generate images, OpenAI shape. | Key or session |
POST /images/edits | Change an image you send, OpenAI shape. | Key or session |
POST /audio/speech | Text to audio, OpenAI shape. Serves on an Inferbase route priced in its unit, or on your own credential. | Key or session |
POST /audio/transcriptions | Audio to text, OpenAI shape, multipart. Serves on an Inferbase route priced in its unit, or on your own credential. | Key or session |
POST /videos | Start a video generation. Returns a job. Serves on an Inferbase route priced in its unit, or on your own credential. | Key or session |
GET /videos/{video_id} | The job's status and progress. | Key or session |
GET /videos/{video_id}/content | Download the finished video. | Key or session |
GET /models | The models the caller can use, with auto first. | None |
GET /models/{model_id}/health | Whether the provider serving a model is reachable. | None |
GET /routing-decisions/{request_id} | The decision record for one routed request. | Key or session |
POST /keys, GET /keys, PATCH /keys/{key_id}, DELETE /keys/{key_id} | Manage API keys. | Session to write; key or session to list |
GET /credits, GET /credits/transactions, GET /usage | Balance, transactions, and usage logs. | Key or session |
Paths are relative to https://api.inferbase.ai/api/v1/inference. The model endpoints are also served under https://api.inferbase.ai/v1, and Anthropic SDKs reach /messages through their own base.
Quick start
Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
api_key="inf_your_api_key",
base_url="https://api.inferbase.ai/api/v1/inference",
)
# Routed: Inferbase chooses the model from the pool your routing policy allows.
response = client.chat.completions.create(
model="auto",
messages=[{"role": "user", "content": "Explain quantum computing in 3 sentences."}],
)
print(response.model)
print(response.choices[0].message.content)
# Pinned: a specific model, no routing step.
response = client.chat.completions.create(
model="openai-gpt-oss-120b",
messages=[{"role": "user", "content": "Hello!"}],
)Node.js (OpenAI SDK)
import OpenAI from 'openai'
const client = new OpenAI({
apiKey: 'inf_your_api_key',
baseURL: 'https://api.inferbase.ai/api/v1/inference',
})
const response = await client.chat.completions.create({
model: 'auto',
messages: [{ role: 'user', content: 'Explain quantum computing in 3 sentences.' }],
})
console.log(response.choices[0].message.content)curl, streaming
curl -N https://api.inferbase.ai/api/v1/inference/chat/completions \
-H "Authorization: Bearer inf_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model": "auto",
"messages": [{"role": "user", "content": "Hello!"}],
"stream": true
}'Anthropic SDK
from anthropic import Anthropic
client = Anthropic(auth_token="inf_your_api_key", base_url="https://api.inferbase.ai")
message = client.messages.create(
model="auto",
max_tokens=256,
messages=[{"role": "user", "content": "Hello!"}],
)The Anthropic SDK sends its key as x-api-key by default, which the gateway does not read. Pass the key as the auth token, which sends the bearer header.
Conventions
- Model ids are as listed by
GET /models: the catalog id of the model, such asopenai-gpt-oss-120b, the same id the model's page carries at/models/{id}. A specific variant a route serves is named with a colon, such asdeepseek-r1-0528:turbo. The id says which model, never which provider served it. A provider's own spelling of an id, such asopenai/gpt-oss-120b, is accepted as an alias on every request; responses always return the catalog id. - Unrecognized request fields are rejected with a 422, never ignored. A field that is accepted is either forwarded to the provider or reported as not forwarded, so a 200 always means the request you sent is the request that ran.
- The response
modelis always the model that served the request, neverauto. The responseidis the request id. - Errors use the OpenAI error envelope with a
request_id. See Errors.
Last updated October 11, 2026.