Anthropic Provider
Anthropic's Claude models excel at code analysis with a strong focus on safety and helpful responses.
Setup
-
Get API Key: Sign up at Anthropic Console
-
Set Environment Variable:
bash export ANTHROPIC_API_KEY=sk-ant-your-api-key
-
Configure MegaLinter:
yaml LLM_ADVISOR_ENABLED: true LLM_PROVIDER: anthropic LLM_MODEL_NAME: claude-3-7-sonnet-latest LLM_MAX_TOKENS: 1000 LLM_TEMPERATURE: 0.1
Official Model List
For the most up-to-date list of Claude models and their capabilities, see the official Anthropic documentation:
Configuration Options
Basic Configuration
LLM_PROVIDER: anthropic
LLM_MODEL_NAME: claude-3-7-sonnet-latest
Advanced Configuration
# Custom API endpoint (if using proxy)
ANTHROPIC_BASE_URL: https://api.anthropic.com
# Custom API version
ANTHROPIC_API_VERSION: 2023-06-01
Troubleshooting
Common Issues
-
"Invalid API key"
- Verify API key format:
sk-ant-...
- Check account status and credits
- Ensure API access is enabled
- Verify API key format:
-
"Rate limit exceeded"
- Anthropic has generous rate limits
- Implement exponential backoff
- Contact support for higher limits
-
"Context too long"
- Claude handles very large contexts well
- Consider reducing file context if needed
- Use appropriate model for your needs