> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nano-gpt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Extended Thinking (Reasoning)

> How NanoGPT surfaces and controls reasoning output across OpenAI-compatible endpoints

## Overview

Some models generate a separate **reasoning** stream (sometimes called *thinking*) in addition to the final **answer** content.

NanoGPT exposes this in an OpenAI-compatible way for Chat Completions:

* Streaming (SSE): `choices[0].delta.reasoning` (or legacy `choices[0].delta.reasoning_content`)
* Non-streaming: `choices[0].message.reasoning` (or legacy `choices[0].message.reasoning_content`)

Not every model exposes reasoning text. If a model does not emit a reasoning stream, these fields may be absent even if the model internally "reasons".

`:thinking` is model-specific and only works when that exact ID (or a documented alias) exists.
`-thinking` is a legacy alias pattern for some model families only, not universal.
Do not assume `-thinking` works for arbitrary model IDs. Always check `GET /api/v1/models` for exact valid IDs.

## Endpoint Variants (Chat Completions)

NanoGPT provides three base paths for chat completions. All accept the same request format and model names, but differ in how reasoning content is delivered:

| Base URL                           | Behavior                                                                | Use When                                                               |
| ---------------------------------- | ----------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| `/api/v1/chat/completions`         | Reasoning and answer are separate fields (`reasoning` + `content`).     | Most OpenAI-compatible clients                                         |
| `/api/v1legacy/chat/completions`   | Same as `/api/v1/`, but uses the legacy field name `reasoning_content`. | Clients that only parse `reasoning_content`                            |
| `/api/v1thinking/chat/completions` | Reasoning and answer are merged into the normal `content` stream.       | Clients that ignore reasoning fields but should still display thoughts |

This is the same behavior documented under **Reasoning Streams** on the [Chat Completion](/api-reference/endpoint/chat-completion) page.

## Controlling Reasoning Output

### Hide Reasoning

To strip reasoning from the response (both streaming and non-streaming), send:

```json theme={null}
{
  "reasoning": { "exclude": true }
}
```

`reasoning.exclude` controls output visibility. It is not the same as disabling reasoning compute.

Or append the model suffix:

* `:reasoning-exclude`

Example:

```json theme={null}
{
  "model": "anthropic/claude-opus-4.6:reasoning-exclude",
  "messages": [{ "role": "user", "content": "What is 2+2?" }]
}
```

### Reasoning Effort

`reasoning_effort` (or `reasoning.effort`) controls reasoning depth and also acts as an explicit reasoning-mode signal.
Any value other than `none` is treated as a request to enable reasoning/thinking behavior.
Use `none` to explicitly disable reasoning behavior.

```json theme={null}
{
  "reasoning_effort": "high"
}
```

Or:

```json theme={null}
{
  "reasoning": { "effort": "high" }
}
```

Both formats are accepted. If both are present, top-level `reasoning_effort` is authoritative for Chat Completions request shaping.

Valid values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`.

### Legacy Field Name Compatibility (`reasoning_content`)

If a client expects `reasoning_content` instead of `reasoning`, you can:

1. Use `/api/v1legacy/chat/completions`, or
2. Set `reasoning.delta_field: "reasoning_content"`, or
3. Use the shorthands `reasoning_delta_field` / `reasoning_content_compat`.

## How Reasoning Appears in Responses

### Streaming (SSE)

Reasoning deltas appear before or alongside content deltas:

```text theme={null}
data: {"choices":[{"index":0,"delta":{"reasoning":"Thinking..."},"finish_reason":null}]}

data: {"choices":[{"index":0,"delta":{"content":"Here is the answer."},"finish_reason":null}]}
```

### Non-Streaming

The final message may include a separate reasoning field:

```json theme={null}
{
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "Here is the answer.",
        "reasoning": "Thinking..."
      }
    }
  ]
}
```

## Cost Notes

Reasoning tokens are billed as output tokens. If you enable higher reasoning effort (or use thinking variants), expect higher `completion_tokens` and higher cost.

## See Also

* Chat Completions: reasoning controls and endpoint variants ([Chat Completion](/api-reference/endpoint/chat-completion))
* Streaming protocol details across endpoints ([Streaming Protocol](/api-reference/miscellaneous/streaming-protocol))
