> For the complete documentation index, see [llms.txt](https://docs.cortecs.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cortecs.ai/usage/reasoning.md).

# Reasoning

Reasoning allows language models to perform deeper, structured thinking before producing a final answer. How this reasoning is exposed or whether it appears at all depends entirely on the model provider.

Some models reveal part of their thinking process, while others keep it hidden but still use it internally.

## **What Is Reasoning?**

Reasoning refers to the model’s deeper analytical process: evaluating options, forming intermediate steps, and then producing a final answer.

\
**Note:** Depending on the model provider, this reasoning may appear in various formats:

* mixed into the normal `content`
* in a dedicated `reasoning_content` field
* inside structured `thinking_blocks`  (only returned for Antropic models)

Other models keep their chain-of-thought hidden but still support configurable reasoning behavior.

## **Controlling Reasoning**

To provide a consistent experience across providers that support it, Cortecs accepts:

```
"reasoning_effort": "low" | "medium" | "high"
```

This parameter represents **how much reasoning effort** you want the model to use.

* If the provider supports configurable reasoning, Cortecs translates the value appropriately.
* If the provider does *not* support adjustable reasoning, the parameter is simply ignored.
* If the provider uses reasoning by default, the parameter may still help increase or reduce thinking depth.

**When to choose which level?**

* **Use low** if you want fast responses, low cost, or the task is simple.
* **Use medium** for general use: coding, explanations, multi-step tasks.
* **Use high** for reasoning-intensive tasks: debugging, strategy, multi-constraint planning, mathematical reasoning, or anything requiring precision.

## **Provider Behavior**

Different model families use different mechanisms for reasoning. Below is how Cortecs handles `reasoning_effort` for each provider.

### **Anthropic**&#x20;

Anthropic uses a **reasoning budget**, which determines how much internal thinking the model can perform.\
Cortecs automatically converts the user’s `reasoning_effort`  input into the appropriate budget value:

| Effort | Budget |
| ------ | ------ |
| low    | 1024   |
| medium | 2048   |
| high   | 4096   |

#### **Custom Budget (Anthropic)**

Users may also override the automatic mapping **by providing a custom numeric value** using the `thinking` parameter: `"thinking": {"type": "enabled", "budget_tokens": 1024}`

### **Azure OpenAI**

Azure OpenAI follows the same general behavior as OpenAI:

* Azure OpenAI does **not expose raw reasoning tokens**, so the internal chain of thought is never shown.
* For newer reasoning-capable models (such as GPT-5), you can still use `reasoning_effort` to control the depth of reasoning; older ones ignore it.

### **Google Gemini (2.5 and later)**

* Reasoning is **enabled by default**.
* Provided efforts are converted into a reasoning budget similar to [Anthropic](https://docs.cortecs.ai/features/reasoning-beta#anthropic).

#### Custom Budget (Gemini)

Users may specify a custom **numeric budget** similar to [Anthropic](https://docs.cortecs.ai/features/reasoning-beta#anthropic).

### **Mistral Models**

* **Do not** support `reasoning_effort`.
* If a Mistral model has reasoning capability, it returns it automatically.

**Reasoning** behavior varies across models, and not all reasoning steps may be visible in the response. Using `reasoning_effort` lets you request deeper or lighter reasoning when supported, while Cortecs automatically handles internal budgets where applicable. Keep in mind that some models expose reasoning explicitly, others hide it, and some include it by default.

{% hint style="info" %}
Reasoning token counts are currently included in the completion token count.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cortecs.ai/usage/reasoning.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
