Routing inputs
The gateway considers:- requested model or virtual model
- workspace and API-key context
- active routing stack
- request overrides in
metadata.astrolabe - estimated input and output tokens
- task category, action class, complexity, and route modifiers
- hosted model catalog and pricing
Stack resolution
Resolution order:- Request override:
metadata.astrolabe.stack - API-key assignment
- Workspace assignment
- Managed default
Candidate selection
For virtual models, Astrolabe starts from the routed candidate list for the virtual model. For concrete model requests, Astrolabe starts with that concrete model. The stack then applies:- provider and model allowlists
- provider and model blocklists
- required capabilities
- data and retention policy labels
- expected cost ceilings
- quality thresholds
- latency and reliability preferences
Decision strategy
Stack objectives include:- lowest-cost model that clears the quality bar
- fastest model that clears the quality bar
- highest quality within budget
- fixed priority order
- custom rules
Fallback
Fallback can be disabled or limited by stack policy. When enabled, fallback may run after provider errors, schema failures, or low-confidence verification. Fallback candidates remain constrained by stack boundaries whenfallbackMustStayInPolicy is enabled.
Verification
Verification modes:offautolightstrictstrong
Request overrides
Supported request metadata:Response headers
Important routing headers include:x-astrolabe-cloud-request-idx-astrolabe-modelx-astrolabe-stack-idx-astrolabe-stack-namex-astrolabe-stack-versionx-astrolabe-policy-statusx-astrolabe-decisionx-astrolabe-selected-providerx-astrolabe-selected-modelx-astrolabe-categoryx-astrolabe-action-classx-astrolabe-complexityx-astrolabe-lanex-astrolabe-verification-statusx-astrolabe-confidence-scorex-astrolabe-estimated-baseline-cost-usdx-astrolabe-estimated-savings-usd

