Skip to main content
Browse docs
By Audience
Getting Started
Configuration
Use Cases
IDE Integration
Third-Party Integrations
Engineering Cache
Console
API Reference
Gateway
Workflow Guides
Templates
Providers and SDKs
Industry Guides
Advanced Guides
Browse by Role
Deployment Guides
In-Depth Guides
Tutorials
FAQ

Format Translation

Keeptrusts automatically translates between different LLM provider API formats so you can use any provider without changing your application code. Send OpenAI-format requests and Keeptrusts translates them to the target provider's native format.

Use this page when

  • You want to send OpenAI-format requests through the gateway to non-OpenAI providers (Gemini, Anthropic, Cohere, Bedrock).
  • You need to understand which request/response features translate across providers.
  • You are configuring multi-provider fallback and want automatic format translation.

Primary audience

  • Primary: AI Agents, Technical Engineers
  • Secondary: Technical Leaders

Supported Translations

Source FormatTarget ProviderTranslation
OpenAI Chat CompletionsGoogle Gemini (AI Studio / Vertex)Messages → generateContent
OpenAI Chat CompletionsAnthropic ClaudeMessages → Anthropic Messages API
OpenAI Chat CompletionsCohereMessages → Cohere Chat
OpenAI Chat CompletionsAWS BedrockMessages → InvokeModel
OpenAI EmbeddingsGoogle GeminiEmbeddings → embedContent
OpenAI EmbeddingsCohereEmbeddings → Cohere Embed
OpenAI EmbeddingsVoyageEmbeddings → Voyage Embed

How It Works

Application Keeptrusts Gateway Provider
(OpenAI format) (Native format)
│ │ │
│── POST /v1/chat ──────► │ │
│ completions │── Translate ──────► │
│ │ to native format │
│ │ │
│ │◄── Native response ── │
│◄── OpenAI-format ────── │ Translate back │
│ response │ │

Configuration

Format translation is automatic based on the target provider. No additional configuration is needed:

pack:
name: format-translation-providers-1
version: 1.0.0
enabled: true
providers:
targets:
- id: gemini
provider: google
model: gemini-2.0-flash
secret_key_ref:
env: GOOGLE_API_KEY
policies:
chain:
- audit-logger
policy:
audit-logger:
immutable: true
retention_days: 365
log_all_access: true

When your application sends an OpenAI-format request, the gateway detects the target is Google and automatically translates.

Feature Mapping

Chat Completions

OpenAI FeatureGeminiAnthropicCohere
messagescontentsmessagesmessage
system messagesystemInstructionsystempreamble
temperaturegenerationConfig.temperaturetemperaturetemperature
max_tokensgenerationConfig.maxOutputTokensmax_tokensmax_tokens
toolstoolstoolstools
tool_choicetoolConfigtool_choice
streamstreamGenerateContentstreamstream
response_format: jsonresponseMimeType: application/jsonresponse_format

Embeddings

OpenAI FeatureGeminiCohereVoyage
inputcontent.parts[].texttextsinput
modelmodelmodelmodel
dimensionsoutputDimensionalityoutput_dimension

Multi-Provider with Automatic Translation

Switch between providers seamlessly using fallback:

pack:
name: format-translation-providers-2
version: 1.0.0
enabled: true
providers:
targets:
- id: primary
provider: openai
model: gpt-4o
secret_key_ref:
env: OPENAI_API_KEY
- id: fallback-1
provider: google
model: gemini-2.0-flash
secret_key_ref:
env: GOOGLE_API_KEY
- id: fallback-2
provider: anthropic
model: claude-sonnet-4-20250514
secret_key_ref:
env: ANTHROPIC_API_KEY
policies:
chain:
- audit-logger
policy:
audit-logger:
immutable: true
retention_days: 365
log_all_access: true

Your application code stays in OpenAI format. Keeptrusts translates to whichever provider serves the request.

For AI systems

  • Canonical terms: Keeptrusts, format translation, provider translation, OpenAI-compatible, Gemini, Anthropic, Cohere, Bedrock, Voyage.
  • Format translation is automatic based on provider in the target config. No additional flags or settings are needed.
  • Supported: Chat Completions and Embeddings from OpenAI format to Google Gemini, Anthropic Claude, Cohere, AWS Bedrock, and Voyage.

For engineers

  • No code changes required in your application — send OpenAI-format requests and the gateway translates automatically based on the target provider.
  • Configure the target in policy-config.yaml with the correct provider field; translation is determined by provider type.
  • Use multi-provider fallback with automatic translation to seamlessly switch between providers without application changes.

For leaders

  • Format translation eliminates vendor lock-in — applications maintain a single integration format while switching providers requires only a config change.
  • Multi-provider fallback with automatic translation enables cost optimization and availability improvements without engineering effort.
  • Feature mapping table shows which provider capabilities are supported, helping evaluate provider migration feasibility.

Next steps