Any SDK to any provider¶
Purpose: your code is written against one provider's API, but the best model for the job, or the one your organisation has approved, sits behind another. The gateway translates each call both ways, so the OpenAI SDK can reach a Claude model and the Anthropic SDK a Gemini one, with no change to your code. When something can't be carried exactly, the answer says so, by name, instead of failing.
What's translated¶
Three call shapes translate in every direction:
| You call | In the format of | It can reach |
|---|---|---|
POST /v1/chat/completions |
OpenAI | OpenAI, Azure OpenAI, Anthropic, Bedrock (Claude, and other Bedrock models), Gemini, Vertex AI |
POST /v1/messages |
Anthropic | the same |
POST /v1beta/models/{model}:generateContent and :streamGenerateContent |
Gemini | the same |
What travels with the call:
- Requests and answers, messages, system prompts, images.
- Streams, in your own SDK's event protocol: an Anthropic client gets
message_start,content_block_deltaand the rest; a Gemini client gets Gemini chunks. - Tool calls, including the round trip of tool results.
- Reasoning: Anthropic's
thinking, OpenAI'sreasoning_effortand Gemini'sthinkingConfigmap to the nearest setting on the model that serves the call. - Structured output: JSON schemas and JSON mode.
- Usage, in your SDK's own fields, including cached tokens where the provider reports them.
Other endpoints (embeddings, images, audio, files, batches, the Responses API) work with a provider of the same format. Endpoints lists which is which.
How it tells you: x-vidai-adapted¶
Some settings have no equivalent on the other side: top_k for an OpenAI model, seed for Claude, a temperature
above Claude's range. The gateway doesn't refuse the call for that. It drops the setting, clamps it to the target's
range, or sends the nearest equivalent, and lists what it did in the x-vidai-adapted response header:
x-vidai-adapted: seed,top_k
- Names are your own SDK's field names, so you can find them in your code. A Gemini client sees Gemini names, with
nested settings written as
generationConfig.<name>(for examplegenerationConfig.topK). - No header means nothing needed adapting, or the call went to a provider of your own format, where everything is sent as you wrote it.
- The call succeeded.
x-vidai-adapteddescribes a served call; it isn't an error.
Some tokens you may see:
| Token | What happened |
|---|---|
any field name you sent (seed, logit_bias, top_k, safetySettings, …) |
That setting has no equivalent on the model that served the call, and wasn't sent |
temperature |
Clamped to the target's range (Claude takes 0 to 1) |
n |
You asked for several answers; the target gives one |
thinking, thinkingConfig, reasoning_effort |
Reasoning couldn't be carried to this model, or its budget was clamped |
web_search, tools.googleSearch |
The model that served the call can't search the web; the call was served without it |
strict, response_format |
Strict schemas, or JSON mode, weren't available on the target; the schema's bounds moved into descriptions where they could |
service_tier, serviceTier |
The service tier wasn't sent (see the translation profile) |
x-vidai-translation |
You asked for a translation profile on this call, but your key doesn't allow it |
The list is open: a field outside these shows under its own name. Response headers has the full meaning of the header.
To read it from your SDK:
raw = client.chat.completions.with_raw_response.create(
model="claude-haiku-4-5", # served by Anthropic, called in OpenAI format
messages=[{"role": "user", "content": "Hi"}],
seed=7,
)
adapted = raw.headers.get("x-vidai-adapted", "")
if adapted:
log.info("Vidai adapted: %s", adapted) # "seed"
const { response } = await client.chat.completions
.create({ model: "claude-haiku-4-5", messages: [{ role: "user", content: "Hi" }], seed: 7 })
.withResponse();
const adapted = response.headers.get("x-vidai-adapted");
if (adapted) console.info(`Vidai adapted: ${adapted}`); // "seed"
The translation profile¶
Some settings have a near equivalent on another provider rather than an exact one. That's the service tier: "flex" or "priority" on one provider means something similar, at that provider's own price, on another. Each key says how to treat them:
| On the key (Translation between API formats) | Header value | What happens |
|---|---|---|
| Standard (every key starts here) | default |
Exact equivalents only. A near equivalent falls back to the provider's default, and x-vidai-adapted names it |
| Keep what the other format can't say | preserve |
Near equivalents are carried too: a "priority" request is served at priority on the other provider, at that provider's priority price |
Every answer from a provider says which applied, in x-vidai-translation-profile. Organisation admins choose a key's
profile when issuing it, or later with Edit on the key.

Choose it for one call¶
When a key also has Let apps choose the translation per call, your app can choose for a single call with the
x-vidai-translation header. The header is never sent to the provider.
curl "$VIDAI_GATEWAY/v1/chat/completions" \
-H "Authorization: Bearer $VIDAI_KEY" \
-H "x-vidai-translation: preserve" \
-H "Content-Type: application/json" \
-d '{"model": "claude-haiku-4-5", "service_tier": "priority",
"messages": [{"role": "user", "content": "Hi"}]}'
reply = client.chat.completions.create(
model="claude-haiku-4-5",
service_tier="priority",
messages=[{"role": "user", "content": "Hi"}],
extra_headers={"x-vidai-translation": "preserve"},
)
const reply = await client.chat.completions.create(
{ model: "claude-haiku-4-5", service_tier: "priority", messages: [{ role: "user", content: "Hi" }] },
{ headers: { "x-vidai-translation": "preserve" } },
);
If the key doesn't allow it, or the value is anything but default or preserve, the call still succeeds under the
key's own profile, and x-vidai-adapted lists x-vidai-translation.
Good to know¶
- Anthropic's
bashandtext_editortools have no equivalent elsewhere: a call with them to a non-Anthropic model is refused with 400. - Anthropic's
cache_controlmarkers are removed on the way to another provider. Cache savings still show in your usage, but you can't choose which parts are cached. - Thinking signatures can't be carried to another provider, so a multi-turn conversation that depends on them is best kept on Claude.
- For images sent by address to a Gemini model from the Anthropic SDK, send them inline (base64) for the most predictable result.
- Translation adds 1 to 2 ms to a call, and a little per chunk while streaming.