What is Thinking?
Thinking (also called reasoning) is an advanced capability that allows AI models to engage in extended reasoning processes before generating their final response. Models with thinking capabilities can work through complex problems step-by-step, showing their reasoning process, which leads to more accurate and well-thought-out answers.Not all models support thinking capabilities. See the Model Capabilities page to check which models have thinking support.
Using Thinking
Thinking is configured differently depending on the model provider. Pass thethinking parameter when creating an agent or override it per request.
Anthropic Models
For Anthropic models, thinking is configured with a dictionary containingtype and budget_tokens:
type: Must be"enabled"to activate thinkingbudget_tokens: The maximum number of tokens the model can use for reasoning (must be >= 1024 and < max_tokens)
Important: When using thinking with Anthropic models,
budget_tokens must be less than max_tokens because thinking tokens count toward the total token budget. The max_tokens parameter sets the total output limit, while budget_tokens allocates a portion of that budget specifically for reasoning. Make sure to set max_tokens high enough to accommodate both thinking and the final response.OpenAI Models
For OpenAI models, thinking is configured with a dictionary containingeffort and summary:
effort: Controls how much computational effort the model puts into reasoning"minimal"- Light reasoning"low"- Moderate reasoning"medium"- Substantial reasoning"high"- Maximum reasoning effort
summary: Controls how the reasoning is summarized"auto"- Automatic summary"concise"- Brief summary"detailed"- Comprehensive summary
Overriding Thinking Per Request
You can override thinking configuration for individual requests:When to Use Thinking
Thinking is particularly useful for:- Complex problem-solving - Multi-step reasoning tasks
- Mathematical problems - Calculations requiring step-by-step work
- Code analysis - Understanding and debugging complex code
- Strategic planning - Long-term thinking and planning
- Scientific reasoning - Hypothesis testing and analysis
Thinking modes consume more tokens and may increase response time, but often produce more accurate and well-reasoned responses for complex tasks.