Overview
The Anthropic provider gives you access to Claude models with advanced reasoning capabilities through adaptive and manual thinking modes.Installation
createAnthropic()
Create an Anthropic provider instance.Options
Your Anthropic API key. Defaults to
ANTHROPIC_API_KEY environment variable.Custom base URL for API requests. Useful for proxies or custom endpoints.
Default maximum tokens for completions. Can be overridden per request.
Provide your own configured Anthropic client instance.
Returns
AnthropicProvider - Provider instance with methods to create models.
Provider Methods
chatModel()
Create a chat model instance.Model identifier. See Supported Models below.
Supported Models
Claude 4.6 (Adaptive Thinking)
Claude 4.6 (Adaptive Thinking)
Latest generation with adaptive thinking mode.
- claude-opus-4-6 - Most capable, supports max effort
- claude-sonnet-4-6 - Balanced performance and speed
Claude 4.5 (Manual Thinking)
Claude 4.5 (Manual Thinking)
Previous generation with manual thinking budget control.
- claude-opus-4-5 - High capability
- claude-sonnet-4-5 - Efficient reasoning
- claude-haiku-4-5 - Fast and lightweight
Claude 4 & Earlier
Claude 4 & Earlier
Earlier Claude models with manual thinking.
- claude-opus-4-1 - Enhanced reasoning
- claude-opus-4 - Strong performance
- claude-sonnet-4 - Balanced model
- claude-sonnet-3-7 - Previous generation
Capabilities
| Feature | Support |
|---|---|
| Chat Completion | ✓ |
| Streaming | ✓ |
| Function Calling | ✓ |
| Vision | ✓ |
| Reasoning Effort | ✓ |
| Embeddings | ✗ |
| Image Generation | ✗ |
Thinking Modes
Claude models use two different thinking modes:Adaptive Thinking
Used by Claude 4.6 models. The model automatically determines thinking depth based on the effort level.Only
claude-opus-4-6 supports 'max' effort level.Manual Thinking Budget
Used by Claude 4.5 and earlier. You control the thinking token budget:- minimal → 1,024 tokens
- low → 2,048 tokens
- medium → 8,192 tokens
- high → 32,768 tokens
- max → 65,536 tokens
Examples
Basic Chat
Extended Thinking
Streaming with Thinking
Function Calling
Vision
Custom Max Tokens
Error Handling
Best Practices
Choosing Thinking Mode
Choosing Thinking Mode
- Use Claude 4.6 (adaptive) for most use cases - it’s more efficient
- Use Claude 4.5 (manual) when you need precise control over thinking budget
Setting Effort Levels
Setting Effort Levels
- low - Simple questions, quick responses
- medium - Standard reasoning tasks
- high - Complex analysis, multi-step reasoning
- max - Most challenging problems (Opus 4-6 only)
Token Management
Token Management
- Set
defaultMaxTokensbased on your typical use case - Remember thinking tokens count toward your usage
- Use streaming to show progress for long responses