Skip to main content
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, max on GPT models becomes their highest level (xhigh or high), because Chat Completions doesn’t accept max. none on 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 custom api_base, or an openai.com host) sends reasoning_effort: "none" for none or enabled: false to 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 none or auto; those are left to the provider’s default.
  • Sampling parameters are removed when the model is reasoning. temperature, top_p, logprobs and top_logprobs are dropped for OpenAI reasoning models, and temperature/top_p/top_k for Claude 4.7 and later. Claude 4.6 and earlier get temperature: 1 and no top_p while 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 none if reasoning is off (enabled: false or none); with any other setting (a level, auto, or no reasoning field) it sends the request to /v1/responses instead (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 a reasoning.encrypted item in reasoning_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_content is the reasoning text, joined. It is left out when the reasoning has no readable text (for example a signature-only Gemini thought).
  • reasoning_details lists each reasoning block with its signature, when the provider signs it. When streaming, fragments of one block share an index, 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_content and as a reasoning.text item, followed by a reasoning.encrypted item (format: "openai-responses-v1") that carries the full reasoning for the next turn.
  • usage.completion_tokens_details.reasoning_tokens reports 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 its reasoning_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

Google

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