Help Center/API Keys & Configuration/Where to Get Anthropic API Keys
Back to Help Center
API Keys & Configuration

Where to Get Anthropic API Keys

Step-by-step guide to creating and managing Anthropic API keys for Claude

Overview

To use Claude models (Claude 4.6 Opus, Claude 4.5 Sonnet, etc.) with AgentClaw, you need an API key from Anthropic.

Step 1: Create Anthropic Account

  1. Go to console.anthropic.com
  2. Click "Sign Up"
  3. Enter your email and create password
  4. Verify your email address
  5. Complete organization setup

Step 2: Add Credits

Anthropic uses a prepaid credit system:

  1. In the console, go to "Billing"
  2. Click "Add Credits"
  3. Enter amount ($10 minimum recommended)
  4. Add payment method
  5. Complete purchase

Note: Credits don't expire. Enable auto-reload to avoid interruptions.

Step 3: Create API Key

  1. Navigate to "API Keys" in the console
  2. Click "Create Key"
  3. Give your key a name (e.g., "AgentClaw Bot")
  4. Click "Create Key"
  5. Important: Copy the key immediately - you won't see it again!

Step 4: Add Key to AgentClaw

  1. Go to your AgentClaw instance configuration
  2. Add environment variable:
    • Name: ANTHROPIC_API_KEY
    • Value: Paste your key (starts with sk-ant-)
  3. Optionally set model:
    AI_MODEL=claude-4.5-sonnet
  4. Save and restart instance

Available Claude Models

  • claude-4.6-opus: Most capable, best for complex reasoning (~$0.015/$0.075 per 1K tokens)
  • claude-4.5-sonnet: Balanced performance and cost (~$0.003/$0.015 per 1K tokens)
  • claude-4.5-haiku: Fast and cost-effective (~$0.00025/$0.00125 per 1K tokens)

Check anthropic.com/pricing for current rates.

Managing Credits and Usage

Monitoring Usage

  1. Go to "Usage" in Anthropic Console
  2. View credit balance and daily usage
  3. See breakdown by model
  4. Export usage reports

Auto-Reload

Prevent service interruptions:

  1. Go to "Billing"
  2. Enable "Auto-reload"
  3. Set threshold (e.g., reload when balance < $10)
  4. Set reload amount

Budget Alerts

  1. Set up email notifications for low balance
  2. Monitor daily to avoid surprises

Best Practices

  • Start small: Begin with $10-20 to test
  • Enable auto-reload: Prevents service interruption
  • Use different keys for different projects: Easier tracking
  • Never commit keys to code: Keep them secure
  • Rotate keys periodically: Every few months for security
  • Monitor daily: Check usage regularly

Revoking Keys

If a key is compromised:

  1. Go to "API Keys" in console
  2. Find the compromised key
  3. Click "Delete"
  4. Create a new key
  5. Update AgentClaw configuration
  6. Restart instance

Troubleshooting

"Invalid API key" Error

  • Verify key starts with sk-ant-
  • Check for extra spaces
  • Ensure key hasn't been deleted in console

"Insufficient credits" Error

  • Check balance in Anthropic Console
  • Add more credits
  • Enable auto-reload

Rate Limiting

  • Anthropic has tier-based rate limits
  • Higher usage = higher tier automatically
  • OpenClaw handles retries automatically

Free Credits

New Anthropic accounts may receive promotional credits. Check your billing page for available credits.

Next Steps

Still need help?

Our support team is ready to assist you with any questions.

Contact Support