Route a request
POST/v1/route
Ask a Proposal Mode router which model should serve a request. Put the request in body exactly as you'd send it to the provider (OpenAI Chat Completions, OpenAI Responses or Anthropic Messages). The router scores it and returns its candidates, most recommended first; nothing is sent to any provider.
Your app then calls the first candidate's model_id with its own provider key (at the candidate's effort, when it has one), moves down the list if that call fails, and reports what the provider answered to POST /v1/route/{decision_id}/usage.
Routing is cache-aware within a session: send session_id, or the end client's headers in headers (where Claude Code, Codex and other known clients carry theirs), so a conversation's later turns can stay on the model whose prompt cache is warm.
Request
Responses
- 200
- 400
- 401
- 402
- 403
- 404
The router's candidates for the request
The request can't be routed as sent: the body isn't a JSON object, a field is missing or invalid (router, body), or the router is a gateway router.
Unauthorized error
Your prepaid credits are exhausted
The API key is not valid
None of your routers has the name in router