Guides
Model Routing
Route requests to different models based on cost, latency, or capability.
Model Routing
AssistantRouter can intelligently route requests to different models based on your requirements.
Available Models
AssistantRouter supports models from multiple providers via OpenRouter:
| Provider | Models |
|---|---|
| OpenAI | GPT-5.2, GPT-5.1 |
| Anthropic | Claude Opus 4.5, Claude Sonnet 4.5, Claude Haiku 4.5 |
| Gemini 3 Pro, Gemini 2.5 Flash | |
| Mistral | Mistral Large 2, Mixtral 8x7B |
| Meta | Llama 4 70B |
All models are available on all tiers. There are no tier-based model restrictions.
Explicit Model Selection
Specify a model directly in your request:
const response = await client.chat.completions.create({
model: 'anthropic/claude-haiku-4.5',
messages: [{ role: 'user', content: 'Hello!' }],
});Model Fallbacks
Configure fallback models in case the primary model is unavailable:
const assistant = await fetch('https://api.assistantrouter.com/v1/assistants', {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Reliable Assistant',
model: 'anthropic/claude-haiku-4.5',
model_config: {
fallback_models: ['anthropic/claude-sonnet-4.5', 'openai/gpt-5.1'],
max_retries: 3,
},
}),
}).then(r => r.json());Cost-Based Routing
Optimize for cost by choosing models based on task complexity:
// Configure in dashboard or via API
const routingRules = {
default_model: 'anthropic/claude-haiku-4.5',
rules: [
{
condition: 'complexity:high',
model: 'anthropic/claude-sonnet-4.5',
},
{
condition: 'task:code',
model: 'anthropic/claude-sonnet-4.5',
},
],
};Model routing rules can be configured in the dashboard under Assistants → Model Config.
Model Pricing
Costs vary by model and are deducted from your wallet:
| Model | Input (per 1M tokens) | Output (per 1M tokens) |
|---|---|---|
| Claude Opus 4.5 | $5.00 | $25.00 |
| Claude Sonnet 4.5 | $3.00 | $15.00 |
| Claude Haiku 4.5 | $1.00 | $5.00 |
| GPT-5.2 | $1.75 | $10.00 |
| GPT-5.1 | $1.25 | $10.00 |
| Gemini 3 Pro | $2.00 | $12.00 |
| Gemini 2.5 Flash | $0.08 | $0.30 |
| Mistral Large 2 | $2.00 | $6.00 |
| Llama 4 70B | $0.35 | $0.40 |
Prices are based on OpenRouter rates. EU-compliant models include all Anthropic, Mistral, and Meta models.
Best Practices
- Start cheap - Use faster/cheaper models for simple tasks
- Use fallbacks - Always configure backup models
- Monitor costs - Track spending in the dashboard
- Test models - Different models excel at different tasks
- Consider latency - Smaller models are faster