Router
Cookbook examples for cookbook/90_models/ramp.
Content
Router
Cookbook examples for cookbook/90_models/ramp.
Ramp Router puts one OpenAI Responses endpoint in front of several providers. Set your API key first:
export RAMP_ROUTER_API_KEY=***
Run examples with:
.venvs/demo/bin/python cookbook/90_models/ramp/<example>.py
Router specifics
- Model ids are account-scoped.
GET https://api.router.com/v1/modelslists the ones your key can reach, along with each one's context window, capabilities and price. models=[...]routes across candidates instead of picking one. Entries are thecatalog_idvalues from that listing (openai:gpt-5-nano), optionally suffixed with a service tier. Seefallback.py.metadata={...}is stored with the request and is how you attribute spend in the dashboard.allow_flex_tieronly applies to a singlemodel, so it cannot be combined withmodels.background=Trueis not supported: Router queues the generation but serves no endpoint to read it back.provider_timeoutandtimeout_before_headerscontrol how long Router waits on an upstream provider before moving on to the next candidate.- Reasoning efforts are per-model and wider than OpenAI's. Values outside
minimal/low/medium/highgo throughreasoning={"effort": ...}. temperatureandtop_pare rejected by reasoning models, so leave them unset unless the model you picked accepts them.
Source and license
- Source
- Agno
- Original
- agno-agi/agno/cookbook/90_models/ramp
- License
- Apache-2.0