Know when model failover is safe
Keep conversations stable and distinguish an alternative from an unsafe replay.
Reviewed 2026-11-08
Fixed model or approved alternatives
A concrete name keeps the requested model. A published route can include approved alternatives. Eligible channels for the current model are tried first, within the attempt limit. Key and payer permissions always apply.
Use a stable conversation ID
Send a stable Session-Id for each conversation. Bindings pin the model, channel and upstream credential. Without an explicit ID, the API key and pool share a binding. Stable routing preserves cache opportunities, not guaranteed cache hits.
export AI_BASE_URL='https://easyrouteapi.com'
export AI_API_KEY='YOUR_API_KEY'
curl --disable --connect-timeout 10 --max-time 30 "$AI_BASE_URL/v1/chat/completions" \
-H "Authorization: Bearer $AI_API_KEY" \
-H "Content-Type: application/json" \
-H "Session-Id: YOUR_STABLE_CONVERSATION_ID" \
-d '{
"max_tokens": 64,
"stream": false,
"model": "coding",
"messages": [
{
"role": "user",
"content": "Hello!"
}
]
}'Three requests, different retry decisions
Fallback is bounded recovery, not a promise that every interrupted request resumes seamlessly.
| Request | Expected boundary |
|---|---|
| Plain text, eligible 429/502/503 | An approved alternative may be tried before output, subject to retry policy. |
| Tools, structured output or provider-bound state | Keep the model fixed after dispatch; avoid uncertain side effects. |
| Timeout, cancellation or output already returned | Stop automatic replay; the application decides how to recover. |
Verify the model actually used
Inspect X-GAE-Resolved-Model and Usage Logs. Billing follows the resolved model’s published price. Test your protocol and capabilities with a small quota; do not force failures against live customer traffic.