What's different from calling the gateway directly

FreeRouter forwards your request body and relays the gateway's answer. This page lists everything it adds, strips, refuses or limits on the way, so nothing surprises you after the base-URL swap.

Response headers FreeRouter adds

HeaderWhenValue
X-FreeRouter-Request-IdEvery response, errors includedOpaque id for support and Logs correlation.
request-id/v1/messages, errors includedThe same id under the name the Anthropic SDKs read.
X-FreeRouter-ProviderWhenever a gateway was calledThe gateway that answered.
X-FreeRouter-AttemptsEvery /v1 responseUpstream calls made; 0 when the request never left FreeRouter.
X-FreeRouter-FailoverOnly after a failovergateway:reason,… for each losing attempt — see reading the failover headers.
X-FreeRouter-Dropped-ParamsOnly when a field or model suffix was omitted for the answering gateway (or when you sent OpenRouter's provider object)The names left off, comma-separated (e.g. transforms,usage, :nitro, or provider) — see Parameters FreeRouter omits.
X-FreeRouter-Model-FallbackOnly when your models fallback list served a backup candidateThe backup model that answered after every target failed to serve the primary.
X-FreeRouter-DecisionerWhen a decisioner ran on the keyWhich target it picked and why (Routing Rules → Decisioner).
X-FreeRouter-Key-Grace-UntilCalls made with a rotated key's old secretWhen that secret stops working.
X-FreeRouter-Responses-Mode/v1/responsesnative (gateway serves Responses itself) or translated (round-tripped through chat).
X-RateLimit-*, Retry-AfterEvery response that reached a gateway, and 429 after every target rate-limitedThe gateway's own rate-limit headers, passed through under its names (buffered, streamed and translated shapes alike); on a final 429, the last gateway's Retry-After. No other gateway header is forwarded.

The full header reference is in API Reference → Response headers.

Request headers forwarded — and not

HeaderForwarded?Note
HTTP-Referer, X-TitleYesOpenRouter app attribution. Values over 512 characters, or with control characters, are dropped silently.
Idempotency-KeyYesLets a gateway that honours it de-duplicate a client retry. Same 512-character cap.
Authorization, x-api-key, x-goog-api-keyNoYour FreeRouter key is replaced by the stored provider key for the chosen gateway.
Anything else (custom headers, User-Agent, cookies)NoForwarding is an allowlist; the three above are the whole list.

Request body

On the openai and openrouter shapes the body goes upstream as you sent it, apart from five things FreeRouter does on purpose: a model remap, alias or stripped OpenRouter suffix (:nitro, :floor, :exacto, :online, :extended on non-OpenRouter gateways) may rewrite model, a steering message may be prepended to the system prompt, the ad_request / link_request siblings are peeled off before forwarding, models / provider are taken off because FreeRouter handles them itself, and any field a gateway does not accept — including OpenRouter-only extensions (transforms, plugins, route, usage) on non-OpenRouter hops — is left off that gateway's attempt only (Providers → Parameters FreeRouter omits; X-FreeRouter-Dropped-Params names everything omitted). Streaming chat completions also get stream_options.include_usage: true unless you explicitly set include_usage yourself. The anthropic and google shapes are translated to the gateway's chat format and back — on anthropic that includes extended thinking (budget out, thinking blocks back), document blocks as file parts and server tools passed through, while top_k and cache_control are dropped; the full list is in API Reference → anthropic. OpenRouter's models list (with or without a top-level model) runs as a cross-gateway fallback and its provider object is reported as dropped, never silently ignored — see API Reference.

Not supported

FeatureWhat happensInstead
POST /v1/completions (legacy)404 not_foundUse /v1/chat/completions.
POST /v1/embeddings on a gateway with no embeddings routeSkipped (no-embeddings); 501 embeddings_unsupported when no target has oneRoute the key to a gateway that serves embeddings — see API Reference → embeddings.
POST /v1/images/generations or POST /v1/images on a gateway with no image routeSkipped (no-images); 501 images_unsupported when no target has oneRoute the key to a gateway that serves image generation — see API Reference → images.
POST /v1/messages/count_tokens with the model's own tokenizerServed locally as an estimate (X-FreeRouter-Count-Tokens: estimate)Budget with it; bill from usage on the response. See count_tokens.
Gemini cachedContent and Google Files API URIs (files/…)400 INVALID_ARGUMENTPass images via inlineData (base64) or public https:// image URLs in fileData. (:streamGenerateContent, /v1beta, and multi-turn functionCall / functionResponse are supported.)
Browser calls (CORS) on /v1No Access-Control-* headers; the browser blocks the responseCall from a server. Your key would be visible in the page anyway.
OpenAI file ids (/v1/files, file_id in batches)404 not_foundSend files by URL; batches take their requests inline.
POST /v1/moderations and POST /v1/audio/speech on a gateway with no such routeSkipped; 501 moderations_unsupported / audio_unsupported when no target serves itRoute the key to a gateway that serves the endpoint — see API Reference.
POST /v1/audio/transcriptions (multipart upload)501 audio_unsupportedTranscribe via a gateway-direct call for now; JSON endpoints above are proxied.
Realtime API (wss /v1/realtime)Not served — no WebSocket surfaceKeep realtime sessions on your gateway-direct connection.
Responses conversation objectsRejectedUse previous_response_id on a chain-capable gateway (chaining).

Limits and timeouts

LimitDefaultRangeNote
JSON body10 MB—Over it: 413 request_too_large. Batch submits stream through and are exempt.
Failover timeout (first byte)5 s1–30 s per key or per targetStreaming requests only: a non-last target that sends no first byte in time is abandoned and the next one tried. Buffered requests wait the full upstream timeout, because most gateways send headers only with the finished completion.
Upstream timeout60 s5–90 s per keyCapped at 90 s because Cloudflare returns 524 when the origin is silent for about 100 s.
Request deadline95 splatform-wideThe whole request — every failover hop, remap, decisioner pick and MCP tool round together. A hop gets only the time left; past the deadline no further target is called and the request fails with the last failure or 504 deadline_exceeded. A response that has started streaming is never cut.
Failover triggersConnection errors, timeouts, and upstream 401 / 402 / 403 / 404 / 429 / 5xx — on buffered and streaming requests alike. Set in Routing Rules → Timeouts.
Rate limitNone on FreeRouter's side. 429s come from the gateways and fail over.

Added latency

Sub-millisecond for a plain routing decision, 20–30 ms when remaps, translation or a drained failover attempt are involved. The breakdown, and how the dashboard separates router time from upstream time, is in Usage & Spend → What latency does FreeRouter add?.

IP allowlist scope

A workspace allowlist and a per-key allowlist can both be set; when either is non-empty the caller must be admitted by every non-empty list, or the request is refused with 403 ip_not_allowed naming the address seen. The lists cover inference on /v1 only — management keys and the MCP server at /mcp are not covered. Details: API Reference → IP allowlists.

Responses chaining

previous_response_id is honoured, but the id FreeRouter returns (resp_fr_…) is pinned to the provider that produced it: a chained turn goes back to that provider with no failover, and only chain-capable gateways can continue a thread. A chained turn whose provider is no longer on the key answers 409 response_chain_target_unavailable. The gateway list and the rules are in API Reference → Responses chaining.

Next Use your SDK