Cross-Provider Translation
Translate OpenAI-format requests to Anthropic, Google, and other providers transparently.
Cross-Provider Translation
Send OpenAI-format requests to Anthropic, Google, or Bedrock — the gateway translates the request body and maps the response back.
Tier: Available on all tiers.
Feature flag: CROSS_PROVIDER_TRANSLATION_ENABLED — defaults to OFF. Enable per-environment after validation.
How It Works
When enabled and the model prefix matches a native provider, the gateway:
- Translates the OpenAI-format request body to the native provider format
- Sets
Cova-Gateway-Mode: translatedresponse header - Sets
Cova-Translation-Warningheader with dropped fields (if any) - Maps the response back to OpenAI format (requires
RESPONSE_MAPPING_ENABLEDtoo)
Supported Translations
| Direction | Model Prefix |
|---|---|
| OpenAI → Anthropic | anthropic/... |
| OpenAI → Google | google/... |
| OpenAI → Bedrock | bedrock/... |
Usage
curl https://gateway.corevalue.dev/v1/chat/completions \
-H "Authorization: Bearer sk-cova-..." \
-H "Content-Type: application/json" \
-d '{"model":"anthropic/claude-3-5-sonnet","messages":[{"role":"user","content":"Hello"}]}'The gateway translates this OpenAI-format request to Anthropic Messages API format, forwards it, and maps the response back to OpenAI format.
Checking Translation Status
Check the Cova-Gateway-Mode response header:
import { wrap } from "@cova/gateway";
const covaResponse = wrap(response, response.headers);
if (covaResponse.gateway.gatewayMode === "translated") {
console.log("Request was translated");
if (covaResponse.gateway.translationWarning) {
console.log("Dropped fields:", covaResponse.gateway.translationWarning);
}
}Translation Warnings
Some OpenAI fields don't have equivalents in Anthropic/Google formats. When fields are dropped, the Cova-Translation-Warning header lists them (comma-separated).
Both flags required: For full round-trip translation (request + response), enable both
CROSS_PROVIDER_TRANSLATION_ENABLED and RESPONSE_MAPPING_ENABLED.
Related: Response Mapping maps only the response (not the request). fetchNative is an alternative — use native format directly without translation.