Chat completions

POST /v1/chat/completions — OpenAI-compatible chat inference.

Models

List the models that are routable right now.

Headers

Request and response headers, including the Malibu-specific ones.

Usage object

Token counts, cached prompt tokens, daily quota.

Network stats

Public pool, routability, and status snapshots.
The primary buyer endpoint. The request and response shapes follow OpenAI’s chat completions API. Malibu adds a sticky-conversation request header, a provider-attribution response header, and a signed receipt header. Two translation facades share the same routing, quota, and settlement path: Responses (POST /v1/responses) and Anthropic Messages (POST /v1/messages).

Endpoint

Request body

Standard OpenAI shape:
Accepted fields: Content shape. system and user messages accept a string or a text-only content array ([{"type": "text", "text": "..."}]). The gateway flattens text-only arrays into one string. Image, audio, and other non-text parts are rejected with 400 unsupported_content_shape. Tool-call IDs. Clients that send non-OpenAI tool-call IDs (toolu_*, UUIDs, namespaced IDs) are supported. The gateway rewrites them to a deterministic call_… form before routing and keeps each assistant tool_calls[].id paired with its tool_call_id result. Body size. Request bodies are capped at 1 MiB.

Request headers

Full reference: Headers.

Response body

Standard OpenAI shape. This is a live response from 23 Sep 2026, trimmed:
See Usage object for the cache fields.

Response headers

Full reference: Headers.

Streaming

Set stream: true and read Server-Sent Events. Each data: line carries an OpenAI chat.completion.chunk:
The final usage chunk is always sent, whether or not you set stream_options.include_usage. Streaming responses never carry a receipt header. Some non-streaming responses do; for the rest, use GET /v1/receipts. See Signed receipts. If the provider disconnects after the first event has reached you, the stream ends with a provider_disconnected error event. A retry is a new, separately metered request. Failover to another provider happens only before any bytes have been sent.

Errors

Errors use OpenAI’s envelope plus a retryable boolean:
Honor retryable. When it is true, the same request can succeed later without changes, and Retry-After or X-RateLimit-Reset* headers tell you how long to wait. Streaming errors after headers are sent arrive as an SSE data: frame that holds the same error object, followed by data: [DONE].