Getting Started
Using an SDK
Pointing the OpenAI and Anthropic SDKs at Multi-Router.
Multi-Router speaks the OpenAI Chat Completions and Anthropic Messages formats, so the official OpenAI and Anthropic SDKs work with it by changing two settings: the base URL and the API key. The model field then names a Multi-Router router, and every other part of the application stays as it is.
OpenAI SDK
The OpenAI SDK uses the base URL https://api.multi-router.ai/v1:
Anthropic SDK
The Anthropic SDK uses the base URL https://api.multi-router.ai:
The model field
The model field names what serves the request:
| Model field | Served by |
|---|---|
multi-router/rt_9Hk3Ws7PzQ | The router, with its model, provider, prompt and settings. |
multi-router/production | The router the alias production points to. |
anthropic/claude-sonnet-4.5 | The model, with the organization's default Anthropic key. |
Naming a router keeps the model choice out of the application, so it changes on the router. See Chat Completions.
Multi-Router fields and headers
A few optional fields and headers add Multi-Router features to SDK requests:
| Field or header | Purpose |
|---|---|
prompt_variables | Values for the router's bound prompt. In Python, sent with extra_body; in TypeScript, as a field of the request. |
x-mr-session-id | Groups the requests of a conversation in Traffic. Sent as an extra header. |
x-mr-correlation-id | Matches requests to the application's own logs, and is returned on the response. Sent as an extra header. |
user | The application's end user on Chat Completions, shown in Traffic's Customer column. On Messages, metadata.user_id. |
See Prompt Variables and Request Tracing.