Fast mode routing
When to use this page
Use this page when time to the first answer matters more to you than anything else Quotaflow weighs when it picks where a new conversation runs: interactive chat, coding agents that wait on their first tool call, or latency-sensitive user interfaces.
The header
Add one request header:
X-QuotaFlow-Routing: fast
It works on:
- Claude models on
POST https://api.quotaflow.ai/v1/messages, and on the OpenAI-compatible/responsesand/chat/completionsendpoints; - GPT models on
POST https://api.quotaflow.ai/openai/v1/responsesandPOST https://api.quotaflow.ai/openai/v1/chat/completions.
The header is optional. Leave it out and requests are routed exactly as they are today. The only value Quotaflow understands is fast (letter case and surrounding spaces do not matter). Any other value, an empty one included, is ignored and the request is routed as if the header were absent; it is never rejected because of this header. On other models the header is accepted and has no effect.
What it changes
Fast mode changes where a new conversation starts, and nothing else:
- Among the capacity that can serve your request, Quotaflow finds the option with the shortest predicted time to the first answer for this model and prompt size.
- Every option predicted to be within 15 % of that fastest one counts as equally fast. An option whose recent requests failed at least 20 % of the time (over at least five of them) is not chosen, and neither is one Quotaflow is currently holding back, for example while it cools down after errors or is already busy.
- Among those equally fast options, Quotaflow picks the most economical one, and the request starts there. While your account is in a period in which Quotaflow already starts new conversations on its best-measured capacity within your contracted rate, fast mode starts inside that capacity: among the equally fast options there, it picks the one that ranking puts first, not the most economical one.
The other options stay available in the same order as without the header. If the first one fails before it answers, the request moves on exactly as it would without fast mode: no option is removed, no extra error is added, and retries and fallback work as usual.
When Quotaflow has no recent measurement to compare (for example a model or prompt size with too little recent traffic), the request is routed as if the header were absent.
What it never changes
- The model and its parameters. Fast mode never changes the model,
thinking,reasoning.effort/reasoning_effort,tool_choice,max_tokens/max_output_tokens,service_tier, or any other field of your request body. The request that reaches the model is byte-for-byte the request you would send without the header. - The upstream request. The header is read by Quotaflow and is never forwarded to any upstream.
- The response format. Responses, streaming events, and error envelopes are the same as without the header.
- Your price. See Billing below.
Fast mode is not Anthropic's speed request parameter. That parameter is not accepted by Quotaflow's Messages endpoint; use this header instead.
New conversations only
Fast mode applies only to a request that starts a new conversation on Quotaflow. When Quotaflow recognises a request as a later turn of a conversation it is already serving, that turn stays on the capacity that holds the conversation's prompt cache. Moving a warm conversation would throw that cache away, which usually makes the turn slower and more expensive, not faster. Those turns are routed exactly as without the header, even if you send it. A turn Quotaflow cannot tie to an earlier one is treated as a new conversation.
The header also has no effect, and the request is routed as usual, when the request:
- continues state held upstream, such as
previous_response_id,conversationor a code-execution container, or replays Claudethinkingblocks with their signatures; - uses a Claude feature that only part of Quotaflow's capacity is verified for: structured outputs, tool search, web search, search-result blocks, or the computer and browser toolsets.
You can send the header on every request. It only acts where it can help.
What "fast" means
"Fast" is the predicted time to the first answer: how long recent requests for the same model and prompt size took before their first useful output arrived, for example the first text, the first tool call, or the first visible reasoning. It is a prediction from recent traffic, not a promise:
- it does not guarantee any particular speed-up, or any speed-up at all, for a given request;
- it does not measure total generation time or output speed after the first answer;
- it does not change how long the model thinks, which
reasoning.effortandthinkingdecide.
Billing
Fast mode has no surcharge. A fast-mode request is billed exactly like the same request without the header: the same per-model unit prices, your same contracted rate, and the long-context rules on How billing works. The capacity a request starts on does not change any of these.
As on any request, you are billed for the tokens the request actually used. Cache reads and writes, and US-only inference (inference_geo), are billed from what the model reports for the request, the same way with or without the header.
Examples
curl, Claude Messages
curl https://api.quotaflow.ai/v1/messages \
-H "x-api-key: $QUOTAFLOW_API_KEY" \
-H "Content-Type: application/json" \
-H "X-QuotaFlow-Routing: fast" \
-d '{
"model": "anthropic/claude-sonnet-5",
"max_tokens": 256,
"messages": [
{ "role": "user", "content": "Return only: connected" }
]
}'
curl, OpenAI-compatible Responses and Chat Completions
curl https://api.quotaflow.ai/openai/v1/responses \
-H "Authorization: Bearer $QUOTAFLOW_API_KEY" \
-H "Content-Type: application/json" \
-H "X-QuotaFlow-Routing: fast" \
-d '{
"model": "gpt-5.5",
"input": "Return only: connected",
"max_output_tokens": 256
}'
curl https://api.quotaflow.ai/openai/v1/chat/completions \
-H "Authorization: Bearer $QUOTAFLOW_API_KEY" \
-H "Content-Type: application/json" \
-H "X-QuotaFlow-Routing: fast" \
-d '{
"model": "gpt-5.5",
"messages": [{ "role": "user", "content": "Return only: ready" }]
}'
Python
import os
from anthropic import Anthropic
from openai import OpenAI
# Claude Messages: send the header on every request from this client.
claude = Anthropic(
api_key=os.environ["QUOTAFLOW_API_KEY"],
base_url="https://api.quotaflow.ai",
default_headers={"X-QuotaFlow-Routing": "fast"},
)
message = claude.messages.create(
model="anthropic/claude-sonnet-5",
max_tokens=256,
messages=[{"role": "user", "content": "Return only: connected"}],
)
# OpenAI-compatible Responses and Chat Completions: per request.
openai = OpenAI(
api_key=os.environ["QUOTAFLOW_API_KEY"],
base_url="https://api.quotaflow.ai/openai/v1",
)
response = openai.responses.create(
model="gpt-5.5",
input="Return only: connected",
max_output_tokens=256,
extra_headers={"X-QuotaFlow-Routing": "fast"},
)
completion = openai.chat.completions.create(
model="gpt-5.5",
messages=[{"role": "user", "content": "Return only: ready"}],
extra_headers={"X-QuotaFlow-Routing": "fast"},
)
Node.js
import Anthropic from "@anthropic-ai/sdk";
import OpenAI from "openai";
// Claude Messages: send the header on every request from this client.
const claude = new Anthropic({
apiKey: process.env.QUOTAFLOW_API_KEY,
baseURL: "https://api.quotaflow.ai",
defaultHeaders: { "X-QuotaFlow-Routing": "fast" }
});
const message = await claude.messages.create({
model: "anthropic/claude-sonnet-5",
max_tokens: 256,
messages: [{ role: "user", content: "Return only: connected" }]
});
// OpenAI-compatible Responses and Chat Completions: per request.
const openai = new OpenAI({
apiKey: process.env.QUOTAFLOW_API_KEY,
baseURL: "https://api.quotaflow.ai/openai/v1"
});
const response = await openai.responses.create(
{ model: "gpt-5.5", input: "Return only: connected", max_output_tokens: 256 },
{ headers: { "X-QuotaFlow-Routing": "fast" } }
);
const completion = await openai.chat.completions.create(
{ model: "gpt-5.5", messages: [{ role: "user", content: "Return only: ready" }] },
{ headers: { "X-QuotaFlow-Routing": "fast" } }
);