fallbacks list — no retry logic needed on your side.
There are two independent layers of failover, and knowing which is which saves a lot of confusion:
The second layer only exists for models sold by more than one provider, and only when you let Eden AI choose the provider. See Provider Routing.
Usage
Add afallbacks array to your request with one or more backup models (LLM) or providers (expert models). If the primary model fails, Eden AI will try each fallback in order.
fallbacks accepts at most 3 entries. Sending more returns a 422.- LLMs
- Expert Models
All models (primary and fallbacks) must be valid models listed in the Models page.
Provider-level failover (LLM)
When you name a model without a provider (gpt-5.6-sol rather than openai/gpt-5.6-sol) Eden AI chooses the provider, and will try a different provider of that same model if the chosen one fails. This happens whether or not you supplied a fallbacks list.
To turn it off and have the request fail on the first provider instead:
Things worth knowing
- Repeats are kept, not deduplicated. Listing the same model twice (
["a/m", "b/m", "a/m"]) means it is genuinely attempted twice. A rate limit or a 5xx does not repeat deterministically, and Eden AI never re-attempts the same target on its own, so a deliberate repeat is the only way to get one. Trying a different provider of the same model is a separate mechanism: provider-level failover, which applies to provider-less names unless you setrouting.allow_fallbacks: false(see above). - A provider-less name works in
fallbackstoo. It resolves to one provider of that model, so{"model": "openai/gpt-4o", "fallbacks": ["gpt-5.6-sol"]}is valid. - Region tags are per entry.
{"model": "<model>@eu", "fallbacks": ["<model>@us"]}is two attempts in two regions, not one model with one region. - Failed attempts cost nothing. You are billed only for the attempt that produced a response.
Seeing what was tried
Sendx-edenai-metadata: enabled and the response reports every attempt in order, each with the provider and its HTTP status, so a fallback is visible rather than inferred from latency.
attempt: 2 means the first provider failed and the second served. See Request Metadata.
Next Steps
Provider Routing
Let Eden AI choose which provider serves a model
Request Metadata
See every provider tried, and why
LLM Models
Browse available LLM models
Expert Model Providers
Discover available providers for each feature