# Reasoning

> Use reasoning_effort or Anthropic's thinking with reasoning models through DigitSpace, and how each maps to the other provider format.

Source: https://digitspace.ai/docs/api/reasoning · Last checked: 2026-10-31

On `/v1/chat/completions`, set `reasoning_effort`. On `/v1/messages`, set `thinking`. A request with either only goes to offers that support reasoning, and with `auto`, to a model of at least the standard level.

```python
reply = client.chat.completions.create(
    model="auto",
    reasoning_effort="medium",
    messages=[{"role": "user", "content": "How many weekdays are there in March 2027?"}],
)
print(reply.choices[0].message.content)
```

## How it maps between formats

When an OpenAI-format request goes to a Claude model, `reasoning_effort` becomes a thinking budget:

| `reasoning_effort` | Thinking budget (tokens) |
| ------------------ | ------------------------ |
| `minimal`          | 1,024                    |
| `low`              | 2,048                    |
| `medium`           | 8,192                    |
| `high`             | 24,576                   |
| `xhigh`            | 32,768                   |

The gateway also raises `max_tokens` to at least the budget plus 1,024, and leaves out `temperature` and `top_p`, which Anthropic doesn't allow with thinking. On AWS Bedrock the same mapping applies to Claude models only.

When an Anthropic-format request goes to an OpenAI-format model, `thinking` becomes `reasoning_effort`: `high` for a budget over 16,000 tokens, otherwise `medium`.

## Reading the reasoning

- On `/v1/chat/completions`, Claude's thinking comes back as `reasoning_content` on the message, or in the stream's deltas.
- On `/v1/messages`, an OpenAI-format model's reasoning comes back as a `thinking` block, except in streams, where it isn't sent.

Reasoning tokens are output tokens: they're billed at the output price.
