{
 "schema_version": 1,
 "generated": "2026-10-23",
 "id": "respanai-respan-gateway--add-fallback-and-hedged-routes",
 "repo": "respanai/respan-gateway",
 "repo_url": "https://github.com/respanai/respan-gateway",
 "repo_slug": "respanai-respan-gateway",
 "title": "Route one model name across providers with fallback",
 "page_title": "How to route one model name across providers with fallback with Respan Gateway",
 "summary": "Define a named route that falls back to a second vendor and races a slow call.",
 "who": "A backend engineer whose service fails or slows down when one model provider has an outage or latency spike.",
 "problem": "A single provider outage or slow response breaks requests or hurts tail latency.",
 "outcome": "Clients call one route name, and the gateway switches or hedges to another provider automatically.",
 "steps": [
  "Create a starter config with `respan-gateway init`.",
  "Add a [routes.<name>] table whose `to` list names two providers and whose `hedge` value sets the delay, following the README example.",
  "Validate the file with `respan-gateway check`.",
  "Reload the config with --watch or SIGHUP, as the README describes, without restarting the gateway.",
  "Send a request with \"model\" set to your route name and confirm which provider answered in the live log."
 ],
 "agent_prompt": "In the respan-gateway repo, edit gateway.toml to add a route that lists two providers in `to` with a hedge delay, then run the check command and send one request using the route name <route-name>. Return which provider served the reply, and verify the check command reports no errors.",
 "agents": [
  "any"
 ],
 "difficulty": "Intermediate",
 "time": "30 minutes",
 "basis": "readme",
 "caveat": "The README example pairs an Anthropic and an OpenAI model, so each provider needs its own key set before the route can answer.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "rust",
 "requirements": [
  "Python with pip, or a Rust toolchain with cargo, or Docker",
  "An API key for at least one model vendor, such as OPENAI_API_KEY",
  "An existing app or SDK that accepts a custom base URL",
  "Optional: a Respan API key for tracing and a tool vendor key for MCP tools"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/respanai-respan-gateway/add-fallback-and-hedged-routes/",
 "md": "https://dedupedai.com/use-cases/respanai-respan-gateway/add-fallback-and-hedged-routes/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/respanai-respan-gateway--add-fallback-and-hedged-routes.json",
 "api_version": "v1"
}
