Skip to main content

model_supports_adaptive_thinking

Function model_supports_adaptive_thinking 

Source
pub fn model_supports_adaptive_thinking(model: &str) -> bool
Expand description

Returns true for models that support (and require) adaptive thinking: thinking: {type: "adaptive"} with NO budget_tokens field.

Per Anthropic’s docs as of 2026-04: Opus 4.6+/Sonnet 4.6+ deprecated the fixed-budget {type: "enabled", budget_tokens: N} shape. On those models the deprecated shape is silently accepted but returns no thinking content (observed S172 on Opus 4.7). Older models (Opus 4.5, Sonnet 4.5, Haiku, Opus 3.x) still use the enabled+budget shape.

Adaptive thinking also auto-enables interleaved thinking — no beta header required.