Overview
The Anthropic provider enables access to Claude models from Anthropic. PicoClaw uses the native Anthropic API protocol for optimal compatibility and performance.Configuration
Model List Format
Add Anthropic models to yourmodel_list configuration:
Configuration Parameters
*Required unless using OAuth authentication
Available Models
Anthropic provides several Claude model families:Claude 4 Series (Latest)
anthropic/claude-opus-4- Most capable, best for complex tasksanthropic/claude-sonnet-4.6- Balanced performance and speedanthropic/claude-haiku-4- Fast and efficient
Claude 3.5 Series
anthropic/claude-opus-3.5- Previous generation flagshipanthropic/claude-sonnet-3.5- Previous generation balanced model
Claude 3 Series
anthropic/claude-opus-3- Legacy flagship modelanthropic/claude-sonnet-3- Legacy balanced modelanthropic/claude-haiku-3- Legacy fast model
Claude models support extended context windows. Opus and Sonnet models support up to 200K tokens.
Setup Instructions
1. Get API Key
- Visit Anthropic Console
- Sign in or create an account
- Navigate to API Keys section
- Click Create Key
- Copy your API key (starts with
sk-ant-)
2. Configure PicoClaw
Edit~/.picoclaw/config.json:
3. Test Connection
Advanced Configuration
Custom API Endpoint
Use a custom Anthropic-compatible endpoint:Prompt Caching
Claude supports prompt caching to reduce costs for repeated prompts. PicoClaw automatically uses cache control for system messages:- System prompts
- Tool definitions
- Large context blocks
Extended Context
Claude models support large context windows:- Opus: 200K tokens
- Sonnet: 200K tokens
- Haiku: 200K tokens
Authentication Methods
API Key (Recommended)
Standard API key authentication:OAuth / Token (Advanced)
For OAuth-based authentication:Troubleshooting
Rate Limiting
If you encounter rate limits:- Check your plan’s rate limits in the Anthropic Console
- Implement request throttling
- Upgrade your plan for higher limits
Invalid API Key
Error:401 Authentication failed
- Verify your API key is correct
- Ensure key starts with
sk-ant- - Check key hasn’t been revoked in Console
Content Filtering
Some providers (like when using Claude through proxies) have content filtering:- Rephrase your query
- Use different wording
- Contact Anthropic support if false positives occur
Timeout Errors
Increase timeout for long-running requests:Model Selection Guide
Cost Optimization
- Choose appropriate models: Use Haiku for simple tasks, Sonnet for general use, Opus only when needed
- Enable prompt caching: Automatically enabled for system prompts (75% cost reduction)
- Set
max_tokens: Limit response length to reduce costs - Monitor usage: Check Anthropic Console regularly
- Use extended context wisely: Only include necessary context
Legacy Configuration (Deprecated)
Older configuration format (still supported):model_list format for better features like load balancing and fallbacks.