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

# Reasoning and thinking

> Configure model reasoning through OpenAI-compatible or Anthropic-compatible Planck requests.

Planck normalizes reasoning controls across supported provider endpoints. Use the request shape that matches your SDK; Planck translates it to the selected provider's format.

| Client format        | Reasoning controls                         |
| -------------------- | ------------------------------------------ |
| OpenAI-compatible    | `reasoning_effort` and `include_reasoning` |
| Anthropic-compatible | `thinking` and `output_config.effort`      |

Reasoning support and accepted effort values are model- and provider-specific. Check the model's **Request Lab** at [inquantum.ai/models](https://inquantum.ai/models), or inspect its endpoint capabilities with [`GET /v1/models/{model_id}`](/gateway/model-capabilities).

## OpenAI-compatible requests

Replace `<provider>/<model>` with a model ID from the [Models page](https://inquantum.ai/models). The available effort values depend on the selected endpoint.

### cURL

```bash theme={null}
curl https://api.inquantum.ai/v1/chat/completions \
  -H "Authorization: Bearer $PLANCK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "<provider>/<model>",
    "max_tokens": 8192,
    "reasoning_effort": "high",
    "include_reasoning": true,
    "messages": [
      {"role": "user", "content": "Compare two approaches to this problem."}
    ]
  }'
```

### OpenAI Python SDK

```python theme={null}
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["PLANCK_API_KEY"],
    base_url="https://api.inquantum.ai/v1",
)

response = client.chat.completions.create(
    model="<provider>/<model>",
    max_tokens=8192,
    reasoning_effort="high",
    extra_body={"include_reasoning": True},
    messages=[
        {"role": "user", "content": "Compare two approaches to this problem."}
    ],
)

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

`include_reasoning` is a Planck-compatible extension, so the OpenAI Python SDK example sends it through `extra_body`.

## Anthropic-compatible requests

Use adaptive thinking and optionally set an effort. Planck translates these fields for the selected model and provider.

### Python SDK

```python theme={null}
import os
from anthropic import Anthropic

client = Anthropic(
    api_key=os.environ["PLANCK_API_KEY"],
    base_url="https://api.inquantum.ai/anthropic",
)

message = client.messages.create(
    model="<provider>/<model>",
    max_tokens=8192,
    thinking={"type": "adaptive"},
    output_config={"effort": "high"},
    messages=[
        {"role": "user", "content": "Compare two approaches to this problem."}
    ],
)

for block in message.content:
    if block.type == "thinking":
        print(block.thinking)
    elif block.type == "text":
        print(block.text)
```

The Anthropic SDK calls its credential option `api_key`, but the value above is your **Planck API key**. The SDK sends it as `x-api-key`, which Planck accepts for authentication.

### cURL

```bash theme={null}
curl https://api.inquantum.ai/anthropic/v1/messages \
  -H "x-api-key: $PLANCK_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "<provider>/<model>",
    "max_tokens": 8192,
    "thinking": {"type": "adaptive"},
    "output_config": {"effort": "high"},
    "messages": [
      {"role": "user", "content": "Compare two approaches to this problem."}
    ]
  }'
```

## Anthropic thinking mappings

| Desired behavior                  | Anthropic-compatible request fields                                                            |
| --------------------------------- | ---------------------------------------------------------------------------------------------- |
| Provider default                  | `thinking: {"type": "adaptive"}`                                                               |
| Explicit effort                   | `thinking: {"type": "adaptive"}` plus `output_config: {"effort": "low" \| "medium" \| "high"}` |
| Think without returning reasoning | `thinking: {"type": "adaptive", "display": "omitted"}`                                         |
| Disable thinking                  | `thinking: {"type": "disabled"}`                                                               |

The compatibility route does not accept manual thinking budgets such as `thinking: {"type": "enabled", "budget_tokens": 2048}`. For effort-based models, use adaptive thinking with `output_config.effort`; an unsupported value or mode returns `400`.

## `max_tokens` behavior

<Warning>
  Anthropic Messages requires `max_tokens`. The Anthropic SDK also requires it,
  and Planck does not add a default for an Anthropic-compatible request.
</Warning>

For `POST /v1/chat/completions`, `max_tokens` is optional. If you omit both `max_tokens` and `max_completion_tokens`, Planck leaves the output limit unspecified and the selected provider applies its own default. A model's advertised maximum output is a ceiling, not an automatic default.

## Bring your own Anthropic key

For normal credit usage or a provider key already stored in Planck, the single `PLANCK_API_KEY` setup above is sufficient. To send an Anthropic provider key explicitly with the SDK, keep the Planck key in `api_key` and add the provider key separately:

```python theme={null}
client = Anthropic(
    api_key=os.environ["PLANCK_API_KEY"],
    base_url="https://api.inquantum.ai/anthropic",
    default_headers={
        "X-Provider-Key": os.environ["ANTHROPIC_API_KEY"],
    },
)
```

See [Provider routing and BYOK](/gateway/provider-routing) for billing-mode selection and stored provider keys.
