Skip to content
Skip to article
View as Markdown

Core concepts

Routers

A router is the unit a client connects to. Each has a unique slug (used in the URL path), its own API keys, and its own routing chain. Most people create one router per application or environment (e.g. my-agent-prod, my-agent-staging), since the routing chain, session grouping, and logs are all scoped per router.

Routing steps & fallback

Each routing step specifies a provider, a model and the provider key to use. A step can also set temperature, maximum output tokens and reasoning effort. The router selects the model for each attempt from that chain. Send "model": "default" when a client requires a model name.

For example, if the first provider returns a rate limit and the second answers, the client receives a successful response. Logs marks the request Recovered and its Trace shows both attempts. An error eligible for fallback advances to the next configured step. An error that stops the chain, or exhaustion of its steps, ends the request.

By default a recognized context overflow can fall back to a model with a larger context window. Enable Skip fallback on context overflow on the router to stop at that error instead. Inspect request outcomes.

Provider keys vs. router API keys

Credential Where it is used What it grants
Router API key Your client sends it to the router URL. Create or revoke keys under API Keys. Send requests through that router and manage its recording window.
Provider key Add the credential from the inference provider under Providers and assign it to a routing step. DodoRouter can call that provider on your behalf.
MCP OAuth authorization Approve a connected agent at /mcp in the browser. The agent can use the tools permitted by the scopes you approved. Agent access.

A router can have a named key for each client. To rotate one, create a replacement, update the client, verify the connection, then revoke the old key. Check a router URL and key.

Plan types: standard vs. coding subscriptions

z.ai and Moonshot (Kimi) both offer a flat-rate "coding" subscription plan alongside their regular pay-as-you-go API, each with its own base URL and, for cost tracking, $0 marginal per-token pricing. When adding a routing step for these providers, you'll see both a standard key option and a "coding" one; pick whichever matches the credential you added on the Providers page.

Reasoning effort

Reasoning models expose "how hard to think" differently per provider — a string like reasoning_effort for OpenAI, a token budget for Anthropic extended thinking, a thinking budget for Gemini, or a plain on/off toggle for DeepSeek/z.ai/Moonshot-style models. Set a canonical level per routing step — none, minimal, low, medium, high, xhigh, max — and DodoRouter translates it into whatever the upstream provider actually expects. If your client already sends its own reasoning parameter in the request, that always wins over the routing step's default.

Sessions

Give related calls the same X-Session-Id to see their combined cost, tokens, latency and request history. For example, use one ID for the turns of a support conversation or the steps in a batch job. Add X-Session-Name to give the session a readable name.

If your client already sends a conversation ID, configure the router's session header to match. With a custom header such as x-job-id, send the display name in x-job-id-name. Session and recording views.

Recordings

A recording groups a router's requests by a start and stop time. Use a session to follow one conversation across time. Use a recording to capture a whole workload, including calls from different sessions. Start and stop a capture on the router's Recordings page or through its Recordings API.

An evaluation can replay a sample from a recording against candidate models. Compare models on real requests.

Logs & replay

Open a request in Logs to see its outcome, provider attempts, timing and any recorded usage or bodies. Large bodies can be truncated, and the detail page indicates when data is unavailable. If the stored request is replayable, Replay lets another model answer it and compares the responses. A replay makes a new provider call.