Run chat inference against any canonical model
The unified endpoint’s only POST. model must be a canonical id
(openai/<id>, anthropic/<id>, xai/<id>, huggingface/<owner>/<model>[:provider]) —
there is no default and no fallback if it’s missing or unresolved; routing from a valid
canonical id to a provider and model is deterministic, never inferred or best-guessed. The
request body accepts only the field set every backing provider
can express in common (see GET /inference/v1/models → supported_parameters for the exact
list) — a field outside it is rejected with 400 unsupported_parameter before any upstream
call, never silently dropped. Set stream: true for Server-Sent Events instead of a single
JSON object; both forms are OpenAI Chat Completions-shaped regardless of which of the four
providers actually served the request, including for Anthropic, whose native Messages
wire shape is fully translated in both directions to produce this contract. A response’s
model field is rewritten to the canonical id that served it, and cross-provider usage and
tool_calls are reported in this same normalized shape either way.
Authentication
Your per-client bearer token — the API key the gateway issued to you. Present it in
Authorization: Bearer <token> form. A token that is missing, unknown, or revoked draws a
401. Before the call is sent upstream the token is removed (stripped, or swapped for the
upstream’s own credential); it never makes it past the gateway.
Request
A canonical model id. Mandatory — there is no default and no fallback. See the Inference API guide for the openai/<id> / anthropic/<id> / xai/<id> / huggingface/<owner>/<model>[:provider] forms.
For a request resolving to an Anthropic model, mapped to that API’s required max_tokens field; if neither this nor max_completion_tokens is set, the gateway injects Anthropic’s configured default rather than letting the call 400 there alone.
Selects the text/event-stream response form over a single JSON object.
"auto", "none", "required", or an object pinning one specific function tool.
Response headers
A gateway-assigned id for this call, for support/troubleshooting — present on every response from this endpoint, success or error.
Which of the four backing providers served the request (openai, anthropic, xai, or huggingface).
The canonical model id that served the request — the same value as the response body’s model field.
Response
A normalized OpenAI Chat Completions response — application/json for a single
chat.completion object, or text/event-stream (when the request set stream: true) for
incremental chat.completion.chunk events terminated by a literal data: [DONE] line.
Regardless of which of the four providers served the request, usage and tool_calls
(or their streaming delta equivalents) are reported in this one shape, and model
carries the canonical id that served it. Every response — this one included — carries the
diagnostic x-nativeport-request-id, x-nativeport-provider, and x-nativeport-model
headers described on the Inference API guide.

