Receipts: which model answered and what it cost

The core X-Flux-* response headers that show which model served your request, whether Flux routed it, the request id and the cost, and how to read them in curl and your SDK.

Every Flux response carries a receipt in its X-Flux-* headers: which model answered, whether Flux changed the model you asked for, a request id for support, and what the request cost. The response body stays in standard OpenAI or Anthropic shape, so the headers are where this detail lives.

The core headers

HeaderExample valueMeaning
X-Flux-Modelthe model that answeredThe model that actually served the request
X-Flux-Original-Modelflux-autoThe model id you requested
X-Flux-Routedtrue / falseWhether Flux served a different model from the one you requested
X-Flux-Request-Ida unique idIdentifier to quote when contacting support
X-Flux-Cost-Usd0.000412What this request cost, in USD (non-streaming responses only)

Some responses carry a few more, such as x-flux-category and x-flux-cache. HTTP header names are case-insensitive, so you may see them in lower case.

Read them with curl

Use curl -i to print the response headers alongside the body:

bash
curl -i https://api.fluxrouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $FLUX_API_KEY" \
  -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.000412
content-type: application/json

Read them in your SDK

SDKs return the parsed body by default and hide response headers. Use the raw-response accessor your SDK provides, then read the header.

python
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)
ts
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?

flux-auto picks a model for you, so X-Flux-Routed is true and X-Flux-Model names the model that served the request, while X-Flux-Original-Model shows what you asked for. This is expected. When you pin a flux-pinned-* id, X-Flux-Routed is false, which is a quick way to confirm pinning is doing what you want. See Let Flux pick, or pin a model.

Cost on streaming responses

X-Flux-Cost-Usd is present on non-streaming responses only. On a stream the final cost is known only after the headers have been sent, so it cannot go in a header. Instead, the final chunk that carries usage includes usage.cost_usd and usage.currency; with the OpenAI SDK, ask for that chunk with stream_options={"include_usage": True}. The other core headers are present on streaming and non-streaming responses alike. See Stream responses.

What you pay is set by the alias you sent, not by which model answered. See Lanes and How billing works.

Keep the request id

Keep X-Flux-Request-Id in your logs. When something looks wrong, quote it in your support request so support can find your exact call. It is the fastest path to a useful answer.