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:
| Transform | From | To |
|---|---|---|
ant2oai | Anthropic response | OpenAI chat.completion |
goog2oai | Google response | OpenAI chat.completion |
oaiChat2responses | OpenAI chat.completion | Responses 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).