Smart routing
Smart routing lets you call a capability instead of a specific model. Routic automatically picks the best available model for that capability.
Why smart routing
| Scenario | Canonical model name | Smart routing name |
|---|---|---|
| Model goes offline | Hard-coded model name → request fails | Routic switches to a replacement automatically |
| New model added | Must update code to use it | Automatically benefits from better models |
| Provider outage | All requests to that provider fail | Routic falls back to another provider's equivalent |
In short: canonical names give you control; smart routing gives you resilience.
Available routing names
| Routing name | Capability | Routing strategy | Currently includes |
|---|---|---|---|
auto/reasoning | Complex reasoning, math, logic | Prefers the strongest reasoning model | deepseek-r1, qwq-32b, etc. |
auto/chat | Everyday chat, summarization, content generation | Prefers the best cost-performance ratio | deepseek-v3 series, etc. |
The models behind each routing name are updated continuously as the catalog grows — no code changes needed on your end.
Usage
Replace the model parameter with a routing name. The request format is identical:
curl -X POST "https://api.routic.ai/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-xxxxxxxx" \
-d '{
"model": "auto/reasoning",
"messages": [
{ "role": "user", "content": "Analyze the time complexity of this code and suggest optimizations." }
]
}'
Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
base_url="https://api.routic.ai/v1",
api_key="sk-xxxxxxxx",
)
# Reasoning task → automatically picks the strongest reasoning model
response = client.chat.completions.create(
model="auto/reasoning",
messages=[{"role": "user", "content": "Prove that √2 is irrational."}],
)
# General chat → automatically picks the best value model
response = client.chat.completions.create(
model="auto/chat",
messages=[{"role": "user", "content": "Write a meeting invitation email."}],
)
Routing name vs canonical model name
| Dimension | Canonical model name | Smart routing name |
|---|---|---|
| Usage | "model": "deepseek-r1" | "model": "auto/reasoning" |
| Determinism | Always calls the specified model | Routic picks the best available |
| Best for | Reproducible results, model-specific dependencies | No model preference, want resilience and value |
| Failover | None — error if model unavailable | Automatic fallback to equivalent models |
| Response model | response.model returns the name you specified | response.model returns the actual model used |
Best practices
- Use smart routing in production — automatic failover keeps your service running when models go offline.
- Use canonical names when you need reproducibility — e.g., automated tests, benchmarks.
- Start with smart routing, switch to canonical if needed — both work interchangeably; no structural code changes required.
- Check
response.modelto see which model was actually called — smart routing responses include the underlying model name.
See also
- Model catalog — all available models and canonical names
- Chat completions — API request details
- Rate limits — per-key rate limits