Anthropic
Anthropic is a supported AI provider in Clanker. It uses the Anthropic Messages API directly (not through AWS Bedrock).
Provider Details
| Property | Value |
|---|---|
| Config key | anthropic |
| Default model | Auto-detected (Clanker queries the Anthropic Models endpoint and uses the latest available model) |
| API endpoint | https://api.anthropic.com/v1 |
| Auth method | API key |
Configuration
Add the following to ~/.clanker.yaml:
yaml
ai:
default_provider: anthropic
providers:
anthropic:
model: ""
api_key_env: ANTHROPIC_API_KEYIf you leave the model field empty, Clanker automatically queries the Anthropic API to discover the latest available model. You can also pin a specific model:
yaml
ai:
default_provider: anthropic
providers:
anthropic:
model: claude-sonnet-4-20250514
api_key: "sk-ant-api03-..."Environment Variable
| Variable | Description |
|---|---|
ANTHROPIC_API_KEY | Anthropic API key |
CLI Flag Overrides
| Flag | Description |
|---|---|
--ai-profile anthropic | Select this provider |
--anthropic-key <key> | Override the API key for this query |
--anthropic-model <model> | Override the model for this query |
Usage Example
bash
# Set the key via environment variable
export ANTHROPIC_API_KEY="sk-ant-api03-..."
# Query using Anthropic
clanker ask --ai-profile anthropic "Analyze IAM roles for overpermissive policies"
# Pin a specific model
clanker ask --ai-profile anthropic --anthropic-model claude-sonnet-4-20250514 "What RDS instances are running?"Model Fallback Behavior
If the configured model ID is not found by the Anthropic API (HTTP 404), Clanker automatically falls back to the latest available model by querying the /models endpoint. This ensures that Clanker continues to work even when model IDs are retired or updated.