Amux

Text protocol conversion

Last updated September 1, 2026

Compatibility and parameter differences between OpenAI Chat, Responses, Anthropic Messages, and Gemini.

Amux converts requests among four text-generation protocols. You can keep using your existing SDK while the gateway converts the request to a protocol supported by the model provider and returns the response in the protocol you called.

This page covers text protocols only. OpenAI Images and Amux Tasks are not part of this conversion layer.

Supported protocols

Short nameProtocolEndpoint
ChatOpenAI Chat CompletionsPOST /v1/chat/completions
ResponsesOpenAI ResponsesPOST /v1/responses
MessagesAnthropic MessagesPOST /v1/messages
GeminiGoogle GeminiPOST /v1beta/models/{model}:generateContent

All four protocols can be converted in either direction:

Calling protocol ↓ / upstream protocol →ChatResponsesMessagesGemini
ChatDirectConvertConvertConvert
ResponsesConvertDirectConvertConvert
MessagesConvertConvertDirectConvert
GeminiConvertConvertConvertDirect

The gateway prefers an upstream protocol matching the protocol you called and converts only when a direct route is unavailable. Direct requests do not undergo schema conversion, but model routing, required parameter filtering, and response normalization still apply.

Conversion support does not mean every model exposes every calling protocol. See the model page for its available entry points. Unsupported combinations return an error rather than silently using a different endpoint.

Request parameters

“—” means that the target protocol has no direct equivalent and cannot preserve the field during cross-protocol conversion.

ParameterChatResponsesMessagesGemini
System promptsystem messageinstructionssystemsystemInstruction
Maximum outputmax_tokensmax_output_tokensmax_tokens (required)maxOutputTokens
temperature0–20–20–10–2
top_p
top_ktop_ktopK
Stop sequencesstop (up to 4)stop_sequencesstopSequences (up to 5)
seed
presence_penalty
frequency_penalty
Tool definitionstoolstoolstoolsfunctionDeclarations
Tool choicetool_choicetool_choicetool_choicefunctionCallingConfig
Parallel tool callsparallel_tool_callsparallel_tool_callsdisable_parallel_tool_use (inverse)
JSON outputresponse_formattext.formatresponseMimeType
Reasoning effortreasoning_effortreasoning.effortthinking.budget_tokensthinkingConfig
Reasoning summaryreasoning.summaryincludeThoughts
Reasoning modereasoning.mode
Reasoning contextreasoning.context
Output verbosityverbositytext.verbosity
End-user identifieruserusermetadata.user_id
Image inputbase64 / URLbase64 / URLbase64 / URLbase64 / Files API URI
Prompt cachingAutomaticAutomaticcache_controlAutomatic

Valid reasoning values depend on the model. Amux converts these fields where the target protocol can express them, but does not prevalidate whether a model accepts a particular value. The upstream returns an error for unsupported values.

The following fields have no stable cross-protocol equivalent and are generally preserved only on direct routes: logprobs, top_logprobs, n, candidateCount, logit_bias, safety_identifier, prompt_cache_options, prompt_cache_retention, max_tool_calls, prediction, moderation, and protocol-native web search tools.

service_tier, serviceTier, and Anthropic inference_geo are filtered even on direct routes. Do not rely on them to select a billing tier or inference region. To constrain the region, select a provider channel that meets the requirement.

Parameters explicitly filtered by the platform are reported in amux.droppedParams for non-streaming responses or the x-amux-dropped-params response header for streaming responses. Fields that cannot be represented by the target protocol do not necessarily appear in that list; use the compatibility rules on this page as the reference.

Conversion differences

To Messages

  • temperature values above 1 are capped at 1
  • When reasoning is enabled, temperature, top_p, and top_k are removed
  • If max_tokens is absent, it is filled from the model limit; reasoning budgets are adjusted to a valid range
  • parallel_tool_calls is inverted into disable_parallel_tool_use
  • seed, penalty fields, JSON output, output verbosity, and Responses-only reasoning options cannot be preserved
  • Audio, video, and file content cannot be converted and cause the request to fail; images are supported

To Chat

  • Stop sequences beyond the first four are truncated
  • top_k, token-based reasoning budgets, reasoning signatures, and cache breakpoints cannot be preserved
  • text.verbosity becomes top-level verbosity
  • Responses-only reasoning summary, mode, and context cannot be preserved

To Gemini

  • Stop sequences beyond the first five are truncated
  • Media supplied as public URLs cannot be preserved; use base64 or a Gemini Files API URI
  • Parallel tool calls, end-user identifiers, and output verbosity cannot be preserved
  • Reasoning summaries retain only whether thoughts should be returned; summary detail, reasoning mode, and context cannot be preserved
  • reasoning.effort: none becomes thinkingBudget: 0

To Responses

  • Stop sequences, seed, penalty fields, and top_k cannot be preserved
  • Top-level verbosity becomes text.verbosity
  • A token-based reasoning budget cannot be converted into an effort level

Message structure

To satisfy the target protocol, cross-protocol conversion may:

  • Merge consecutive messages with the same role
  • Remove tool results with no matching call, or assistant messages containing calls with no result
  • Insert placeholders for empty content
  • Limit Anthropic cache breakpoints to four

These normalizations aim to preserve intent, but incomplete tool-call structures and similar cases can affect model behavior. Anthropic document (PDF) content blocks are not converted across protocols.

Response fields

Responses use the protocol you called, and the model field contains the Amux model ID.

ChatResponsesMessagesGemini
Contentchoices[0].message.contentoutput[]content[]candidates[0].content.parts
Assistant roleassistantassistantassistantmodel
Finish reasonfinish_reasonstatus + incomplete_detailsstop_reasonfinishReason
Tool callstool_callsoutput[].function_callcontent[].tool_useparts[].functionCall

Gemini and Responses do not have a distinct “finished because of tool calls” value. Amux maps it based on whether the response contains tool calls.

Usage fields

ChatResponsesMessagesGemini
Inputprompt_tokensinput_tokensinput_tokenspromptTokenCount
Outputcompletion_tokensoutput_tokensoutput_tokenscandidatesTokenCount
Cache readprompt_tokens_details.cached_tokensinput_tokens_details.cached_tokenscache_read_input_tokenscachedContentTokenCount
Reasoningcompletion_tokens_details.reasoning_tokensoutput_tokens_details.reasoning_tokensIncluded in outputthoughtsTokenCount

Conversion normalizes these accounting differences:

  • Chat, Responses, and Gemini input tokens include cache reads; Messages input_tokens does not
  • Gemini candidatesTokenCount excludes thought tokens; output tokens in the other three protocols include them

Streaming responses

All four protocols support streaming. During cross-protocol conversion, Amux regenerates the event sequence in the calling protocol and completes the required end markers and content-block boundaries.

Usage already incurred is still billed if the client disconnects before the stream completes.