Budgets & Control

How does automatic provider failover work?

Opt-in cross-provider retry when the primary AI provider times out, rate-limits, or errors — one retry hop, never a surprise, never on by default.

When your primary AI provider times out, rate-limits you, or returns a 5xx, Cognocient can retry the same call once against a different provider you've already connected — instead of just failing.

Off by default — opt-in only

Some teams have data-residency or vendor constraints that make cross-provider failover unacceptable. This never turns on by itself: enable it explicitly per account, and it only ever activates if you have at least 2 providers connected.

What triggers it

ConditionFails over?
TimeoutYes
HTTP 429 (rate limited)Yes
5xx from the providerYes
HTTP 401 (bad key)No — this is a configuration problem, not an outage; failing over would hide the fix

How it's different from Degrade mode

Degrade modeProvider Failover
TriggerBudget threshold crossedTimeout / 429 / 5xx
TargetCheaper model, same providerEquivalent-tier model, different provider
GoalReduce costMaintain availability

They can both be active on the same account without conflicting — a call can be cost-degraded on one request and availability-failed-over on another; they trigger on entirely different conditions.

Setup

  1. Connect at least 2 providers (Settings → AI Providers).
  2. Enable the toggle under Settings → AI Providers → Content Guardrails & Provider Failover — "Automatically retry on a different provider if one is down."
curl -X PATCH https://api.cognocient.com/api/account/failover \
  -H "Authorization: Bearer sk-cog-..." \
  -H "Content-Type: application/json" \
  -d '{"provider_failover_enabled": true}'

Response headers on a failed-over call

x-cog-failover: true
x-cog-failover-reason: 5xx
x-cog-original-provider: openai
x-cog-failover-provider: anthropic
x-cog-original-model: gpt-4o
x-cog-failover-model: claude-sonnet-4-6

Your application can read these to know a call was served by a different provider than requested — useful if response quality/format nuances matter for your use case.

What happens if the fallback also fails

You get the original error back, exactly as if failover weren't enabled — never a cascading retry, never a second distinct error.

Frequently asked questions

On this page