Get a Router
/v1/routers/{id}Overview
Requires an active workspace membership with owner, admin, developer, or viewer role. Billing-only members and inference API keys are rejected. workspace_id is always required; a router ID from a different authorized workspace returns 404. draft is editable state. active_revision points to a separate immutable published document; changing draft or name does not change that document.
Parameters
idpath · stringRequiredRouter identity in the explicitly supplied workspace.
workspace_idquery · stringRequiredExplicit workspace scope; the authenticated session must hold a permitted active membership.
Responses
200Operation completed.
idstringRequiredworkspace_idstringRequiredslugstringRequiredaliasstringRequiredExample: "router/coding"
namestringRequiredtaskstringRequiredgenerationintegerRequiredOptimistic version of the router record. Every successful mutation increments it. Send the observed value as expected_generation; stale values return 409.
Minimum 1 · Maximum 2147483647
draftobjectRequiredVersioned declarative LLM router configuration, normalized to at most 65536 UTF-8 JSON bytes. Unknown fields and undocumented null values are rejected. Structurally valid but incomplete drafts are permitted; validation/publication enforce final-default, nonempty pools, uniqueness, exact weights and current model eligibility.
Example: {"schema_version":1,"task":"llm","protocol":"chat","requirements":[],"defaults":{},"request_overrides":[],"policy":{"max_input_tokens":128000,"max_output_tokens":8192,"deadline_ms":120000,"regions":[],"zero_retention":false},"routes":[{"id":"default","name":"Default","condition":null,"defaults":{},"variants":[{"id":"primary","name":"Primary","weight":100,"selection":{"mode":"ordered","models":[]},"defaults":{}}]}]}
Show nested fields
schema_versionintegerRequiredtaskstringRequiredprotocolstringRequiredValues: "chat""responses""messages"
requirementsstring[]Default: []
Show nested fields
string
defaultsobjectField-wise inheritance: router defaults, then route defaults, then variant defaults, then explicitly permitted request parameters. Omitted fields inherit; null does not clear a field. max_tokens defaults to policy.max_output_tokens and cannot exceed that policy. Every effective and overridable parameter must be supported by every selected model.
Show nested fields
max_tokensintegerMinimum 1 · Maximum 1000000
temperaturenumberMinimum 0 · Maximum 2
top_pnumberMinimum 0 · Maximum 1
system_promptstringrequest_overridesstring[]Default: []
Show nested fields
string
policyobjectDeclarative upper limits, intersected with current operator/workspace/model restrictions. A model must support the full configured input plus output context budget. Region and zero-retention requirements cannot widen workspace policy.
Show nested fields
max_input_tokensintegerDefault: 128000
Minimum 1 · Maximum 1000000
max_output_tokensintegerDefault: 8192
Minimum 1 · Maximum 1000000
deadline_msintegerDefault: 120000
Minimum 1000 · Maximum 1800000
regionsstring[]Regions every route requires: us, eu or a documented country code, any of which an endpoint may process in. Empty or global means none. Each model must have an endpoint documented in one of them, and requests can narrow it but never widen it. A region no endpoint documents is refused with 422 on create, update and duplicate, and validate reports it as region_unavailable.
Default: []
Show nested fields
See the OpenAPI schema for this nested object.
zero_retentionbooleanReserved. Router-level zero retention is not available, so true is refused with 422 and validate reports zero_retention_unavailable. Workspace Privacy settings, including zero data retention per provider family, still apply to every route.
Default: false
max_priceobjectShow nested fields
inputstringRequiredExact decimal USD per native token. Strings avoid binary floating-point ambiguity. A limit of zero is allowed; approved native catalog prices must be positive.
outputstringRequiredExact decimal USD per native token. Strings avoid binary floating-point ambiguity. A limit of zero is allowed; approved native catalog prices must be positive.
routesobject[]RequiredShow nested fields
idstringRequirednamestringRequiredconditionobject | object | object | object | object | object | object | nullRequiredShow nested fields
See the OpenAPI schema for this nested object.
defaultsobjectField-wise inheritance: router defaults, then route defaults, then variant defaults, then explicitly permitted request parameters. Omitted fields inherit; null does not clear a field. max_tokens defaults to policy.max_output_tokens and cannot exceed that policy. Every effective and overridable parameter must be supported by every selected model.
Show nested fields
See the OpenAPI schema for this nested object.
variantsobject[]RequiredShow nested fields
See the OpenAPI schema for this nested object.
active_revisioninteger | nullRequiredShow nested fields
Option 1: integer
integer
Option 2: null
null
archived_atstring | nullRequiredShow nested fields
Option 1: string
string
Option 2: null
null
created_atstringRequiredupdated_atstringRequired400Request validation failed.
errorobjectRequiredShow nested fields
codestringRequiredmessagestringRequiredparamstring | nullrequest_idstring | nullmetadataobjectTyped detail for some refusals. budget_exceeded (402): limit (key_budget or workspace_budget) and budget with scope, period, limit, usage and resets_at. key_limit_exceeded (402): limit key_spend_limit. access_denied (403): policy (workspace or key), rule (models, providers or products), product, provider and model.
401Authentication is missing or invalid.
errorobjectRequiredShow nested fields
codestringRequiredmessagestringRequiredparamstring | nullrequest_idstring | nullmetadataobjectTyped detail for some refusals. budget_exceeded (402): limit (key_budget or workspace_budget) and budget with scope, period, limit, usage and resets_at. key_limit_exceeded (402): limit key_spend_limit. access_denied (403): policy (workspace or key), rule (models, providers or products), product, provider and model.
403Authenticated principal lacks permission.
errorobjectRequiredShow nested fields
codestringRequiredmessagestringRequiredparamstring | nullrequest_idstring | nullmetadataobjectTyped detail for some refusals. budget_exceeded (402): limit (key_budget or workspace_budget) and budget with scope, period, limit, usage and resets_at. key_limit_exceeded (402): limit key_spend_limit. access_denied (403): policy (workspace or key), rule (models, providers or products), product, provider and model.
404Resource was not found.
errorobjectRequiredShow nested fields
codestringRequiredmessagestringRequiredparamstring | nullrequest_idstring | nullmetadataobjectTyped detail for some refusals. budget_exceeded (402): limit (key_budget or workspace_budget) and budget with scope, period, limit, usage and resets_at. key_limit_exceeded (402): limit key_spend_limit. access_denied (403): policy (workspace or key), rule (models, providers or products), product, provider and model.
429Rate limit exceeded.
errorobjectRequiredShow nested fields
codestringRequiredmessagestringRequiredparamstring | nullrequest_idstring | nullmetadataobjectTyped detail for some refusals. budget_exceeded (402): limit (key_budget or workspace_budget) and budget with scope, period, limit, usage and resets_at. key_limit_exceeded (402): limit key_spend_limit. access_denied (403): policy (workspace or key), rule (models, providers or products), product, provider and model.
500Internal server error.
errorobjectRequiredShow nested fields
codestringRequiredmessagestringRequiredparamstring | nullrequest_idstring | nullmetadataobjectTyped detail for some refusals. budget_exceeded (402): limit (key_budget or workspace_budget) and budget with scope, period, limit, usage and resets_at. key_limit_exceeded (402): limit key_spend_limit. access_denied (403): policy (workspace or key), rule (models, providers or products), product, provider and model.