> For the complete documentation index, see [/llms.txt](/llms.txt).

> Source: /docs/capabilities/generate/reasoning

# Reasoning

For `/v1/responses`, see [Using the Responses API](#using-the-responses-api). The other examples on this page use Chat Completions.

## What is reasoning?

Reasoning lets Solar spend additional reasoning tokens before producing the final answer. Those extra tokens give the model room to work through a problem in stages, which can help on tasks that require multiple dependent steps, where each step builds on the result of the previous one.

## When to use reasoning

| Use reasoning                                         | Use standard Chat                                                                   |
| ----------------------------------------------------- | ----------------------------------------------------------------------------------- |
| Multi-step logic or math problems                     | Simple question answering                                                           |
| Planning and analysis                                 | Summarization and rewriting                                                         |
| Code debugging where intermediate dependencies matter | Straightforward classification or extraction that does not need multi-step analysis |

Reasoning generally uses more output tokens and can increase latency and cost; the section below covers how to control it.

## Controlling reasoning

The `reasoning_effort` parameter controls whether the model spends a reasoning budget before answering, and roughly how much. A higher effort can use more output tokens and increase latency and cost, but it does not guarantee a better answer, so start with reasoning off or at a low effort and raise it only when the task actually needs multi-step work.

Which values turn reasoning on differs by model, and the mapping can change as models are updated. Check the response fields described below rather than assuming a fixed behavior.

| Model         | Omitted       | Turns reasoning off | Turns reasoning on                      | Visible `message.reasoning` |
| ------------- | ------------- | ------------------- | --------------------------------------- | --------------------------- |
| `solar-pro4`  | ❌ OFF         | `none`, `minimal`   | `low`, `medium`, `high`, `xhigh`, `max` | ✅ Yes                       |
| `solar-mini4` | ❌ OFF         | `none`, `minimal`   | `low`, `medium`, `high`, `xhigh`, `max` | ✅ Yes                       |
| `solar-pro3`  | ❌ OFF         | `minimal`, `low`    | `medium`, `high`                        | ✅ Yes                       |
| `solar-pro2`  | ❌ OFF         | `minimal`, `low`    | `medium`, `high`                        | ❌ No                        |
| `solar-mini`  | Standard Chat | Not supported       | Not supported                           | ❌ No                        |

> `solar-pro3`, `solar-pro2`, and `solar-mini` will be fully deprecated on **October 30, 2026 (KST)**. Requests naming them will return an error after that date. Please migrate `solar-pro3` and `solar-pro2` to [`solar-pro4`](/docs/models/solar-pro-4), and `solar-mini` to [`solar-mini4`](/docs/models/solar-mini-4), before then.

`solar-pro4` does not reason unless you turn it on: omitting `reasoning_effort` — or sending it as `null` — leaves reasoning off, and it turns on only when you set an effort between `low` and `max`. When reasoning is on, the thought process is returned in `choices[].message.reasoning`, and in `choices[].delta.reasoning` when streaming.

`solar-mini4` follows the same rules as `solar-pro4`: the same effort values turn reasoning on and off, and its thought process is returned the same way.

`solar-mini` does not support reasoning and does not accept `reasoning_effort`. Sending any value returns an HTTP 400 error, so omit the parameter entirely for that model.

### Response behavior

- Read the final answer from `message.content`, whether or not reasoning is on.
- Whether the thought process itself is returned in `message.reasoning` is model-specific — see the table above.
- The number of tokens spent on reasoning is reported in `usage.completion_tokens_details.reasoning_tokens` whenever reasoning is on.

> Reasoning tokens count toward your completion (output) tokens. If you set `max_tokens`, leave enough room for the final answer — otherwise the budget can be consumed by reasoning alone, and the response comes back with `message.content` set to `null` and a `finish_reason` of `length`.

## Make a reasoning request

Send a problem that takes more than one step with `reasoning_effort` set to `medium`, so `solar-pro4` works through it before answering.

_Request/response examples: chat-reasoning / request_

## Understand the response

This `solar-pro4` response carries the final answer in `message.content`, the visible thought process in `message.reasoning`, and the number of tokens spent on reasoning in `usage.completion_tokens_details.reasoning_tokens`.

_Example: chat-reasoning / response-200 / default_

## Stream the response

Set `stream` to `true` to receive the answer as it is produced. Reasoning and the final answer arrive in separate stream deltas: the visible thought process comes in `delta.reasoning`, and the final answer comes in `delta.content`. Handle and accumulate the two separately so your application can render the reasoning — or hide it — independently of the answer.

Only expose or log visible reasoning in a controlled debugging environment. It can contain user input or sensitive intermediate details, so do not persist it in production logs by default.

If you read the raw SSE stream instead of using an SDK, the stream ends with a `data: [DONE]` line.

_Request/response examples: chat-reasoning / request / streaming_

## Using the Responses API

The [Responses API](/api/responses) is available on Solar Pro 4 and Solar Mini 4.

Set `reasoning.effort` to enable reasoning. The token budget includes both reasoning and the answer. Read reasoning from `output` items of type `reasoning` and its token count from `usage.output_tokens_details.reasoning_tokens`.

### Python

```python
from openai import OpenAI

client = OpenAI(
    api_key="UPSTAGE_API_KEY",
    base_url="https://api.upstage.ai/v1",
)

response = client.responses.create(
    model="solar-pro4",
    input="What is 17 * 23? Answer with the number only.",
    reasoning={"effort": "medium"},
    max_output_tokens=2000,
)

for item in response.output:
    if item.type == "reasoning":
        # Reasoning can contain user input. Do not log it in production.
        print("reasoning:", item.content[0].text)
print("reasoning tokens:", response.usage.output_tokens_details.reasoning_tokens)
print("answer:", response.output_text)
```

### cURL

```bash
curl --location 'https://api.upstage.ai/v1/responses' \
  --header 'Authorization: Bearer UPSTAGE_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "solar-pro4",
    "input": "What is 17 * 23? Answer with the number only.",
    "reasoning": { "effort": "medium" },
    "max_output_tokens": 2000
  }'
```