Find out which model answered and what it cost
Read the X-Flux-* response headers to see which model handled your FluxRouter request, whether it was routed, the request id, and the cost.
Every FluxRouter response carries X-Flux-* headers that tell you exactly what happened: which model answered, whether your request was routed, the request id, and the cost in USD. The response body stays in standard OpenAI or Anthropic shape, so these headers are where the routing detail lives.
Which headers should I look at?
| Header | What it tells you |
|---|---|
X-Flux-Model | The model that actually served the response |
X-Flux-Original-Model | The model id you requested (for example flux-auto) |
X-Flux-Routed | Whether the request was routed to a different model |
X-Flux-Request-Id | Unique id for this request, include it when contacting support |
X-Flux-Cost-Usd | The cost of this request in USD |
How do I see the headers?
Symptom: You want to confirm which model answered or what a call cost.
Cause: SDKs return the parsed body by default and hide response headers, so the routing detail is not visible unless you ask for it.
Fix: Use curl -i to print the response headers alongside the body.
curl -i https://api.fluxrouter.ai/v1/chat/completions \
-H "Authorization: Bearer sk-..." \
-H "Content-Type: application/json" \
-d '{
"model": "flux-auto",
"messages": [{ "role": "user", "content": "ping" }]
}'
The response begins with the status line and headers:
HTTP/2 200
x-flux-model: <model that served the request>
x-flux-original-model: flux-auto
x-flux-routed: true
x-flux-request-id: <unique id>
x-flux-cost-usd: 0.0000123
content-type: application/json
HTTP header names are case-insensitive, so you may see them lowercased.
How do I read the headers from my SDK?
Symptom: You want the model and cost inside your application, not just in curl.
Cause: The parsed convenience response drops headers.
Fix: Use the raw-response accessor your SDK provides, then read the header.
from openai import OpenAI
client = OpenAI(api_key="sk-...", base_url="https://api.fluxrouter.ai/v1")
response = client.chat.completions.with_raw_response.create(
model="flux-auto",
messages=[{"role": "user", "content": "ping"}],
)
print(response.headers.get("x-flux-model"))
print(response.headers.get("x-flux-cost-usd"))
print(response.headers.get("x-flux-request-id"))
completion = response.parse() # the normal typed response
print(completion.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.FLUX_API_KEY,
baseURL: "https://api.fluxrouter.ai/v1",
});
const { data, response } = await client.chat.completions
.create({
model: "flux-auto",
messages: [{ role: "user", content: "ping" }],
})
.withResponse();
console.log(response.headers.get("x-flux-model"));
console.log(response.headers.get("x-flux-cost-usd"));
console.log(response.headers.get("x-flux-request-id"));
console.log(data.choices[0].message.content);
Why does X-Flux-Model differ from what I requested?
Symptom: You sent flux-auto but X-Flux-Model shows a different model.
Cause: flux-auto picks a model for you, and X-Flux-Routed will be true. X-Flux-Original-Model shows what you asked for; X-Flux-Model shows what served it.
Fix: This is expected behavior. To always get a specific model, pin one of the flux-pinned-* aliases instead of flux-auto. See Models.
Always grab the request id for support
When something goes wrong, copy X-Flux-Request-Id from the failing response and include it in your support request. It is the fastest way for support to find your exact call.