Gateway APIs
Chat Completions
Generate chat-based completions using the specified model.
POST
Headers
Body
Message Object
Reasoning
One request shape controls reasoning on every provider. The gateway translates it into each provider’s own field and adjusts it to what the target model accepts, so the same request works whether the model is GPT, Claude, Gemini or an open-weight model.Request
Omitting every reasoning field leaves the model at its provider default.
How the gateway adjusts the request
- Levels are matched to the model. A level the model doesn’t accept becomes the nearest one it does. For example,
maxon GPT models becomes their highest level (xhighorhigh), because Chat Completions doesn’t acceptmax.noneon a model that can’t turn reasoning off becomes its lowest level. - Reasoning off is passed through to OpenAI as
none. A deployment that calls OpenAI’s own API (no customapi_base, or anopenai.comhost) sendsreasoning_effort: "none"fornoneorenabled: falseto every reasoning model, as OpenAI itself would receive it. Models that can’t turn reasoning off (GPT-6 Astra, GPT-6.1 Sol, GPT-5, the o-series) then return OpenAI’s 400. Non-reasoning and unrecognised models still get no reasoning field. - Models that don’t reason get no reasoning field, so the request doesn’t fail.
- Models the gateway doesn’t recognise get an explicit level, but not
noneorauto; those are left to the provider’s default. - Sampling parameters are removed when the model is reasoning.
temperature,top_p,logprobsandtop_logprobsare dropped for OpenAI reasoning models, andtemperature/top_p/top_kfor Claude 4.7 and later. Claude 4.6 and earlier gettemperature: 1and notop_pwhile thinking, which Anthropic requires. - Tool calls on GPT-5.4 and later go through OpenAI’s Responses API when they reason. Chat Completions on these
models takes tool calls only without reasoning. When a request to OpenAI’s own API includes tools, the gateway keeps
it on Chat Completions with effort
noneif reasoning is off (enabled: falseornone); with any other setting (a level,auto, or no reasoning field) it sends the request to/v1/responsesinstead (store: false), with that level or the model’s default, and returns the result as a normal Chat Completions response or stream. GPT-6 Astra and GPT-6.1 Sol can’t turn reasoning off, so their tool calls always take the Responses API. Requests without tools still use Chat Completions. The model’s reasoning comes back as areasoning.encrypteditem inreasoning_details; send it back unchanged on the next turn of the tool loop.
For an Azure OpenAI deployment whose name isn’t the model name (for example
prod-reasoner), set model_name in the
provider config so the gateway applies the right model’s rules. Without it, the deployment name is used.
Response
The assistant message carries the reasoning alongside the answer:reasoning_contentis the reasoning text, joined. It is left out when the reasoning has no readable text (for example a signature-only Gemini thought).reasoning_detailslists each reasoning block with its signature, when the provider signs it. When streaming, fragments of one block share anindex, and the signature arrives on a later fragment.- OpenAI models served through the Responses API (tool calls on GPT-6 Astra, GPT-6.1 Sol, and GPT-5.4 and later when
they reason) return OpenAI’s reasoning summary as
reasoning_contentand as areasoning.textitem, followed by areasoning.encrypteditem (format: "openai-responses-v1") that carries the full reasoning for the next turn. usage.completion_tokens_details.reasoning_tokensreports how many of the output tokens were reasoning. It is left out when the provider reports none.
Multi-turn conversations
Claude, Gemini and the OpenAI models served through the Responses API (GPT-6 Astra, GPT-6.1 Sol) need the earlier turn’s reasoning back when a conversation continues with tool calls. Send the assistant message back with itsreasoning_details unchanged. The gateway turns each item into the provider’s own block:
If only
reasoning_content is sent, it is replayed as unsigned reasoning text.
Supported Providers
OpenAI
GPT-4, GPT-3.5 Turbo, and o1 models
Anthropic
Claude 3.5 Sonnet, Claude 3 Opus, and Haiku
Azure OpenAI
Enterprise GPT-4 and GPT-3.5 deployments
Gemini Pro and Ultra models
AWS Bedrock
Claude, Llama, and Mistral on AWS
Together AI
Llama 3, Mixtral, and open-source models
Fireworks
Fast inference for Llama and Mistral models
xAI
Grok models with extended context