Claude Setup
Anthropic Claude Setup
Getting Your API Key
- Visit Anthropic Console
- Create an account or sign in
- Navigate to API Keys
- Click Create Key
- Copy the generated key
Free Tier
- Limited initial credits for new accounts
- No ongoing free tier
- Pay-as-you-go pricing after credits are used
Environment Variables
export ANTHROPIC_API_KEY="your-api-key-here"Add to your shell profile to persist:
echo 'export ANTHROPIC_API_KEY="your-api-key-here"' >> ~/.bashrcsource ~/.bashrcVerify Your Setup
Test your API key:
curl https://api.anthropic.com/v1/messages \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "content-type: application/json" \ -d '{"model":"claude-3-haiku-20240307","max_tokens":10,"messages":[{"role":"user","content":"Hi"}]}'A successful response returns a message from Claude. Check your key if you receive an authentication error.