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

# Request metadata

> Opt in to a per-request report of what the gateway decided: the model and provider that served you, the mode, the attempts and the recorded tags.

Send the `X-Gateway-Metadata: enabled` header and the response gains one extra top-level block, `gateway_metadata`. Without the header the block is absent and nothing else changes, so it is safe to enable per request, for part of your traffic, or only while debugging. The block is also returned under its former name, `omnirelay_metadata`, with the same content, and the former header name `X-OmniRelay-Metadata` stays accepted (see [Compatibility](https://omnirelay.ai/docs/general/tags.md#compatibility)).

```bash theme={null}
curl https://api.omnirelay.ai/v1/chat/completions \
  -H "Authorization: Bearer $OMNIRELAY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Gateway-Metadata: enabled" \
  -d '{"model": "gpt-6-luna", "messages": [{"role": "user", "content": "Hello"}], "tags": {"client": "acme"}}'
```

The value is case-insensitive. Any value other than `enabled` is treated as off.

## What you get

```json theme={null}
{
  "id": "chatcmpl-6f1c…",
  "object": "chat.completion",
  "choices": [{"...": "..."}],
  "usage": {"...": "..."},
  "gateway_metadata": {
    "request_id": "6f1c…",
    "requested": "gpt-6-luna",
    "model": "gpt-6-luna",
    "provider": "OpenAI",
    "mode": "live",
    "strategy": "direct",
    "attempt": 1,
    "attempts": [{"provider": "OpenAI", "model": "gpt-6-luna", "mode": "live"}],
    "tags": {"client": "acme"}
  }
}
```

| Field | Meaning |
| - | - |
| `request_id` | The request ID, the same as the `X-Request-ID` response header. Quote it to support |
| `requested` | The model ID you sent |
| `model`, `provider` | The model that served the call and its provider |
| `mode` | `live`: a real provider was called |
| `strategy` | How the model was resolved. Each model has one channel today, so this is always `direct` |
| `attempt`, `attempts` | Which attempt served and every attempt made. There is no fallback yet, so there is exactly one |
| `tags` | The [Tags](https://omnirelay.ai/docs/general/tags.md) recorded for this call after merging the key's defaults, the header and the body, or `{}` |
| `deprecated_header` | Only when the request sent `X-OmniRelay-Tags` or `X-OmniRelay-Metadata` together with its current name carrying a different value: the old header that was ignored |

`strategy`, `attempt` and `attempts` are there so the shape does not change when routing and fallback arrive. They report what actually happened, never a plan.

## On a stream

With `stream: true` the block rides the **first** chunk, because the model and provider are settled before any token is generated. Later chunks do not repeat it.

## In the console

The API debug tool on the **Playground** page always requests metadata, so the block appears in its response panel without the header.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.