# Thinking (/docs/api/thinking)

Reasoning tokens are billed as output tokens, so controlling them controls cost and latency. Use your protocol's own reasoning fields with any model: a `reasoning_effort` sent on Chat Completions takes effect on Claude and Gemini models too.

## Controls per protocol [#controls-per-protocol]

| Protocol | Fields |
|---|---|
| Chat Completions | `reasoning_effort`; `thinking: {"type": "enabled", "budget_tokens": N}`, `{"type": "adaptive"}`, or `{"type": "disabled"}`; OpenRouter's `reasoning` object and `include_reasoning` |
| Responses | `reasoning.effort` |
| Messages | `thinking`, `output_config.effort` |
| Gemini | `generationConfig.thinkingConfig`: `thinkingLevel`, `thinkingBudget`, `includeThoughts` |

On a model's [native protocol](/docs/api/protocols#native-protocol), these fields reach the model as you sent them and follow the vendor's documentation: `reasoning_effort` on GPT, `thinking` on Claude through Messages, `thinkingConfig` on Gemini through the Gemini endpoint, and vendor fields such as DeepSeek's `thinking` or Qwen's `enable_thinking` on Chat Completions.

On Chat Completions, `reasoning_effort` takes precedence over the `reasoning` object, which takes precedence over `include_reasoning`. Effort levels are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`.

## Claude [#claude]

On Chat Completions, Responses, or Gemini, Claude models take these settings:

| You send | Effect on Claude |
|---|---|
| `thinking: {"type": "enabled", "budget_tokens": N}` | Extended thinking with that budget |
| `thinking: {"type": "adaptive"}` | Claude decides when and how much to think |
| `reasoning_effort` / `reasoning.effort` | Claude's effort level; on Claude Fable 5, 5.1 and 5.2 it also turns on adaptive thinking |
| `thinking: {"type": "disabled"}` | Thinking off |

```bash
curl https://api.ohmygpt.com/v1/chat/completions \
  -H "Authorization: Bearer $OHMYGPT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-haiku-4-5",
    "max_tokens": 1500,
    "messages": [{"role": "user", "content": "What is 17 * 23? Reply with the number only."}],
    "thinking": {"type": "enabled", "budget_tokens": 1024}
  }'
```

```json
{
  "choices": [
    {
      "finish_reason": "stop",
      "native_finish_reason": "end_turn",
      "message": {
        "role": "assistant",
        "content": "391",
        "reasoning": "17 * 23 = ?\n\nLet me calculate this:\n17 * 23 = 17 * 20 + 17 * 3\n= 340 + 51\n= 391",
        "reasoning_details": [{ "type": "reasoning.text", "text": "17 * 23 = ?\n\n…", "signature": "EuoCCrgB…", "index": 0 }]
      }
    }
  ],
  "usage": { "prompt_tokens": 51, "completion_tokens": 60, "total_tokens": 111, "completion_tokens_details": { "reasoning_tokens": 54 } }
}
```

Newer Claude models think adaptively. Use the setting each model takes:

| Model | Use |
|---|---|
| Claude Opus 5.5, Opus 5, Sonnet 5.5, Sonnet 5, Haiku 5.5, Fable 5, Fable 5.1, Fable 5.2, Opus 4.8, Opus 4.7 | `{"type": "adaptive"}` with an effort level, instead of a token budget |
| Claude Opus 5.5, Fable 5, Fable 5.1, Fable 5.2 | A low effort level to keep thinking short; these models always think |
| Earlier Claude models | `{"type": "enabled", "budget_tokens": N}` |

Other settings reach the model as you sent them; if the model doesn't take one, its own error comes back to you, and a rejected request is not charged.

## Gemini [#gemini]

On Chat Completions, Responses, or Messages, Gemini models take these settings:

| You send | Effect on Gemini |
|---|---|
| `thinking: {"type": "enabled", "budget_tokens": N}` | Thinking budget of N tokens, thoughts returned |
| `reasoning_effort: "low"`, `"medium"`, `"high"` | Thinking level, thoughts returned |
| `reasoning_effort: "none"` or `thinking: {"type": "disabled"}` | The model's lowest thinking level, no thoughts returned |

Only some Gemini models can stop thinking. On `google/gemini-3.6-flash`, `google/gemini-3.5-flash`, `google/gemini-3.5-flash-lite`, `google/gemini-3.1-flash-lite`, and `google/gemini-3-flash-preview`, the lowest level usually means no thinking at all. `google/gemini-3.8-flash`, `google/gemini-3.7-flash`, `google/gemini-3.1-pro-preview`, and `google/gemini-4-argon` always think: on `google/gemini-3.8-flash`, a one-line question used 44 to 84 reasoning tokens with `none`, against 86 to 177 by default. If you need answers without reasoning tokens, pick a model from the first list.

Measured on `google/gemini-3.1-flash-lite` with the same prompt as above:

| `reasoning_effort` | `completion_tokens_details.reasoning_tokens` |
|---|---|
| `none` | absent; the model did not think |
| `low` | 118 |
| `high` | 229 |

```bash
curl https://api.ohmygpt.com/v1/chat/completions \
  -H "Authorization: Bearer $OHMYGPT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/gemini-3.1-flash-lite",
    "messages": [{"role": "user", "content": "What is 17 * 23? Reply with the number only."}],
    "reasoning_effort": "none"
  }'
```

## Other models [#other-models]

For GPT, DeepSeek, Qwen, and other models whose native protocol is Chat Completions, an effort level from any protocol becomes `reasoning_effort`. On GPT reasoning models, leave `temperature` and `top_p` at their defaults while reasoning is on.

## Reasoning in the response [#reasoning-in-the-response]

Reasoning tokens are reported in usage on every protocol:

| Protocol | Field |
|---|---|
| Chat Completions | `usage.completion_tokens_details.reasoning_tokens` |
| Responses | `usage.output_tokens_details.reasoning_tokens` |
| Gemini | `usageMetadata.thoughtsTokenCount` |
| Messages | included in `usage.output_tokens` |

The visible reasoning comes back as `reasoning` and `reasoning_details` on Chat Completions, `reasoning` output items on Responses, `thinking` blocks on Messages, and parts with `"thought": true` on Gemini.
