struct

Anthropic::ThinkingConfig

Inherits JSON::Serializable < Struct < Value < Object

Extended thinking configuration

Enable extended thinking to let Claude show its reasoning process.

# Enable with token budget
thinking: Anthropic::ThinkingConfig.enabled(budget_tokens: 1600)

# Or disable
thinking: Anthropic::ThinkingConfig.disabled

Constructors

adaptive(display : String | Nil = nil) : self

Adaptive thinking (Opus 4.6+)

Lets the model decide how much thinking to use based on the task.

Source
disabled

Disable extended thinking

Source
enabled(budget_tokens : Int32, display : String | Nil = nil) : self

Enable extended thinking with a token budget

Source
new(type : String, budget_tokens : Int32 | Nil = nil, display : String | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

budget_tokens
Source
display

Controls how thinking content appears in the response: "summarized", "omitted", or "updates". Requires the thinking-display-updates-2026-08-18 beta for "updates" (see Anthropic::THINKING_DISPLAY_UPDATES_BETA); the Messages resource methods attach it automatically when display is set.

Source
type
Source