Models
The models domain gives an agent one API key for model discovery and inference.
The normal flow is:
- call List All Models to get the live catalog
- copy a returned
models[].id - pass that ID as
modelto Chat Completion - read the generated text from
completionText - read the final debit from
creditsCharged
models[].id is the value used by Chat Completion’s model field. Code Completion uses route-specific model IDs, so do not assume every chat model supports the code endpoint.
Models APIs
Install and authenticate
Keep the API key on your server. Do not place it in browser code.
Complete example
Pricing model
AgentRouter uses credits, where 1,000 credits = $1 USD.
The model catalog exposes estimated input and output rates in credits per one million tokens. Paid inference is quoted for the concrete request. The returned creditsCharged value is the authoritative final debit.
The estimate helps compare models; it is not a flat per-request price.
Routing
AgentRouter currently exposes model routes through OpenRouter, DeepSeek, and Groq. You can let AgentRouter choose a compatible route or pin one with routeKey.
Use route context for the exact provider-specific parameters:
The top-level models capability contract is currently partial. Route context is the machine-readable source of truth for the exact executable fields on a concrete route.