GuidesGateway Features

Response Format Mapping

Normalize upstream provider responses into a consistent OpenAI-compatible shape via response mapping.

Response Format Mapping

Map responses from non-OpenAI providers (Anthropic, Google) into OpenAI format so your OpenAI SDK can parse them.

Tier: Available on all tiers.

Feature flag: RESPONSE_MAPPING_ENABLED — defaults to OFF. Enable per-environment after validation.

How It Works

When enabled, the gateway transforms the response body based on the upstream provider:

TransformFromTo
ant2oaiAnthropic responseOpenAI chat.completion
goog2oaiGoogle responseOpenAI chat.completion
oaiChat2responsesOpenAI chat.completionResponses API shape

Both streaming and non-streaming responses are mapped.

When to Use

  • You're using the OpenAI SDK but routing to Anthropic or Google via model prefix
  • You want a unified response format across providers
  • You're using the Responses API and routing to a chat.completion provider

Enabling Response Mapping

Set RESPONSE_MAPPING_ENABLED=true in your gateway environment.

Without vs With Mapping

Without mapping (passthrough)

curl https://gateway.corevalue.dev/v1/chat/completions \
  -H "Authorization: Bearer sk-cova-..." \
  -d '{"model":"anthropic/claude-3-5-sonnet","messages":[...]}'
# Response: Anthropic format (content blocks, stop_reason, etc.)

With mapping enabled

# Same request, but RESPONSE_MAPPING_ENABLED=true
# Response: OpenAI format (choices, finish_reason, etc.)

Related: Cross-Provider Translation also translates the request body (not just the response).

On this page