Skip to main content
Every request needs either a start_within duration or a tier name. A duration tells us how long we have to start your request with cheaper inference. It does not limit how long the response may take to finish.

Starting a Flex Race

Send a duration to start a race.
Write the duration as HHh-MMm-SSs, with two digits for each field. The duration must be between 5 seconds and 10 minutes. Longer durations give the cheaper tier more time to start.

Skipping the Flex Race

Send a tier name when you want to use a specific tier without starting a race.
  • default uses the provider’s normal real-time tier at its normal price.
  • priority uses the provider’s fastest and most expensive tier.
  • auto lets the provider choose the tier.

Flex Racing with Claude models

Claude’s cheaper tier returns the complete response at once instead of streaming it. Because this process takes minutes rather than seconds, Claude races follow different rules. A Claude race must meet these requirements:
  • start_within must be at least 00h-03m-00s.
  • The request must not stream.
  • Your organization must use Anthropic through our managed keys.
The duration has a different meaning for Claude. For GPT and Gemini, the cheaper tier only has to start within the duration, so the response may finish after it. For Claude, the complete response must arrive within the duration.

Reading the result

Check service_tier on the response to see which tier served your request.
  • flex means the cheaper tier served the request.
  • default or standard means we used the default tier.
Every response also includes these headers:
  • x-flexinference-flex-applied is true only when the cheaper tier served the request.
  • x-flexinference-flex-reason is not_requested, flex_committed, or flex_lost_race.
  • x-flexinference-cost contains the request cost in millionths of a dollar, on responses you didn’t stream. A stream carries the same number in usage.cost when you send include_cost: true.

Setting the duration for Agent Keys

Some tools cannot add fields to a request body. For these tools, create an agent key in the dashboard and assign a duration to it. This can then be used for tools like Codex or OpenClaw.

We don’t route to smaller models or change prompts

We change only the service tier. We pass your prompt, model, the provider’s response, and the provider’s error text through unchanged.