Skip to content

Protocol Conversion Compatibility ​

Troubleshooting

Encountering errors? See the API Error Codes Reference for a complete list of error types and troubleshooting steps.

OpenQiao lets you call the same model catalog through different API protocols. This page explains how common request parameters, response fields, and streaming events are mapped when requests are converted across protocols, and which fields do not have an equivalent in the target protocol.

This page is based on the conversion behavior in OpenQiao/rosetta-ai. rosetta-ai covers all 12 pairwise converters between OpenAI Chat Completions, OpenAI Responses, Anthropic Messages, and Google Gemini.

Protocol Names ​

Short nameProtocolOpenQiao API reference
Chat CompletionsOpenAI Chat CompletionsCreate a Chat Completion
ResponsesOpenAI ResponsesCreate a Model Response
MessagesAnthropic MessagesCreate a Message
GeminiGoogle Gemini / Vertex AI Generate ContentGenerate Content

Support Overview ​

Read this table from the source protocol perspective. For example, the Chat Completions column shows where a field can be converted when your request starts in the OpenAI Chat Completions format.

Field categoryChat CompletionsMessagesResponsesGemini
Model modelAllAllAllAll
System / instructionsAllAllAllAll
temperatureAllAllAllAll
top_pAllAllAllAll
top_kNot supportedGeminiNot supportedMessages
Max tokensAllAllAllAll
Stop sequencesMessages / GeminiChat Completions / GeminiNot supportedChat Completions / Messages
Function toolsAllAllAllAll
tool_choiceAllAllAllAll
Web searchAllAllAllAll
Reasoning / thinkingAllAllAllAll
JSON response formatAllAllAllAll
Image inputMessages / GeminiChat Completions / GeminiGeminiChat Completions / Messages
Documents / filesMessages / GeminiChat Completions / GeminiNot supportedChat Completions / Messages
Audio inputGeminiNot supportedNot supportedNot supported
seedGeminiNot supportedNot supportedChat Completions
frequency_penaltyGeminiNot supportedNot supportedChat Completions
presence_penaltyGeminiNot supportedNot supportedChat Completions
Candidate count n / candidateCountGeminiNot supportedNot supportedChat Completions
LogprobsResponses / GeminiNot supportedGeminiChat Completions / Responses
Parallel tool callsMessages / ResponsesChat Completions / ResponsesChat Completions / MessagesNot supported
Metadata / userMessages / ResponsesChat Completions / ResponsesMessages / Chat CompletionsNot supported
service_tierMessages / ResponsesChat Completions / ResponsesChat Completions / MessagesNot supported
Prompt cache keyResponsesNot supportedChat CompletionsNot supported
StreamingAllAllAllAll

Model support still applies

Protocol conversion only maps field shapes. It does not guarantee that every model supports the resulting capability. For exact support, check the supported parameters on the model detail page.

Chat Completions Request Conversion ​

Chat Completions → Messages ​

Chat Completions fieldMessages fieldNotes
modelmodelPassed through
messages system / developersystemJoined as text blocks
messages usermessages[] userText and images are supported; file content parts become an unsupported placeholder text
messages assistantmessages[] assistantText, tool_use, and thinking blocks
messages toolmessages[] user tool_resultConverted to tool result blocks
max_tokens / max_completion_tokensmax_tokensDefaults to 4096 when omitted
temperaturetemperaturePassed through
top_ptop_pPassed through
stopstop_sequencesString values become arrays
tools functiontools input_schemaJSON Schema becomes Anthropic tool schema
web_search_optionstools web_search_20250305Converted to Anthropic web search tool
tool_choicetool_choiceauto / required / none → auto / any / none; named functions become tool choices
parallel_tool_callstool_choice.disable_parallel_tool_useInverted semantics: false → true
response_format json_schemaoutput_config.formatJSON Schema output constraint
response_format json_objectoutput_config.formatJSON output format
reasoning_effortthinkingnone / minimal → disabled; low / medium / high → 2048 / 5120 / 10240 budget tokens
usermetadata.user_idUser identifier
service_tierservice_tierOnly auto / standard_only are forwarded
streamstreamPassed through

Not converted: frequency_penalty, presence_penalty, seed, n, logprobs, top_logprobs, logit_bias.

Chat Completions → Responses ​

Chat Completions fieldResponses fieldNotes
modelmodelPassed through
messagesinputConverted to Responses input items
max_completion_tokensmax_output_tokensMax output tokens
temperaturetemperaturePassed through
top_ptop_pPassed through
tools functiontools functionFunction tool definitions
web_search_optionstools web_searchConverted to Responses web search tool
tool_choicetool_choiceSupports auto / required / none and named functions
parallel_tool_callsparallel_tool_callsPassed through
response_formattext.formatJSON / JSON Schema output format
reasoning_effortreasoning.effortEffort is passed through
top_logprobsincludeRequests logprobs-related output
metadatametadataPassed through
service_tierservice_tierPassed through
prompt_cache_keyprompt_cache_keyPassed through
prompt_cache_retentionprompt_cache_retentionPassed through
streamstream + stream_optionsStreaming options

Not converted: frequency_penalty, presence_penalty, seed, n, logprobs, stop.

Chat Completions → Gemini ​

Chat Completions fieldGemini fieldNotes
modelmodelPassed through
messages system / developerconfig.systemInstructionSystem instruction
messages user / assistant / toolcontentsassistant becomes Gemini model role
max_tokens / max_completion_tokensconfig.maxOutputTokensMax output tokens
temperatureconfig.temperaturePassed through
top_pconfig.topPField rename
stopconfig.stopSequencesStop sequences
seedconfig.seedPassed through
frequency_penaltyconfig.frequencyPenaltyField rename
presence_penaltyconfig.presencePenaltyField rename
nconfig.candidateCountCandidate count
logprobsconfig.responseLogprobsWhether to return logprobs
top_logprobsconfig.logprobsNumber of top logprobs
tools functionconfig.tools[].functionDeclarationsUses parametersJsonSchema
web_search_optionsconfig.tools[].googleSearchConverted to Google Search
tool_choiceconfig.toolConfig.functionCallingConfigauto / required / none → AUTO / ANY / NONE; named functions use allowedFunctionNames
response_format json_schemaconfig.responseMimeType + config.responseJsonSchemaresponseMimeType is application/json
response_format json_objectconfig.responseMimeTypeapplication/json
reasoning_effortconfig.thinkingConfignone / minimal → thinkingBudget: 0; low / medium / high / xhigh → 2048 / 5120 / 10240 / 20480
image_url base64inlineDataImage bytes
image_url URLfileDataImage URL
file content partinlineData / fileDataFile input
input_audioinlineDataAudio input

Not converted: logit_bias, user.

Messages Request Conversion ​

Messages → Chat Completions ​

Messages fieldChat Completions fieldNotes
modelmodelPassed through
systemmessages[] systemString or TextBlockParam[] is joined as text
messages usermessages[] userText, image, document, and tool_result
messages assistantmessages[] assistantText, thinking, and tool_use
max_tokensmax_completion_tokensUses the newer field for reasoning models
temperaturetemperaturePassed through
top_ptop_pPassed through
stop_sequencesstopField rename
tools input_schematools functionJSON Schema tools
tools web_search_20250305 / web_search_20260209web_search_optionsmax_uses and user_location are mapped where possible
tool_choicetool_choice + parallel_tool_callsauto / any / none → auto / required / none; disable_parallel_tool_use: true → parallel_tool_calls: false
output_config.formatresponse_formatJSON / JSON Schema output format
thinkingreasoning_effortdisabled → none; enabled budget ≤2048 / ≤5120 / ≤10240 → low / medium / high
metadata.user_iduserUser identifier
service_tierservice_tierstandard_only → default
streamstream + stream_optionsIncludes usage by default

Document block conversion:

  • source.type: "base64" / "url" → Chat Completions file content part
  • source.type: "text" → text content part
  • source.type: "content" → nested text / image blocks are unpacked

tool_result content conversion:

  • text is preserved
  • search_result inner text is flattened
  • tool_reference keeps the tool name
  • Images and documents are skipped because the OpenAI tool role only accepts text content

Not converted: top_k, Anthropic-specific metadata fields.

Messages → Responses ​

Messages fieldResponses fieldNotes
modelmodelPassed through
systeminstructionsJoined text
messagesinputConverted to Responses input items
max_tokensmax_output_tokensMax output tokens
temperaturetemperaturePassed through
top_ptop_pPassed through
tools input_schematools functionTool definitions
tools web searchtools web searchConverted to Responses web search tool
tool_choicetool_choice + parallel_tool_callsauto / any / none → auto / required / none
thinkingreasoningBudget is mapped to effort
output_config.formattext.formatJSON Schema output format
metadata.user_idmetadata.user_idPassed through
service_tierservice_tierPassed through
streamstreamPassed through

Not converted: stop_sequences, top_k.

Messages → Gemini ​

Messages fieldGemini fieldNotes
modelmodelPassed through
systemconfig.systemInstructionString or text blocks
messages usercontents[] userText, image, document, and tool_result
messages assistantcontents[] modelText, tool_use, and Gemini thought signature
max_tokensconfig.maxOutputTokensMax output tokens
temperatureconfig.temperaturePassed through
top_pconfig.topPField rename
top_kconfig.topKField rename
stop_sequencesconfig.stopSequencesStop sequences
tools input_schemaconfig.tools[].functionDeclarationsUses parametersJsonSchema
tools web searchconfig.tools[].googleSearchConverted to Google Search
tool_choiceconfig.toolConfig.functionCallingConfigauto / any / none → AUTO / ANY / NONE; named tools use allowedFunctionNames
thinkingconfig.thinkingConfigdisabled → thinkingBudget: 0; enabled → budget is passed through
output_config.formatconfig.responseMimeType + config.responseJsonSchemaJSON Schema output format

Not converted: metadata.

Document block conversion:

  • source.type: "base64" → inlineData
  • source.type: "url" → fileData
  • source.type: "text" → text
  • Other sources → unsupported placeholder text

Responses Request Conversion ​

Responses → Chat Completions ​

Responses fieldChat Completions fieldNotes
modelmodelPassed through
instructionsmessages[] systemSystem instruction
inputmessagesConverted to Chat Completions messages
max_output_tokensmax_completion_tokensMax output tokens
temperaturetemperaturePassed through
top_ptop_pPassed through
tools functiontools functionTool definitions
tools web searchweb_search_optionsConverted to Chat Completions web search options
tool_choicetool_choiceSupports auto / required / none and named functions
parallel_tool_callsparallel_tool_callsPassed through
reasoning.effortreasoning_effortPassed through
text.formatresponse_formatJSON / JSON Schema output format
text.verbosityverbosityPassed as an extension field
metadatametadataPassed through
service_tierservice_tierPassed through
prompt_cache_keyprompt_cache_keyPassed through
prompt_cache_retentionprompt_cache_retentionPassed through
safety_identifiersafety_identifierPassed through
include logprobstop_logprobsSet to 20
streamstream + stream_optionsStreaming options

Not converted: previous_response_id.

Responses → Messages ​

Responses fieldMessages fieldNotes
modelmodelPassed through
instructionssystemSystem instruction
inputmessagesConverted to Anthropic messages
max_output_tokensmax_tokensDefaults to 4096 when omitted
temperaturetemperaturePassed through
top_ptop_pPassed through
tools functiontools input_schemaTool definitions
tools web searchtools web_search_20250305Converted to Anthropic web search tool
tool_choice + parallel_tool_callstool_choiceauto / required / none → auto / any / none; parallel_tool_calls: false → disable_parallel_tool_use: true
reasoning.effortthinkinglow / medium / high → 2048 / 5120 / 10240 budget tokens
text.format json_schemaoutput_config.formatJSON Schema output format
metadata.user_idmetadata.user_idPassed through
service_tierservice_tierOnly auto / standard_only are forwarded
streamstreamPassed through

Not converted: previous_response_id, prompt_cache_key, prompt_cache_retention, safety_identifier.

Responses → Gemini ​

Responses fieldGemini fieldNotes
modelmodelPassed through
instructionsconfig.systemInstructionSystem instruction
inputcontentsConverted to Gemini contents
max_output_tokensconfig.maxOutputTokensMax output tokens
temperatureconfig.temperaturePassed through
top_pconfig.topPField rename
tools functionconfig.tools[].functionDeclarationsUses parametersJsonSchema
tools web searchconfig.tools[].googleSearchConverted to Google Search
tool_choiceconfig.toolConfig.functionCallingConfigauto / required / none → AUTO / ANY / NONE; named functions use allowedFunctionNames
reasoning.effortconfig.thinkingConfiglow / medium / high → 2048 / 5120 / 10240 budget
text.formatconfig.responseMimeType + config.responseJsonSchemaJSON / JSON Schema output format
include logprobsconfig.responseLogprobs + config.logprobsLogprobs output

Not converted: metadata, previous_response_id, parallel_tool_calls, prompt_cache_key, prompt_cache_retention, safety_identifier.

Gemini Request Conversion ​

Gemini → Chat Completions ​

Gemini fieldChat Completions fieldNotes
modelmodelPassed through
config.systemInstructionmessages[] systemSystem instruction
contentsmessagesuser / model → user / assistant
config.maxOutputTokensmax_completion_tokensMax output tokens
config.temperaturetemperaturePassed through
config.topPtop_pField rename
config.stopSequencesstopStop sequences
config.seedseedPassed through
config.frequencyPenaltyfrequency_penaltyField rename
config.presencePenaltypresence_penaltyField rename
config.candidateCountnCandidate count
config.responseLogprobslogprobsWhether to return logprobs
config.logprobstop_logprobsNumber of top logprobs
config.tools[].functionDeclarationstools functionTool definitions
config.tools[].googleSearchweb_search_optionsWeb search options
config.toolConfigtool_choiceAUTO / ANY / NONE → auto / required / none; single allowedFunctionNames becomes a named function
config.responseMimeType + responseJsonSchemaresponse_formatJSON / JSON Schema output format
config.thinkingConfigreasoning_effortthinkingBudget: 0 → none; ≤2048 / ≤5120 / >5120 → low / medium / high

Not converted: config.safetySettings, config.cachedContent, config.responseModalities.

Gemini → Messages ​

Gemini fieldMessages fieldNotes
modelmodelPassed through
config.systemInstructionsystemSystem instruction
contentsmessagesuser / model → user / assistant
config.maxOutputTokensmax_tokensDefaults to 4096 when omitted
config.temperaturetemperaturePassed through
config.topPtop_pField rename
config.topKtop_kField rename
config.stopSequencesstop_sequencesStop sequences
config.tools[].functionDeclarationstools input_schemaTool definitions
config.tools[].googleSearchtools web_search_20250305Converted to Anthropic web search tool
config.toolConfigtool_choiceAUTO / ANY / NONE → auto / any / none; single allowedFunctionNames becomes a named tool
config.thinkingConfigthinkingBudget is passed through; 0 means disabled
config.responseMimeType + responseJsonSchemaoutput_configJSON Schema output format

Not converted: config.seed, config.frequencyPenalty, config.presencePenalty, config.candidateCount, config.safetySettings, config.cachedContent.

Gemini → Responses ​

Gemini fieldResponses fieldNotes
modelmodelPassed through
config.systemInstructioninstructionsSystem instruction
contentsinputConverted to Responses input items
config.maxOutputTokensmax_output_tokensMax output tokens
config.temperaturetemperaturePassed through
config.topPtop_pField rename
config.tools[].functionDeclarationstools functionTool definitions
config.tools[].googleSearchtools web_search_previewConverted to Responses web search tool
config.toolConfigtool_choiceAUTO / ANY / NONE → auto / required / none
config.thinkingConfigreasoningBudget is mapped to effort
config.responseMimeType + responseJsonSchematext.formatJSON / JSON Schema output format

Not converted: config.seed, config.frequencyPenalty, config.presencePenalty, config.candidateCount, config.safetySettings, config.cachedContent.

Response Field Conversion ​

Source responseTarget responseContent fieldTool call fieldReasoning fieldFinish reason
MessagesChat Completionscontent[] text → choices[0].message.contenttool_use → tool_callsthinking → reasoning + reasoning_detailsend_turn / tool_use / max_tokens / refusal → stop / tool_calls / length / content_filter
ResponsesChat Completionsoutput[] message output_text → choices[0].message.contentfunction_call → tool_callsreasoning → reasoning + reasoning_detailscompleted / incomplete / failed → stop / length / stop; content filter becomes content_filter
GeminiChat Completionsparts[].text → choices[0].message.contentfunctionCall → tool_callsthought → reasoning + reasoning_detailsSTOP / MAX_TOKENS / SAFETY → stop / length / content_filter
Chat CompletionsMessagesmessage.content → content[] texttool_calls → tool_usereasoning → thinkingstop / tool_calls / length / content_filter → end_turn / tool_use / max_tokens / refusal
ResponsesMessagesoutput[] message → content[] textfunction_call → tool_usereasoning → thinkingcompleted / incomplete / failed → end_turn / max_tokens / end_turn
GeminiMessagesparts[].text → content[] textfunctionCall → tool_usethought → thinkingSTOP / MAX_TOKENS / SAFETY → end_turn / max_tokens / refusal
Chat CompletionsResponsesmessage.content → output[] message output_texttool_calls → function_callreasoning → output[] reasoningstop / tool_calls / length / content_filter → completed / completed / incomplete / failed
MessagesResponsescontent[] text → output[] message output_texttool_use → function_callthinking → output[] reasoningend_turn / max_tokens / refusal → completed / incomplete / failed
GeminiResponsesparts[].text → output[] message output_textfunctionCall → function_callthought → output[] reasoningSTOP / MAX_TOKENS / SAFETY → completed / incomplete / failed
Chat CompletionsGeminimessage.content → parts[].texttool_calls → functionCallreasoning → parts[].thoughtstop / tool_calls / length / content_filter → STOP / STOP / MAX_TOKENS / SAFETY
MessagesGeminicontent[] text → parts[].texttool_use → functionCallthinking → parts[].thoughtend_turn / max_tokens / refusal → STOP / MAX_TOKENS / SAFETY
ResponsesGeminioutput[] message output_text → parts[].textfunction_call → functionCallreasoning → parts[].thoughtcompleted / incomplete / failed → STOP / MAX_TOKENS / SAFETY

Usage Field Conversion ​

Source protocolTarget protocolMain mapping
MessagesChat Completionsusage.input_tokens → prompt_tokens; usage.output_tokens → completion_tokens; cache_read_input_tokens → prompt_tokens_details.cached_tokens; server_tool_use.web_search_requests → prompt_tokens_details.web_search
ResponsesChat Completionsusage.input_tokens / output_tokens / total_tokens are mapped directly; cached tokens and reasoning tokens are mapped to OpenAI-style detail fields
GeminiChat CompletionspromptTokenCount + toolUsePromptTokenCount → prompt_tokens; candidatesTokenCount + thoughtsTokenCount → completion_tokens; cachedContentTokenCount → cached tokens; thoughtsTokenCount → reasoning tokens
Chat CompletionsMessagesprompt_tokens → input_tokens; completion_tokens → output_tokens; cached tokens and web search counts map to Anthropic usage extension fields
ResponsesMessagescached tokens → cache_read_input_tokens; web search calls are counted in server_tool_use
GeminiMessagespromptTokenCount + toolUsePromptTokenCount → input_tokens; candidatesTokenCount + thoughtsTokenCount → output_tokens; cachedContentTokenCount → cache_read_input_tokens
Chat CompletionsResponsescached tokens and reasoning tokens are mapped to Responses usage; web search calls are counted
MessagesResponsesinput_tokens / output_tokens are mapped directly; cache_read_input_tokens → cached tokens
GeminiResponsesGemini usageMetadata is mapped to Responses usage; tool-use prompt tokens and thoughts tokens are folded into the relevant counts
Chat CompletionsGeminicached tokens → cachedContentTokenCount; reasoning tokens → thoughtsTokenCount
MessagesGeminicache_read_input_tokens → cachedContentTokenCount
ResponsesGeminicached tokens → cachedContentTokenCount; reasoning tokens → thoughtsTokenCount

Streaming Conversion ​

All 12 converters support streaming. Event names differ by protocol, but these content types are preserved where possible:

Content typeConversion behavior
Text deltasPreserved as the target protocol's text delta
Tool call deltasTool name, tool call ID, and argument deltas are preserved; when the target protocol has no exact event shape, the closest target event is emitted
Reasoning / thinking deltasreasoning, thinking_delta, and Gemini thought events are converted
Web search / groundingResponses web search, Anthropic web_search_tool_result, Gemini grounding metadata, and Chat Completions annotations are mapped where possible
UsageIf upstream streaming includes a trailing usage payload, it is converted into the target protocol's usage event or final chunk fields

Common Differences And Notes ​

  • Responses has no direct request field equivalent for stop / stop_sequences; those fields are not converted when going from Chat Completions or Messages to Responses.
  • Gemini does not support parallel_tool_calls, metadata, service_tier, prompt cache keys, or several OpenAI / Anthropic extension parameters.
  • Anthropic Messages top_k is preserved only when converting to Gemini. It is not converted to Chat Completions or Responses.
  • Chat Completions seed, frequency_penalty, presence_penalty, and n mainly map to Gemini. They have no equivalent in Messages / Responses.
  • reasoning_effort and thinking are range mappings, not exact token-limit preservation. If you need precise thinking budget control, prefer the target protocol's native parameter.
  • Images and documents inside Anthropic tool_result blocks are skipped when converting to the Chat Completions tool role because the OpenAI tool role accepts text content only.
  • Protocol conversion preserves web search / grounding data where possible, but citation field names and nesting differ across protocols.