https://inference-api.openserv.ai. It implements the OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages formats, so existing clients work with a base URL and key change. To get running, start with the Quickstart.
Authentication
Generate an API key at console.openserv.ai and send it as a bearer token:x-api-key header, as sent by the Anthropic SDK, also works.
Endpoints
/v1/chat/completions works with every model in the catalog. /v1/responses is OpenAI models only. /v1/messages accepts every model except OpenAI ones, and routes Gemini through OpenRouter; see endpoint compatibility.
System prompt required
Every request must include a system prompt. Where it goes depends on the endpoint: asystem or developer message for chat completions, top-level instructions or a system or developer input message for responses, or top-level system for messages. Requests without one are rejected with a 400 whose message names the field that endpoint expects. The one exception is a Responses request that continues a conversation with previous_response_id.
List models
GET /v1/models returns every model SERV currently serves. It needs an API key but no credits.
The response is {"items": [...]}, not OpenAI’s {"object": "list", "data": [...]} shape, so the OpenAI SDK’s client.models.list() can’t parse it. Call it with plain HTTP instead.
pricing is in cents per million tokens. Models with cache pricing also carry fields such as cachedInput. endpoints lists where the model is served: chatCompletions, responses, or messages. It is the authoritative answer for which endpoint accepts a model.
Response headers
Low balance lowers the output cap
Before each request, SERV estimates its maximum cost from the prompt size, the output token cap you sent (or the model’s maximum output if you sent none), and any SERV features, web search, or attached files in use. If your balance can’t cover that, SERV lowers the cap to what the balance can pay for and reports the new value inx-openserv-max-output-tokens. The response may then stop early with a length or max_tokens stop reason. SERV returns 402 only when the balance can’t cover even min(256, requested) output tokens. SERV also sets a cap, and sends the header, when you send none for a model with no published output maximum.
Errors
The API uses standard HTTP status codes. Validation errors raised by the endpoint itself use that endpoint’s error format:{"error": {...}} on the OpenAI endpoints and {"type": "error", "error": {...}} on messages. Authentication errors (401, 403) and unknown paths use a simpler body, such as {"error": "Invalid API key"}, and internal errors use {"status": 500, "message": "Internal server error"}. Billing errors (402, and 503 when billing is unavailable) use the OpenAI shape {"error": {...}} on every endpoint, including messages. Read the message from error.message, error, or message.
Upstream provider errors
When the model provider returns an error, SERV keeps the provider’s status code:5xx: the body is replaced with{"error": {"message": "Upstream provider error", "status": <provider status>}}, wherestatusmatches the HTTP status, for example502.4xx: the provider’s body is passed through with account identifiers redacted. A provider401,402, or429is about SERV’s own provider account, so it gets a fixed SERV message instead.

