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.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.defaultuses the provider’s normal real-time tier at its normal price.priorityuses the provider’s fastest and most expensive tier.autolets 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_withinmust be at least00h-03m-00s.- The request must not stream.
- Your organization must use Anthropic through our managed keys.
Reading the result
Checkservice_tier on the response to see which tier served your request.
flexmeans the cheaper tier served the request.defaultorstandardmeans we used the default tier.
x-flexinference-flex-appliedistrueonly when the cheaper tier served the request.x-flexinference-flex-reasonisnot_requested,flex_committed, orflex_lost_race.x-flexinference-costcontains the request cost in millionths of a dollar, on responses you didn’t stream. A stream carries the same number inusage.costwhen you sendinclude_cost: true.