Reasoning Controls

Use one Tresor API knob for reasoning across providers, and discover route-level limits through /v1/models.

Centralized reasoning

Tresor standardizes reasoning behind a single request field:

{
  "reasoning": {
    "enabled": true,
    "effort": "high"
  }
}

Use this with any chat route. Tresor translates it to the provider-native contract for the route that actually serves the request.

If you want the model to keep reasoning internally but do not want the reasoning text returned, add the separate top-level flag "include_reasoning": false to the chat completion request.

Fields

  • reasoning.effort: the canonical control. Use an effort value from Tresor's public ladder: off, minimal, low, medium, high, xhigh, or max
  • reasoning.enabled: optional shorthand for clients that only need on/off behavior. true means "pick a reasonable positive effort" and false means "request off"

include_reasoning is intentionally separate from reasoning.enabled:

  • reasoning.enabled=false asks the provider route to disable reasoning generation when that route supports it
  • include_reasoning=false leaves reasoning generation/routing unchanged and only suppresses returned reasoning text

Supported effort values are still route-dependent. Tresor accepts none as a compatibility alias for off, but published route metadata uses the canonical off spelling.

If you already know which reasoning level you want, prefer reasoning.effort over reasoning.enabled.

Default behavior

  • when you omit reasoning, Tresor uses the route's published default_effort
  • reasoning.enabled=false resolves to off when the route advertises off in supported_efforts
  • if the first candidate route cannot satisfy the requested reasoning setting, Tresor can still try another compatible route for the same logical model

Discover route support

Use GET /v1/models?detail=true to inspect the reasoning contract for each route.

curl 'https://api.tresor.co/v1/models?detail=true&model_key=glm-5.2'

The tresor.reasoning block reports:

  • supported_efforts
  • default_effort

Example:

{
  "id": "global/nearai/glm-5.2",
  "tresor": {
    "model_key": "glm-5.2",
    "provider": "nearai",
    "region": "global",
    "type": "chat",
    "reasoning": {
      "supported_efforts": ["off", "low", "medium", "high"],
      "default_effort": "off"
    }
  }
}

supported_efforts is the exact verified ladder for that concrete route. Use it as the source of truth for which effort values are valid there.

Returned reasoning fields

Tresor now returns reasoning text on the preferred reasoning fields:

  • non-streaming: choices[].message.reasoning
  • streaming: choices[].delta.reasoning

reasoning_content remains as a compatibility alias until 2026-09-01 and will be removed after that date.

Failover behavior

Reasoning support is checked per route, not per logical model.

  • if the first candidate route cannot satisfy the requested reasoning configuration, Tresor can still use another route for the same logical model when that route advertises compatible reasoning metadata
  • if no candidate route can satisfy the request, the API returns 400 invalid_request_error

This is especially relevant for multi-provider logical models where one route supports discrete effort levels and another only supports a boolean thinking toggle. This is especially relevant for multi-provider logical models where one route may verify off|low|medium|high and another only low|medium|high.

Example

from openai import OpenAI

client = OpenAI(base_url="https://api.tresor.co/v1", api_key="tr-...")

resp = client.chat.completions.create(
    model="auto/auto/gpt-oss-120b",
    messages=[{"role": "user", "content": "Work through the proof carefully."}],
    extra_body={
        "reasoning": {
            "enabled": True,
            "effort": "high",
        }
    },
)

See also