Anthropic API (direct)
The simplest way to use Claude — direct API key from console.anthropic.com. Use this when you don't have AWS Bedrock available and want to call Claude directly.
For enterprise / regulated workloads, prefer Bedrock (data stays in your AWS account) or Vertex AI Anthropic if you're already on GCP.
Configuration
~/.insightworker/.env:
LLM_PROVIDER=anthropic
ANTHROPIC_API_KEY=sk-ant-...
AGENT_MODEL=claude-sonnet-4-5
Get an API key
- Visit console.anthropic.com/settings/keys
- Sign in / create an account
- Create Key — name it
insightworker - Copy the key (starts with
sk-ant-)
Recommended models
| Use case | Model |
|---|---|
| General apps, tool use | claude-sonnet-4-5 |
| Heavy reasoning, complex translations | claude-sonnet-4-5 (1M context variant) |
| Cheap classification | claude-haiku-4-5 |
Where data goes
Anthropic's standard API: prompts go to Anthropic's cloud, no training on customer data by default for API customers, retention policy at anthropic.com/legal/aup.
If your security review requires prompts stay in a specific cloud tenant, use Bedrock (AWS) or Vertex AI (GCP) — same models, your tenant.
Context windows
| Model | Context |
|---|---|
| Sonnet 4.5 / 4.6 | 200k |
| Opus 4.1 | 200k |
| Opus 4.7 (1M variant) | 1M |
| Haiku 4.5 | 200k |
Common gotchas
| Symptom | Cause | Fix |
|---|---|---|
| 401 Unauthorized | Bad key | Regenerate at console.anthropic.com |
| 429 rate-limited | Hit your usage tier ceiling | Wait, or upgrade tier in the Anthropic console |
| 400 input too long | Hit the context window | Use a longer-context model or trim history |
See also
- bedrock.md — Anthropic models hosted in AWS
- overview.md — full provider matrix
Source: docs/providers/anthropic-direct.md in the public repo. Open a PR with corrections.
