> ## Documentation Index
> Fetch the complete documentation index at: https://docs.routor.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Router Metadata

> Every response tells you which model answered, why it was chosen, and what it saved.

Routing that you cannot inspect is routing you have to trust. Every Routor response carries the full decision in its headers, on every request, with nothing to enable.

```bash theme={null}
curl -i https://api.routor.io/v1/chat/completions \
  -H "Authorization: Bearer sk-routor-..." \
  -H "Content-Type: application/json" \
  -d '{"model":"auto","messages":[{"role":"user","content":"Summarize my todo list"}]}'
```

```text theme={null}
X-Request-Id         req_01JQ8F3K2M
X-Routor-Model       google/gemma-4-31b
X-Routor-Tier        SIMPLE
X-Routor-Category    simple_qa
X-Routor-Confidence  0.65
X-Routor-Method      rules
X-Routor-Profile     auto
X-Routor-Savings     97.0%
X-Routor-Quality     82.4
X-Routor-Reasoning   rules: score=-0.088, confidence=0.65, signals=[simple (summarize)...]
```

***

## Header reference

| Header | Example | What it tells you |
| - | - | - |
| `X-Request-Id` | `req_01JQ8F3K2M` | Unique id for this request. Quote it in support tickets. |
| `X-Routor-Model` | `google/gemma-4-31b` | The model that actually answered. |
| `X-Routor-Tier` | `SIMPLE` | Difficulty grade: `NANO`, `SIMPLE`, `LIGHT`, `STANDARD`, `COMPLEX`. |
| `X-Routor-Category` | `simple_qa` | Topic bucket, one of 17. Empty if none matched. |
| `X-Routor-Confidence` | `0.65` | How sure the scorer was, 0 to 1, two decimals. |
| `X-Routor-Method` | `rules` | Which path decided: `rules` or `embedding`. |
| `X-Routor-Profile` | `auto` | Routing profile in force: `auto`, `tier`, or `direct`. |
| `X-Routor-Savings` | `97.0%` | Saved against Claude Opus 5 at its published rate. See the note below. |
| `X-Routor-Quality` | `82.4` | Benchmark score of the chosen model against the quality baseline. |
| `X-Routor-Reasoning` | `rules: score=-0.088...` | The signals that drove the decision, in plain text. |
| `X-Routor-History-Floor` | `STANDARD` | Present only when conversation history raised the floor. See [Conversation Memory](/conversation-memory). |
| `X-Routor-Fallback` | `true` | Present only when the first choice failed and a fallback answered. |

<Note>
  `X-Routor-Savings` is measured against Claude Opus 5 at its published rate, \$5 per million input tokens and \$25 per million output tokens, not against whichever model you would otherwise have used. If you want the saving against a specific model, compute it from that model's published rate and the token counts in the response body.
</Note>

***

## Reading them in a browser

All twelve headers are listed in the API's CORS `exposedHeaders`, so front end code can read them cross origin. Custom headers are invisible to JavaScript unless a server opts in this way, which most APIs never do.

```js theme={null}
const res = await fetch("https://api.routor.io/v1/chat/completions", {
  method: "POST",
  headers: { Authorization: `Bearer ${key}`, "Content-Type": "application/json" },
  body: JSON.stringify({ model: "auto", messages }),
});

console.log(res.headers.get("x-routor-model"));   // google/gemma-4-31b
console.log(res.headers.get("x-routor-tier"));    // SIMPLE
console.log(res.headers.get("x-routor-savings")); // 97.0%
```

Header names are case insensitive, and `fetch` lowercases them.

***

## Two details worth knowing

**Headers arrive before the body, including when streaming.** The routing decision is made before the first token is requested, so a streaming client can display the model name immediately rather than waiting for the stream to finish.

**`X-Routor-Reasoning` is stripped to printable ASCII.** The reasoning string is built with arrow glyphs for terminal logs, and HTTP header values cannot carry them. Expect spaces where a non-ASCII character was.

***

## Deciding without spending

To see a routing decision without calling a model or being billed, send the prompt to the debug endpoint. It runs the real pipeline and returns the whole decision as JSON.

```bash theme={null}
curl https://api.routor.io/v1/routing/debug \
  -H "Authorization: Bearer sk-routor-..." \
  -H "Content-Type: application/json" \
  -d '{"messages":[{"role":"user","content":"Refactor this module"}]}'
```

See [Routing Debug](/api/debug) for the full response shape.
