The Anthropic provider supports all Claude models including Claude 4, Sonnet, Opus, Haiku, and extended thinking.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nullclaw/nullclaw/llms.txt
Use this file to discover all available pages before exploring further.
Configuration
Set to
"anthropic"Anthropic API key. Get yours at console.anthropic.com
Custom base URL for proxies (defaults to
https://api.anthropic.com)Model name:
claude-sonnet-4, claude-opus-4, etc.Sampling temperature (0.0-1.0). Defaults to
0.7.Maximum output tokens. Defaults to
8192.Example Configuration
OAuth Setup Tokens
Anthropic supports OAuth setup tokens (fromanthropic.com/setup):
Supported Models
- Claude 4:
claude-sonnet-4,claude-opus-4,claude-haiku-4 - Claude 3.5:
claude-3-5-sonnet-20241022,claude-3-5-haiku-20241022 - Claude 3:
claude-3-opus-20240229,claude-3-sonnet-20240229,claude-3-haiku-20240307 - Extended thinking: Models with reasoning capabilities (thinking content)
Capabilities
| Feature | Support |
|---|---|
| Streaming | Yes |
| Function Calling | Yes |
| Vision (images) | Yes |
| System Messages | Yes (top-level system field) |
| Tool Calls | Yes (native) |
Authentication
The Anthropic provider supports two authentication methods:1. Standard API Key
2. OAuth Setup Token
api_keyfield in configANTHROPIC_API_KEYenvironment variable
Message Format
Anthropic uses a different message format than OpenAI:- System messages go in top-level
systemfield (not in messages array) - Roles are
userandassistant(tool messages useuserrole) - Messages are objects with
roleandcontent
Tool Calls
Anthropic uses a nativetool_use content block format:
Vision Support
Claude supports image input viacontent_parts:
Custom Base URL
For proxies or self-hosted endpoints:anthropic-custom: prefix:
Code Example
Fromsrc/providers/anthropic.zig:
Error Handling
The provider classifies common Anthropic API errors:error.RateLimited— 429 rate limit exceedederror.InvalidApiKey— Authentication failederror.ApiError— Generic API errorerror.NoResponseContent— Empty response