Skip to main content
Add reasoning_effort to your request. Arbytra translates it into each provider’s native format. Use extensions keyed by provider name to pass through provider-specific parameters like Anthropic’s metadata or Google’s safety_settings.

Prerequisites

  • An Arbytra API key
  • Python 3.10+ with the OpenAI SDK (pip install openai) or the arbytra SDK (pip install arbytra)
    • OR Node.js 18+ with the OpenAI SDK (npm install openai) or @arbytra/sdk (npm install @arbytra/sdk)
  • A model that supports reasoning (see provider support table)

Enable thinking

Pass reasoning_effort in your request to control extended reasoning:

Check provider support

Arbytra translates reasoning_effort for each provider:
Non-reasoning models (e.g. GPT-4o, GPT-4.1, Llama) reject reasoning_effort with 400 reasoning_not_supported. The one exception is GPT-5.4+ with tools: Arbytra drops reasoning_effort to prevent an upstream 400.
deepseek-chat and deepseek-reasoner are aliases of deepseek-v4-flash — they select the same model, not a thinking vs. non-thinking mode. Through Arbytra, thinking behavior follows the serving provider’s default and may differ from DeepSeek’s direct API. Set reasoning_effort to control it explicitly — use "off" for non-thinking output.

Read thinking output

Some providers surface the model’s reasoning in the reasoning_content field on the response message:
Not all reasoning models populate reasoning_content, so check before accessing. OpenAI keeps reasoning internal, and other providers vary by model. Recent Claude models stream summarized reasoning in reasoning_content: claude-fable-5 and claude-sonnet-5 by default with no reasoning parameters required; claude-opus-4-8 and claude-opus-4-7 when the request enables reasoning (for example reasoning_effort).

Preserve reasoning across turns

Some providers return reasoning context you echo back for multi-turn continuity. Anthropic and Google use structured reasoning blocks with cryptographic signatures, while DeepSeek uses a plain-text reasoning_content field. Include the relevant fields from the assistant response in your next request to preserve context.

Read structured reasoning

Each block has a type:
  • thinking: contains thinking (the reasoning text) and signature (cryptographic signature)
  • redacted: contains data (encrypted, opaque to the client)

Round-trip reasoning

To continue a multi-turn conversation with reasoning context, include the full assistant message (with reasoning) in your next request. Responses requested with reasoning: {"exclude": true} carry no reasoning blocks — continuations proceed without them:

DeepSeek reasoning content

DeepSeek models return reasoning as a plain reasoning_content string instead of structured reasoning blocks. For multi-turn conversations with DeepSeek, include reasoning_content on assistant messages you send back. To preserve it, serialize the full message object:
If you construct assistant messages manually and omit reasoning_content, Arbytra sets it to an empty string. Echo back the original value from the response.

Stream reasoning fields

When streaming with extended thinking, two additional delta fields carry reasoning block data:
  • delta.reasoning_signature: cryptographic signature for the current thinking block
  • delta.reasoning_redacted_data: encrypted data for a redacted thinking block (complete in one event)
These appear alongside delta.reasoning_content (the incremental reasoning text). Requests with reasoning: {"exclude": true} omit all three.

Exclude reasoning from responses

Set reasoning: {"exclude": true} on a Chat Completions request to omit reasoning output from the response, streaming and non-streaming. The model still reasons — exclude controls visibility only, and reasoning tokens are billed as part of output usage. Use reasoning_effort to control reasoning depth.
exclude applies to the Chat Completions surface; Anthropic-native callers control visibility with thinking.display instead. Excluded responses carry no reasoning blocks, so multi-turn continuations proceed without them. During an excluded model’s thinking phase the stream carries SSE keepalive comments instead of reasoning deltas.

Use provider passthrough

For provider-specific features beyond reasoning effort, use provider-keyed extensions. Arbytra forwards these to the provider:
Arbytra normalizes provider aliases. google, google_ai, googleai, and gemini are interchangeable.

Transform-controlled fields

If you set reasoning_effort, Arbytra controls each provider’s thinking budget. Thinking-budget parameters in extensions are overwritten. If you don’t set reasoning_effort, your passthrough values are preserved.

Passthrough fields

Fields that aren’t transform-controlled pass through to the provider unchanged. Examples:
  • Anthropic: metadata
  • OpenAI: store, metadata
  • Google Gemini: safety_settings

Handle sampling constraints

On Anthropic models, temperature, top_p, and top_k are incompatible with active thinking. If you send reasoning_effort alongside these parameters, Arbytra drops the incompatible values and returns a warning in routing_metadata.warnings:
Anthropic’s constraints when thinking is active: Values within these bounds pass through unchanged. Other providers don’t enforce these constraints.

Check effort normalization

Some models support only a subset of reasoning_effort levels. If you request a level above the model’s maximum, Arbytra normalizes it to the highest supported value and includes a warning in routing_metadata.warnings:
Models not listed above accept xhigh and max without a warning. For the full provider support table, see Check provider support.

Handle max_tokens constraints

Anthropic models that use thinking budgets require max_tokens above 1024. If you send reasoning_effort with max_tokens at or below 1024, Arbytra skips thinking and returns a warning in routing_metadata.warnings:
Claude 4.6+ models use adaptive thinking rather than thinking budgets. For the full model list, see Check provider support.

Estimate cost and latency

The reasoning_effort level (low/medium/high/xhigh/max) determines the thinking budget per provider. Exact token budgets aren’t guaranteed; reasoning_effort="off" disables thinking on supported models. See Check reasoning token availability for which providers report a breakdown.

Check reasoning token availability

The completion_tokens_details.reasoning_tokens field reports how many tokens the model spent on reasoning. Arbytra passes through what the upstream provider reports. When the provider doesn’t report a reasoning token breakdown, Arbytra doesn’t include completion_tokens_details in the response. Check for the field before accessing it:
When completion_tokens_details isn’t available, completion_tokens reflects the combined total of reasoning and content tokens. You can still use it for cost tracking.