Skip to content

Guides

Reasoning

Reasoning models think before they answer, which helps with debugging, planning and maths. Models marked Reasoning on Models ("reasoning": true in /v1/models) let you set how hard they think.

Setting the effort#

Send reasoning_effort on the OpenAI-compatible API, as with OpenAI's reasoning models. Lower effort answers sooner and uses fewer tokens; higher effort thinks longer on hard problems. The value is passed to the model as sent: low and high are the common levels. Leave it out for the model's default.

import osfrom openai import OpenAIclient = OpenAI(base_url="https://fullsendai.com/v1", api_key=os.environ["FULLSEND_API_KEY"])reply = client.chat.completions.create(    model="deepseek-v4.1-flash-1017",  # any model with "reasoning": true    reasoning_effort="high",    messages=[{"role": "user", "content": "Why does this recursive function overflow the stack? ..."}],)print(reply.choices[0].message.content)

Reading the reasoning#

Models that share their thinking return it apart from the answer: in message.reasoning_content, or streamed in delta.reasoning_content before the delta.content tokens begin. It's null for models that don't share it. Show it, log it or ignore it; don't send it back in the next request's messages.

Cost and limits#

  • Reasoning tokens are output tokens: they're in completion_tokens (broken out in completion_tokens_details.reasoning_tokens when the model reports it) and billed at the output price.
  • They also count toward max_tokens. A small limit can be used up by thinking before any answer appears (finish_reason: "length" with little or no content), so give reasoning models room.
  • A stream can sit on reasoning tokens for a while before the first answer token. That's normal.

On the Anthropic API#

The Messages API's thinking parameter sets the effort: a budget_tokens under 4,096 thinks a little, under 16,384 a fair amount, more than that hard, and "disabled" turns thinking off. Under "adaptive" thinking, output_config.effort sets it. Models that share their reasoning return it as thinking blocks.

Stuck? Email [email protected]System statusChangelog