Skip to content
Preview

Route preview

chat.completions

Illustrative preview

Failover 2 attempts, 1 answered, 1 waiting

Request chat.completions one request
  • Anthropic 1
    Answered Anthropic, max-4
    Anthropic. Status: Answered. Provider: Anthropic. Model: max-4. Took: 412ms. Cost: $0.0040.
  • OpenAI 2
    Waiting OpenAI, pro-4
    OpenAI. Status: Waiting. Provider: OpenAI. Model: pro-4.
Response first answer wins

FallbackChain

attemptsrequired
readonly FallbackAttempt[]
The attempts, in the order the router reads them. In rows, the chain first, then what is out of it.
layout
"path" | "rows"
Default: "path"
path: the routing diagram. rows: the same order as rows a settings page edits, each with its place in words ("Primary", "Fallback 2"), a switch to include it and arrows to move it, its provider, model, region and note on one line. An attempt skipped is excluded and one unavailable stands out of the chain with its reason; every other status is in the chain.
title
string
The heading ("Route preview", "Fallback order"). Omit where a section already names it.
level
3 | 4 | 5 | 6
Default: 3
The heading's level in the page.
description
string
Default: "Models are tried in this order when the first does not answer."
One line under a rows heading.
route
string
The route the request takes ("chat.completions", "/v1/messages").
mode
"failover" | "balance" | "share"
Default: "failover"
What the preview reads for.
request
{ label?: string; detail?: string; meta?: string }
The request's own words, in its node at the start of the chain.
response
{ label?: string; detail?: string; meta?: string }
The response's own words, in its node at the end of the chain.
illustrative
boolean
Marks the paths as a preview, never live traffic.
illustrativeLabel
string
Default: "Illustrative preview"
The preview's words.
compact
boolean
Folds provider, model and region into the detail at every width.
presentation
"flow"
The parent owns the heading; show the selected example as directional flow.
flowRequests
readonly string[]
Ordered account IDs for separate example requests; repeat an ID for multiple requests.
details
boolean
Default: true
Each node's detail card, on hover and focus. false where the page beside it already says it all.
badges
boolean
Default: true
Each node's corner word: its place, weight or share. false where the order is plain to see.
onReorder
(ids: string[], movedId: string) => void
Lets the person put the attempts in order: drag a node up or down, or press Alt+Up or Alt+Down on a focused one. Called once, on drop, with every id in its new order and the one that moved. The chain shows attempts as given: the page reorders them.
reorderLabel
string
Default: "Drag to reorder"
The drag's words for assistive tech and the pointer's tip.
now
number
The moment "started" is read from (epoch ms).
onRetry
() => void
One act when every attempt failed. Omit where a failed chain is not retried here.
onToggle
(id: string, included: boolean) => void
rows: called when an attempt joins or leaves the chain. Without it and onReorder, the rows are a read-out.
readOnly
boolean
rows: the chain is shown but not changed here.
readOnlyReason
string
rows: why it cannot be changed here, in the product's words.
rootStyle
RootStyle<FallbackChainKnobs>
Typed StyleX override: where the chain sits and its --fallback-chain-* knobs.
className
string
An extra class beside the hook, for a page's own CSS.

State machine

PreviewThe route is waiting for an attempt.

Route preview

chat.completions

Illustrative preview

Failover 2 attempts, 2 waiting

Request chat.completions
  • Anthropic 1
    Waiting Anthropic, max-4
    Anthropic. Status: Waiting. Provider: Anthropic. Model: max-4.
  • OpenAI 2
    Waiting OpenAI, pro-4
    OpenAI. Status: Waiting. Provider: OpenAI. Model: pro-4.
Response