Chat completions

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

Models

List available MLX models and memory tiers.

Headers

Malibu-specific request and response headers.

Usage object

Token counts, cached prompt tokens, billing fields.

Network stats

Pool size, routing weights, live network metrics.
The primary buyer-facing endpoint. Wire-shape identical to OpenAI’s chat completions API, with a handful of Malibu-specific headers for routing and receipt handling.

Endpoint

Request body

Standard OpenAI shape:
Supported fields:

Request headers

Response body

Standard OpenAI shape:
See Usage object for cached_prompt_tokens.

Response headers

Full reference: Headers.

Streaming

Set stream: true and consume Server-Sent Events. Each data: line is a JSON chunk with a partial delta:
The receipt is delivered on the final trailing chunk (or the response trailers) — same signed tuple as non-streaming.

Errors

Errors follow OpenAI’s error shape: