GuidesGateway Features

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:

  1. Translates the OpenAI-format request body to the native provider format
  2. Sets Cova-Gateway-Mode: translated response header
  3. Sets Cova-Translation-Warning header with dropped fields (if any)
  4. Maps the response back to OpenAI format (requires RESPONSE_MAPPING_ENABLED too)

Supported Translations

DirectionModel Prefix
OpenAI → Anthropicanthropic/...
OpenAI → Googlegoogle/...
OpenAI → Bedrockbedrock/...

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.

On this page