API Headers Reference
Headers you can send with requests to the FreeInference API.
Authentication
X-API-Key
Alternative authentication header. Accepts the same API key value without the Bearer prefix.
X-API-Key: hyi-your-api-key
Request Behavior
X-Reasoning-Passthrough
Controls how reasoning_content is handled in responses from /v1/chat/completions.
Value |
Behavior |
|---|---|
(missing or any other value) |
Passthrough mode — |
|
Strict OpenAI mode — |
X-Reasoning-Passthrough: false
X-Session-ID
Attach a stable session identifier for request correlation. This value is logged and can be used to trace a session across multiple requests.
X-Session-ID: 20260503-120000-abc123
X-Probe
Mark a request as a synthetic health probe. When set to synthetic (case-insensitive), the request does not affect metrics or generate verbose logs.
X-Probe: synthetic
X-Route-Pin
Force routing to a specific provider backend. Admin-only — silently ignored for non-admin users.
X-Route-Pin: provider-name
Anthropic API
Anthropic-Version
Optional — used only for Anthropic client detection (e.g., to switch the response shape returned by /v1/models). Not enforced on /v1/messages or /anthropic/v1/messages, and not forwarded upstream by this gateway.
Anthropic-Version: 2023-06-01
anthropic-beta
Enable Anthropic beta features. This header is forwarded directly to the upstream Anthropic API.
anthropic-beta: feature-name
Tracing
X-Request-ID
Attach a custom request identifier. If not provided, one is auto-generated. The value is echoed back in the response.
X-Request-ID: my-custom-request-id
Qdrant Proxy
api-key
Authentication for the Qdrant proxy endpoint at /v1/qdrant/. Mapped to Authorization: Bearer <value> internally.
api-key: your-qdrant-key
Proxy Headers
The following headers are used for client IP resolution when the server is behind a reverse proxy (requires TRUST_PROXY_HEADERS=1):
Resolution order (first match wins):
Header |
Description |
|---|---|
|
The visitor’s real IPv6 address. Sent by Cloudflare only when Pseudo IPv4 is set to “Overwrite headers”, where |
|
Client IP as set by Cloudflare. Preferred over the forwarding headers — Cloudflare always overwrites this one, while it only appends to |
|
Fallback for non-Cloudflare proxies (the first routable entry is used; leading private/loopback/ULA hops an intermediary inserted are skipped) |
|
Fallback client IP header |
If none match — or TRUST_PROXY_HEADERS is not 1 — the socket peer address is used.
IPv6 client addresses are logged in full. For per-client rate limits and sticky
routing they are grouped by /64, since a single client is typically delegated
an entire prefix and its addresses may rotate. IPv4 addresses — including
IPv4-mapped literals such as ::ffff:192.0.2.1 — are grouped per address.
Standard Headers
Header |
Description |
|---|---|
|
Request content type (e.g., |
|
Client identification; affects Anthropic client detection |
|
Logged for debugging |