Skip to main content
Anthropic builds the Claude model family. Claude excels at coding, multi-step reasoning, and long-context tasks — making it the most popular choice for Polpo agent workloads.

Setup

Get your API key from the Anthropic Console.
export ANTHROPIC_API_KEY=sk-ant-...

Config

{
  "providers": {
    "anthropic": "${ANTHROPIC_API_KEY}"
  }
}
Or inline:
{
  "providers": {
    "anthropic": "sk-ant-..."
  }
}

Use it

{
  "agents": [
    { "name": "coder", "model": "anthropic:claude-sonnet-4-5-20250929" }
  ]
}
You can also write claude-sonnet-4-5-20250929 without the prefix — Polpo auto-infers anthropic from the claude- prefix.

Models

ModelBest forContextReasoningVision
claude-opus-4-6Most capable — complex architecture, hard problems200KYesYes
claude-sonnet-4-6Latest balanced model — fast, strong coding200KYesYes
claude-sonnet-4-5-20250929Previous gen balanced — still excellent200KYesYes
claude-haiku-4-5-20251001Fast and cheap — boilerplate, formatting, simple refactoring200KYesYes
Also available: claude-opus-4-5, claude-opus-4-1, claude-sonnet-4-0, claude-3-7-sonnet-20250219, claude-3-5-sonnet-20241022, claude-3-5-haiku-20241022
Recommended default. Claude Sonnet 4.6 is the best starting point for most Polpo workloads. Use Opus for complex architecture tasks and Haiku for high-volume simple tasks.

Features

FeatureSupported
StreamingYes
Tool useYes
Vision (images)Yes
Extended thinking (reasoning)Yes (all current models)
Prompt cachingYes

Prompt Caching

Anthropic supports prompt caching to reduce costs on repeated prompts. Polpo uses this automatically when available. Cost savings from caching can be significant for agent workloads where the system prompt and tool definitions are sent with every request.

Pricing

ModelInput (per 1M tokens)Output (per 1M tokens)
claude-opus-4-6$15.00$75.00
claude-sonnet-4-6$3.00$15.00
claude-sonnet-4-5-20250929$3.00$15.00
claude-haiku-4-5-20251001$0.80$4.00
Cached reads are 90% cheaper than regular input tokens.

Provider Details

Provider IDanthropic
Env variableANTHROPIC_API_KEY
API typeAnthropic Messages API
Auto-infer prefixclaude-
Base URL overrideSupported (for proxies)

OAuth: Use Your Claude Subscription

If you have a Claude Pro or Max subscription, you can use it directly as an LLM provider — no separate API key or billing account needed. This is the fastest way to get started with Polpo if you already pay for Claude.

Supported Subscriptions

PlanWorksNotes
Claude MaxYesHigh rate limits, recommended
Claude ProYesStandard rate limits
Claude FreeNoInsufficient API access

Login

polpo auth login anthropic
Anthropic uses an Auth Code + PKCE flow with manual code paste (no localhost callback required):
  1. Polpo prints a URL — open it in your browser
  2. Authorize with your Anthropic account
  3. The browser shows an authorization code in code#state format
  4. Copy it and paste it back in the terminal
Logging in to Anthropic (Claude Pro/Max)...

Open this URL in your browser and paste the authorization code
https://console.anthropic.com/oauth/authorize?...

Paste the authorization code from the browser (format: code#state): abc123#xyz789

Login successful!
Profile saved as: anthropic:user@example.com
Stored in ~/.polpo/auth-profiles.json

Token Refresh

OAuth tokens expire. Polpo handles this automatically:
  • Before each API call, Polpo checks if the token is expired
  • If expired and a refresh token exists, it refreshes silently
  • If no refresh token is available, the profile is skipped and Polpo falls back to other credentials
  • Refreshed tokens are saved back to ~/.polpo/auth-profiles.json

Multiple Accounts & Profile Rotation

You can log in with multiple Anthropic accounts (e.g., personal + work). Each gets its own profile:
anthropic:user@personal.com
anthropic:user@work.com
Polpo automatically rotates between them:
  1. Oldest lastUsed first — distributes usage evenly
  2. Skips profiles in cooldown — rate-limited profiles are deprioritized
  3. Skips billing-disabled profiles — depleted accounts are avoided for longer (5h → 10h → 20h → 24h cap)

Billing Disable

If your subscription quota is exceeded, the profile enters billing disable mode — a longer backoff than regular rate-limit cooldown:
Consecutive failuresDisable period
1st5 hours
2nd10 hours
3rd20 hours
4th+24 hours (cap)
The counter resets after 24 hours without a billing failure. Other Anthropic profiles (or API keys) continue working normally.

Session Pinning

When you select a model and profile via /model, Polpo pins it to the session:
/model anthropic/claude-opus-4-6@anthropic:user@work.com
A user-pin is hard — if that profile fails, Polpo fails over to the next model in the fallback chain rather than silently rotating to a different credential. Reset with /model reset.

Resolution Order

1. polpo.json providers.anthropic.apiKey    (config wins)
2. ANTHROPIC_API_KEY environment variable   (env var)
3. Stored OAuth profiles                    (auto-refresh)
If an API key is configured, OAuth profiles are ignored for this provider.
For the full authentication system — all OAuth providers, CLI commands, profile rotation algorithm, and security details — see the Authentication guide.

Notes

  • Anthropic models have the largest output token limits when extended thinking is enabled.
  • For escalation, claude-opus-4-6 is a natural upgrade from Sonnet — configure it as escalateModel in your retry policy.
  • Claude Max gives higher rate limits than Claude Pro, making it the better choice for agent workloads with many parallel requests.