API Reference
Chat Completions
POST /v1/chat/completions: OpenAI-compatible chat requests to any provider.
POST /v1/chat/completions sends a conversation to a model and returns its reply, in the OpenAI Chat Completions format, for every provider Multi-Router supports. It needs the inference scope, accepts bodies up to 4 MiB, and streams with server-sent events when stream is true.
The model field
The model field names a router or a model:
| Form | Example | Served by |
|---|---|---|
| A router | multi-router/rt_9Hk3Ws7PzQ | The router, with its model, prompt and settings. |
| An alias | multi-router/production | The router the alias points to. |
| A provider and model | anthropic/claude-sonnet-4.5 | The organization's default provider key for the provider. |
| A model name | claude-sonnet-4-5 | A router or alias with that id, or the provider the name belongs to. |
| A catalog offering | anthropic/claude-sonnet-4.5:anthropic:standard | That exact model, provider and variant. |
A router named in the model field takes precedence over the x-mr-router header. See Routing and Supported Providers.
Request body
The body takes the OpenAI Chat Completions fields:
| Field | Type |
|---|---|
model | string, required |
| A router, alias, provider and model, or model name. | |
messages | array, required |
| The conversation, as system, user, assistant and tool messages. | |
stream | boolean |
| Streams the reply as server-sent events. | |
stream_options.include_usage | boolean |
| Adds token usage to the last streamed chunk. | |
max_tokens | integer |
| The most tokens to generate. max_completion_tokens is also accepted. | |
temperature | number |
| Sampling temperature. | |
top_p | number |
| Nucleus sampling. | |
stop | string or array |
| Stop sequences. | |
tools | array |
| Function tools the model can call. | |
tool_choice | string or object |
| none, auto, required, or a named function. | |
parallel_tool_calls | boolean |
| Allows several tool calls in one turn. | |
response_format | object |
| text, json_object, or json_schema with a schema. | |
reasoning_effort | string |
| Reasoning effort for reasoning models. | |
seed | integer |
| Seed for repeatable sampling where the provider supports it. | |
user | string |
| The caller's end user, recorded in Traffic as the customer id. | |
prompt_variables | object |
| Values for the router's bound prompt variables. See Prompt Variables. | |
Other OpenAI fields, such as presence_penalty, logprobs, metadata and service_tier, are passed to providers that support them. See Prompt Variables.
Example
A request to a router and its response, which echoes the request's model field:
Errors
Beyond the common errors, Chat Completions returns these:
| Code | Status | Meaning |
|---|---|---|
router_not_found | 400 | The router or alias is absent from the organization. |
router_disabled | 400 | The router is disabled. |
model_not_found | 400 | The model is absent from the catalog. |
unknown_model | 400 | A model name matches no router, alias or model. |
model_not_found | 404 | The request names a router outside the API key's routers. |
unknown_provider | 400 | The provider prefix is unsupported. |
no_provider_key_configured | 400 | The organization has no provider key for the provider. |
provider_key_disabled | 400 | The provider key in use is disabled. |
missing_prompt_variables | 400 | The request leaves out a variable of the router's prompt. |
not_supported | 400 | A parameter the provider cannot serve, such as n above 1, or a tool type other than function. |
empty_messages | 400 | The messages array is empty. |