# Reasoning

Control the thinking of reasoning models, read their reasoning and its tokens.

Reasoning models think before they answer. Models with the **Reasoning** capability in the [catalog](/models) support it.

## Control the effort

```json
{
  "model": "openai/gpt-oss-120b",
  "messages": [{ "role": "user", "content": "Is 1001 a prime number?" }],
  "reasoning": { "effort": "low" },
  "max_tokens": 4000
}
```

| Field of `reasoning` | Meaning                                                                    |
| -------------------- | -------------------------------------------------------------------------- |
| `effort`             | `minimal`, `low`, `medium` or `high`: how much the model thinks.           |
| `max_tokens`         | A token budget for thinking, for models that take one instead of `effort`. |
| `exclude`            | `true`: the model still thinks, but the reasoning is not returned.         |
| `enabled`            | `false` turns thinking off where the model allows it.                      |

`reasoning_effort` (the OpenAI field) works as a shortcut for `effort`.

In the Russia region only the effort is kept: the router sends `reasoning.effort` as `reasoning_effort` and drops the rest of `reasoning`.

## Read the reasoning

When the model returns its reasoning, it comes in `message.reasoning` (or `reasoning_content`, depending on the model); in a stream, in `delta.reasoning` or `delta.reasoning_content`.

## Tokens and cost

Reasoning tokens are output tokens: they are billed at the output price and count toward `max_tokens`. With the default limit of 4096 a model may spend it all on thinking and end with `finish_reason: "length"` and an empty answer, so set `max_tokens` generously.

`usage.completion_tokens_details.reasoning_tokens` shows how many of the output tokens were reasoning.
