1. Name the models in agentos.yaml
Give each model a role underconfig.models. The value is the model’s name as the environment’s Models page lists it, <provider slug>/<model ID>:
agentos.yaml
2. Call the gateway
On each invocation,context.llm.base_url is the gateway and context.config.models holds the names. Send the run token as x-agentos-run-token; the API key can be anything.
inv.llm is the gateway with the token already attached:
Other parameters (
temperature, tools, …) go into the request body. Framework adapters give you a ready model for the OpenAI Agents SDK, Agno and the Vercel AI SDK; see Frameworks.
Which names to send
Send exactly the names inconfig.models. A run only reaches its own environment’s models, so a name from another environment, a bare model ID (claude-sonnet-4-5) or a provider path answers 400.
GET {base_url}/models lists the environment’s models with the environment’s number in front (3/anthropic/claude-sonnet-4-5). Send them without that prefix.
Supported routes
The run token reaches these gateway routes; every other route answers403.
What a call can’t carry
The gateway decides which provider and credentials a call uses, so a request is refused with400 naming the key when it carries:
- more than one model (a
,in the model name); - routing settings:
fallbacks,context_window_fallbacks,content_policy_fallbacks,router_settings_override,specific_deployment,model_info; - credentials:
api_key,aws_access_key_idand the like.
When a guardrail blocks a call
The environment’s guardrails check each call. A block fails only that call with HTTP400; the run goes on and your code decides what to do — try differently, skip the step, or ask a person:
agentos_guardrail. The SDKs raise GuardrailBlocked (with guardrail, at and hit); left uncaught, the run fails with blocked_by_guardrail. A route a guardrail can’t be enforced on answers 403 agentos_forbidden. Streams, framework behaviour and every other case are on the Guardrails page.
What is recorded
Each call becomes anllm.call event on the run’s timeline with its model, tokens, cost and latency, and the tools the model asked for become tool.call events. The run’s usage adds them up (llm_calls, input_tokens, output_tokens, cost), and the Dashboard and Models page show the totals; see Metrics.
Prompts and responses are never stored. Only the model, token counts, cost, latency and the names of the tools the model asked for are kept.
Next steps
Streaming answers
Stream a model’s answer straight to your caller.
Evals
Compare models and prompts on a dataset without a new build.

