Routing
How EUrouter intelligently routes requests to the best available provider.
How routing works
When you send a request to EUrouter, we don't just forward it to a single provider. Instead, we select the best available provider for your specific request based on health, price, and performance — then automatically retry with alternatives if something goes wrong.
This happens transparently. You specify a model, and EUrouter handles the rest.
Provider selection
EUrouter selects providers in this order:
- Find all providers that host the requested model
- Filter out disabled or unhealthy providers
- Apply your routing preferences (if specified)
- Score remaining candidates by health and price
- Select the highest-scoring provider
Default scoring
By default, providers are scored using:
score = healthScore / (price)²This balances reliability with a strong preference for cost-effective providers.
Routing preferences
You can control routing by adding a provider object to your request:
{
"model": "gpt-5.1",
"messages": [{ "role": "user", "content": "Hello!" }],
"provider": {
"order": ["scaleway", "azure"],
"allow_fallbacks": true
}
}Available parameters
| Parameter | Type | Description |
|---|---|---|
order | string[] | Try providers in this order |
only | string[] | Only use these providers |
ignore | string[] | Never use these providers |
allow_fallbacks | boolean | Fall back on failure (default: true) |
sort | string | Sort by price, latency, or throughput |
Provider order
Use order to specify which providers to try first:
{
"provider": {
"order": ["scaleway", "mistral", "azure"]
}
}Providers in the list are tried in order. If all fail and allow_fallbacks is true, other providers are tried as fallbacks.
Exclusive providers
Use only to restrict to specific providers:
{
"provider": {
"only": ["scaleway"]
}
}No other providers will be used, even as fallbacks.
Excluding providers
Use ignore to exclude specific providers:
{
"provider": {
"ignore": ["azure"]
}
}Model variants
Append a variant suffix to the model name for quick routing shortcuts:
| Variant | Example | Behavior |
|---|---|---|
:floor | gpt-5.1:floor | Cheapest provider first |
:nitro | claude-4:nitro | Fastest throughput first |
:free | llama-3:free | Only free providers |
{
"model": "gpt-5.1:floor",
"messages": [{ "role": "user", "content": "Hello!" }]
}Variants are a shorthand — you can achieve the same with explicit provider parameters.
Data residency
EUrouter routes exclusively through EU-based infrastructure by default. For additional control:
| Parameter | Type | Description |
|---|---|---|
data_residency | string | Specific region (eu, eea, de, fr, etc.) |
eu_owned | boolean | Only EEA-headquartered providers |
max_retention_days | number | Maximum data retention (0 = zero retention) |
data_collection | string | allow or deny training on your data |
{
"provider": {
"data_residency": "de",
"eu_owned": true,
"max_retention_days": 0
}
}Automatic fallbacks
If a provider fails, EUrouter automatically tries the next available provider. This happens for:
- Server errors (5xx)
- Rate limits (429)
- Timeouts (408)
- Network failures
Non-retryable errors (authentication failures, bad requests) fail immediately without fallback.
Disabling fallbacks
Set allow_fallbacks to false to disable automatic retries:
{
"provider": {
"order": ["scaleway"],
"allow_fallbacks": false
}
}If Scaleway fails, the request fails — no other providers are tried.
Streaming requests
For streaming responses, fallback can only happen before the stream starts. Once tokens begin streaming, the connection is committed to that provider.
Health monitoring
EUrouter continuously monitors provider health:
- Success rate — Recent request success/failure ratio
- Latency — Response times
- Error patterns — Recurring issues
Unhealthy providers enter a cooldown period:
| Event | Cooldown |
|---|---|
| Server error (5xx) | 30 seconds |
| Rate limit (429) | 60 seconds |
| Repeated failures | 120 seconds |
During cooldown, providers are deprioritized but not completely excluded.
Response headers
Every response includes routing information:
| Header | Description |
|---|---|
x-provider-slug | Provider that served the request |
x-routing-strategy | Strategy used (default, ordered, sorted) |
x-model-variant | Variant if specified |
x-fallback-count | Number of fallback attempts |
Use these headers to understand routing decisions and debug issues.