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

# Thinking Mode

### DeepSeek

All DeepSeek models are reasoning models and have thinking enabled by default. Use `thinking` to enable or disable thinking and configure its intensity:

```bash Enabled theme={null}
curl https://geekai.co/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $GEEKAI_API_KEY" \
-d '{
    "model": "deepseek-flash",
    "messages": [
        {"role": "user", "content": "Hello"}
    ],
	"thinking": {
        "type": "enabled",
        "reasoning_effort": "low"
    }
}'
```

```bash Disabled theme={null}
curl https://geekai.co/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $GEEKAI_API_KEY" \
-d '{
    "model": "deepseek-flash",
    "messages": [
        {"role": "user", "content": "Hello"}
    ],
	"thinking": {
        "type": "disabled"
    }
}'
```

> [!NOTE]
>
> DeepSeek enables thinking by default. The default `reasoning_effort` is `high`; the supported effort levels are `low`, `high`, and `max`.

To display a reasoning model's reasoning text, read `reasoning_content` from the response message. It is a sibling of `content`:

```json theme={null}
{
    "id": "02174473184980118a5d045ccc6bc157c3dd771c8dafe42a7c3c9",
    "created": 1744731857,
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "\n\nHello! Nice to meet you. How can I help? Whether you have a question, need advice, or just want to chat, I'm here to help. 😊",
                "reasoning_content": "The user greeted me in Chinese. I should reply in Chinese and sound friendly and natural. Start with a greeting and an open question about how I can help. Avoid sounding formal, and check for typos. They might ask about the weather or news or want advice, but for now a short reply is best. Avoid overwhelming them, and check that the answer follows company guidelines and contains nothing sensitive before sending it.\n"
            },
            "finish_reason": "stop"
        }
    ],
    "model": "deepseek-flash",
    "object": "chat.completion",
    "usage": {
        "prompt_tokens": 6,
        "completion_tokens": 169,
        "total_tokens": 175,
        "completion_tokens_details": {
            "reasoning_tokens": 142
        }
    }
}
```

Whether you need to send `reasoning_content` back on subsequent turns, and whether it becomes part of the context, depends on whether the request includes `tools`:

* With `tools`: Send `reasoning_content` from all previous turns. It becomes part of the context.
* Without `tools`: There is no need to send `reasoning_content`. Even if you include it, the API ignores it.

> [!NOTE]
>
> Reasoning models generally do not support system prompts or parameters such as `temperature`, `presence_penalty`, and `frequency_penalty`. Omit these from your requests.

### OpenAI

OpenAI's latest 5- and 6-series models are reasoning models with thinking enabled by default. Set `thinking.reasoning_effort` to choose a reasoning effort level:

* `none`: Disables thinking, starting with GPT-5.1. GPT-6 Astra does not support this value. Use it for latency-sensitive tasks that need neither reasoning nor chained tool calls, such as speech recognition, quick lookups, and classification.
* `low`: Balances speed and cost for tool use, planning, search, and multi-step decisions. Examples include data analysis, document drafting, coding to a plan, and customer support chats.
* `medium`: Use when quality and reliability require planning, complex reasoning, or judgment. Examples include agentic coding, research, working with spreadsheets and slides, and delegating long-running tasks.
* `high`: Use for rigorous reasoning, complex debugging, detailed planning, or tasks with high quality requirements, such as agentic coding, long-term research planning, and knowledge work. Compare medium and high based on task complexity.
* `xhigh`: Use for in-depth research, asynchronous workflows, and long-running tasks such as security checks, code reviews, enterprise productivity tasks, and complex coding workflows.
* `max`: Reserve the most intensive reasoning for the most complex tasks. If you use xhigh today, evaluate whether max improves results.

The default is `medium`, except on GPT-5.1, which defaults to `none` (no reasoning).

```bash curl theme={null}
curl --location --request POST 'https://geekai.co/api/v1/chat/completions' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "gpt-6-astra",
    "messages": [
        {
            "role": "user",
            "content": "Hello"
        }
    ],
    "thinking": {
        "reasoning_effort": "high"
    },
    "stream": true
}'
```

OpenAI normally wraps reasoning text in `<think>` and `</think>` tags within the answer, making it hard to extract from a stream. GeekAI exposes reasoning text for all reasoning models in the DeepSeek-compatible `reasoning_content` field. The field is empty if there is no reasoning text.

> [!NOTE]
>
> For more on `thinking`, see the [API reference](https://docs.geekai.co/en/api/chat/completions.md).

### Claude

The latest Claude 4- and 5-series models support thinking. Claude models with this capability use hybrid reasoning. Set `thinking.type` to choose the mode:

* `enabled`: Enables reasoning on Claude 4.5 and earlier. Claude 4.6 and later return a `400` error for this value.
* `disabled`: Disables reasoning. Claude Fable models do not support this value.
* `adaptive`: Lets the model decide when and how deeply to think. Claude 4.6 and later support this value and use it by default.

When `thinking.type` is `enabled`, use `thinking.budget_tokens` to set the thinking token budget:

```bash curl theme={null}
curl --location --request POST 'https://geekai.co/api/v1/messages' \
--header 'Authorization: Bearer $GEEKAI_API_KEY"' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "claude-sonnet-5",
    "messages": [
        {
            "role": "user",
            "content": "Hello"
        }
    ],
    "thinking": {
		"type":"enabled",
        "budget_tokens": 10000
    },
	"max_tokens": 16000,
    "stream": true
}'
```

```bash python theme={null}
# Install the OpenAI SDK first: `pip3 install openai`

from openai import OpenAI

client = OpenAI(api_key="$GEEKAI_API_KEY", base_url="https://geekai.co/api/v1")

response = client.chat.completions.create(
    model="claude-sonnet-5",
    messages=[
        {"role": "user", "content": "Hello"},
    ],
    stream=False
)

print(response.choices[0].message.content)
print(response.choices[0].message.reasoning_content)
```

```bash javascript theme={null}
// Install the OpenAI SDK first: `npm install openai`

import OpenAI from "openai";

const openai = new OpenAI({
    baseURL: 'https://geekai.co/api/v1',
    apiKey: '$GEEKAI_API_KEY'
});

async function main() {
    const completion = await openai.chat.completions.create({
        messages: [{role: "user", content: "Hello"}],
        model: "claude-sonnet-5",
    });

    console.log(completion.choices[0].message.content);
    console.log(completion.choices[0].message.reasoning_content);
}

main();
```

```bash go theme={null}
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
)

func main() {
	requestBody := map[string]interface{}{
		"model": "claude-sonnet-5",
		"messages": []interface{}{
            map[string]interface{}{
                "role": "user",
                "content": "Hello",
            },
        }
	}

	jsonData, err := json.Marshal(requestBody)
	if err != nil {
		panic(err)
	}

	client := &http.Client{}
	req, err := http.NewRequest("POST", "https://geekai.co/api/v1/chat/completions", bytes.NewBuffer(jsonData))
	if err != nil {
		panic(err)
	}

	req.Header.Set("Authorization", "Bearer $GEEKAI_API_KEY")
	req.Header.Set("Content-Type", "application/json")

	resp, err := client.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		panic(err)
	}

	fmt.Println(string(body))
}
```

If you set `max_tokens`, `budget_tokens` must not exceed `max_tokens`. Claude does not support `temperature`, `top_p`, or `top_k` when reasoning is enabled.

On Claude 4.6 and later, `output_config.effort` controls effort across the whole response. In adaptive thinking mode, this includes how often and how deeply Claude thinks:

```bash curl theme={null}
curl --location --request POST 'https://geekai.co/api/v1/messages' \
--header 'Authorization: Bearer $GEEKAI_API_KEY"' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "claude-opus-5",
    "max_tokens": 4096,
    "messages": [{
      "role": "user",
      "content": "Analyze the trade-offs between microservices and a monolithic architecture."
    }],
	"thinking": {
		"type": "adaptive"
	},
    "output_config": {
      "effort": "medium"
    }
}'
```

### Gemini

Starting with Gemini 2.5, all models reason by default. For a faster reply, set `thinking.budget_tokens` to `0` to turn off thinking (except on Gemini 2.5 Pro, which cannot disable it). Set `thinking.include_thoughts` to `true` to include reasoning text; the default, `false`, hides it. Increase `thinking.budget_tokens` to allow more tokens for deeper reasoning:

```bash Enabled theme={null}
curl https://geekai.co/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $GEEKAI_API_KEY" \
-d '{
    "model": "gemini-2.5-flash",
    "messages": [
        {"role": "user", "content": "Why does 1+1 equal 2?"}
    ],
	"thinking": {
		"include_thoughts": true,
		"budget_tokens": 30000
	}
}'
```

```bash Disabled theme={null}
curl https://geekai.co/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $GEEKAI_API_KEY" \
-d '{
    "model": "gemini-2.5-flash",
    "messages": [
        {"role": "user", "content": "Why does 1+1 equal 2?"}
    ],
	"thinking": {
		"budget_tokens": 0
	}
}'
```

Starting with Gemini 3, use `thinking.thinking_level` to set reasoning effort on Gemini chat models:

* `minimal`: Equivalent to disabling thinking. This is the default on Gemini 3.5 Flash, 3.1 Flash-Lite, and Gemini 3.1 Flash Image. Gemini 3.8 Flash and Gemini 4 Argon do not support it.
* `low`: Faster reasoning for tasks that need little depth. Gemini 3.1 Flash Image does not support this level.
* `medium`: Balanced reasoning for most tasks. This is the default on Gemini 3.6 Flash, Gemini 3.8 Flash, and Gemini 4 Argon. Gemini 3.1 Flash Image does not support it.
* `high`: The highest effort. Reasoning may take longer, but goes deeper. This is the default on Gemini 3 Flash.

```bash Enabled theme={null}
curl https://geekai.co/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $GEEKAI_API_KEY" \
-d '{
    "model": "gemini-4-argon",
    "messages": [
        {"role": "user", "content": "Why does 1+1 equal 2?"}
    ],
	"thinking": {
		"thinking_level": "high"
	}
}'
```

```bash Disabled/Minimal theme={null}
curl https://geekai.co/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $GEEKAI_API_KEY" \
-d '{
    "model": "gemini-3.6-flash",
    "messages": [
        {"role": "user", "content": "Why does 1+1 equal 2?"}
    ],
	"thinking": {
		"thinking_level": "minimal"
	}
}'
```

Gemini exposes reasoning text in the DeepSeek-compatible `reasoning_content` field.

For multi-turn conversations, Gemini returns encrypted reasoning context in `encrypted_content` (Gemini's underlying `thoughtSignature`). Send it back during function calling to preserve that context.

> [!NOTE]
>
> Models whose names end in `:no-thinking` already have thinking disabled and `budget_tokens` set to 0. You can omit `thinking`.

### Grok 4

Grok 4 is xAI's vision reasoning model and accepts image inputs. Thinking is enabled by default and cannot currently be disabled. As with OpenAI, use `reasoning_effort` to control effort:

```bash curl theme={null}
curl https://geekai.co/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $GEEKAI_API_KEY" \
-d '{
    "model": "grok-4.7",
	"thinking": {
		"reasoning_effort": "high"
	},
    "messages": [
        {
			"role": "user",
			"content": [
				{
					"type": "text",
					"text": "Solve this math problem and give the steps and final answer."
				},
				{
					"type": "image_url",
					"image_url": {
						"url" : "https://static.geekai.co/storage/2025/07/11/math-question.jpeg"
					}
				}
			]
      }
    ]
}'
```

Grok 4 exposes reasoning text in the DeepSeek-compatible `reasoning_content` field.

### Qwen3

All Qwen3 models combine reasoning and non-reasoning modes. Toggle thinking with the Qwen-only `enable_thinking` parameter. As with OpenAI, `reasoning_effort` controls reasoning effort:

```bash Enabled theme={null}
curl https://geekai.co/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $GEEKAI_API_KEY" \
-d '{
    "model": "qwen3.8-max",
    "messages": [
        {"role": "user", "content": "Why does 1+1 equal 2?"}
    ],
    "stream": true,
    "enable_thinking": true,
    "thinking": {
        "reasoning_effort": "high"
    }
}'
```

```bash Disabled theme={null}
curl https://geekai.co/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $GEEKAI_API_KEY" \
-d '{
    "model": "qwen3.8-max",
    "messages": [
        {"role": "user", "content": "Why does 1+1 equal 2?"}
    ],
    "stream": true,
    "enable_thinking": false
}'
```

### GLM/MiniMax/Kimi/Seed/Hunyuan

The latest GLM, MiniMax, Kimi, Seed, and Hunyuan models reason by default. Set `thinking.type` to enable or disable thinking:

* `enabled`: Enables reasoning.
* `disabled`: Disables reasoning.

Set `thinking.reasoning_effort` to control reasoning effort. This setting takes effect only on GLM 5.2 and later with reasoning enabled. The supported values are the same as OpenAI's:

```bash Enabled theme={null}
curl https://geekai.co/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $GEEKAI_API_KEY" \
-d '{
    "model": "glm-5.3-flash",
    "thinking": {
        "type": "enabled",
        "reasoning_effort": "high"
    },
    "messages": [
        {"role": "user", "content": "Hello"}
    ]
}'
```

```bash Disabled theme={null}
curl https://geekai.co/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $GEEKAI_API_KEY" \
-d '{
    "model": "glm-5.3-flash",
    "thinking": {
        "type": "disabled"
    },
    "messages": [
        {"role": "user", "content": "Hello"}
    ]
}'
```

For Anthropic SDK-compatible GLM models, use the same thinking parameters on the Messages endpoint as you would for Claude.

### Other reasoning models

Other models with thinking support include Grok 3, Grok 4, Qwen QwQ/QvQ, ERNIE X1, and Hunyuan T1. GeekAI automatically normalizes reasoning requests and responses to the DeepSeek-compatible format.

Only reasoning models support thinking mode. The [model catalog](https://geekai.co/models) lists all 40+ reasoning models on GeekAI. Some also support web-assisted or deep reasoning, including the DeepSeek web reasoning, DeepSeek deep reasoning, and Grok deep reasoning variants:

![Reasoning models available on GeekAI](https://static.geekai.co/storage/2025/04/16/image-20250416001506829.png)

Reasoning models generally do not support system prompts or temperature settings. Omit both from API requests.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.