Skip to content

Request headers

What the gateway reads from your request. Standard HTTP headers aren't listed. Header names are case-insensitive.

Your key

Send your key in whichever header your SDK already uses. All three are equal: same keys, no order of precedence.

Header Format Sent by
Authorization Bearer <key> OpenAI SDKs and most tools
x-api-key <key> Anthropic SDKs
x-goog-api-key <key> Google Gen AI SDKs
  • Several at once are accepted when they carry the same key. Different keys: 401 conflicting_auth_headers. The gateway never picks one silently.
  • Not accepted: Azure's api-key header, and a key in the address (?key=).
  • Never forwarded. The gateway removes your key and calls the provider with the provider's own credentials, which your app never sees.

Headers you may send

Header Values Use it to Sent to the provider
x-request-id Up to 128 characters: letters, digits, . _ : - Join Vidai's record of the call with your own. Kept with the call beside the gateway's id. A value outside the format is ignored; the call still goes through Yes, unchanged
x-trace true Make sure this call's record is kept in Request logs, even when logging would skip it. Any other value is ignored; you can't turn logging down No
x-vidai-translation default or preserve Choose the translation profile for this call. Only when your key allows it; otherwise ignored, the call still succeeds, and x-vidai-adapted lists x-vidai-translation No
x-provider A provider's name in your organisation Choose the provider for a call that names no model (files, batches, uploads, fine-tuning). On a call with a model, it only skips a lookup No
x-model A model name Skip reading the body for the model name on a POST that carries one; the gateway takes the name from the header No

x-provider is a choice, not a way round a rule

  • A model belongs to one provider. Naming another for it: 400 provider_override_not_allowed.
  • A key limited to some models may name only a provider that serves one of them.
  • A routing rule that sends the call to a provider wins over the header.
  • An unknown provider name: refused on a call with no model; ignored on a call with a model.

Provider headers the gateway reads

You send these because your SDK does; there's nothing to set.

Header Effect
anthropic-version, anthropic-beta Mark a call as Anthropic format where paths are shared (/v1/files). Forwarded to Anthropic. If an Anthropic model gets no anthropic-version, the gateway adds 2023-06-01. On the way to another provider, Anthropic beta features are mapped where they can be, and dropped otherwise

Headers the gateway doesn't read

No user, session, tag, idempotency or traceparent headers are read. Who made a call comes from the key; to tie a call to your own trace, send x-request-id.