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. The preferred form is a plain effort string:

{
  "reasoning": "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.

Accepted values

  • reasoning: "<effort>": use a value from Tresor's public ladder: off, minimal, low, medium, high, xhigh, or max

include_reasoning is intentionally separate from requested reasoning effort:

  • reasoning: "off" 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, send reasoning as a plain string.

Default behavior

  • when you omit reasoning, Tresor uses the route's published default_effort
  • reasoning: "off" requests the canonical off mode 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.3-flash'

The tresor.reasoning block reports:

  • supported_efforts
  • default_effort

Example:

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

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 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="gpt-oss-120b",
    messages=[{"role": "user", "content": "Work through the proof carefully."}],
    extra_body={
    "reasoning": "high"
    },
)

See also