Skip to content

Translation between API formats

Code written for one provider's SDK is code locked to that provider. The gateway removes the lock: an app keeps the SDK it has (OpenAI's, Anthropic's or Google's) and calls any model, from any provider. Requests, streams and tool calls are translated both ways, so the app sees its own SDK's shapes whichever provider answered.

What it is

Each provider speaks its own API format. When an app's format and the model's provider differ, the gateway rewrites the call on the way in (body, path, authentication) and the answer on the way back, streams included.

flowchart LR
    A["App on the<br/>Anthropic SDK"] -- "Messages format" --> GW["Gateway"]
    GW -- "OpenAI format" --> P["Azure OpenAI<br/>gpt-4.1-eu"]
    P -- "OpenAI answer" --> GW
    GW -- "Messages answer,<br/>stream and tool calls" --> A
Your app uses Can call models on
The OpenAI SDK (Chat Completions) OpenAI, Azure OpenAI, Anthropic, AWS Bedrock, Google Gemini, Google Vertex AI and OpenAI-compatible providers
The Anthropic SDK (Messages) The same
The Google GenAI SDK (generateContent) The same

What's translated: messages, system prompts, streams in the caller's own event format, tool definitions and tool calls, structured output and reasoning settings where the other side has them. Errors come back in the caller's own SDK format too, so its usual error handling works, with one code to match on in x-vidai-error-code.

What can't be carried is said, never dropped silently

Some settings have no equivalent on the other side. The gateway adapts what it can and lists anything it changed or couldn't carry in the x-vidai-adapted header of the answer, under the name your app sent. A call never fails just because one setting has no equivalent.

A key's translation profile

Each key says how the gateway translates for it. Organisation admins choose it when issuing a key, or later:

On screen What it does
Standard The gateway's usual translation. Every key starts here
Keep what the other format can't say Where it can, the gateway carries over a near-equivalent setting (such as a service tier) instead of leaving it out. For apps that rely on a provider's own options
Let apps choose the translation per call An app using the key may ask for the other profile on a single call, with x-vidai-translation. Off by default

Every answer from a provider says which profile it used, in x-vidai-translation-profile.

A key's detail showing Translation: Standard, with the choice an organisation admin makes on Edit

What stays in its own format

Chat (Chat Completions, Messages, generateContent) translates across providers. Other endpoints, such as embeddings, the Responses API, images, audio, files and batches, go only to a provider of the same format; anything else gets a clear error, never a silent reroute. The developer reference lists every endpoint.