Claude API Key Setup Guide

Step-by-step guide to getting an Anthropic API key in 2026: account setup, free tier limits, rate-limit tiers, and first API call.

🔥 Launch tonight — Power Prompts PDF 50p (just 50p tonight)30 battle-tested Claude Code prompts · 8 pages · paste into CLAUDE.md · price reverts to £5

Getting started with the Claude API takes about five minutes. Here is the complete setup sequence for 2026.

Step 1 — Create an Anthropic account

Go to console.anthropic.com and sign up with an email address or Google account. No credit card is required to create an account.

Step 2 — Generate an API key

Inside the Console, navigate to Settings → API Keys → Create Key. Give the key a name (e.g. dev-local), copy it immediately — Anthropic shows it only once. Store it in a password manager or your shell's environment file:

export ANTHROPIC_API_KEY="sk-ant-api03-..."

Never hardcode the key in source files or commit it to git.

Step 3 — Add billing (required for production use)

New accounts receive a small free-tier credit (sufficient for testing). For production, go to Settings → Billing → Add payment method. Usage is billed monthly.

Step 4 — Make your first API call

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-sonnet-4-6-20250514",
    "max_tokens": 64,
    "messages": [{"role": "user", "content": "Hello"}]
  }'

A successful response returns JSON with a content array. If you see 401 authentication_error, the key was not passed correctly.

Usage tiers and rate limits

Anthropic automatically upgrades your account tier as you spend. Tier 1 (≥$0 usage) starts with conservative limits; Tier 4 unlocks the highest throughput. See the rate-limits guide for full numbers. Estimate costs before scaling with the Claude Cost Calculator.

Organisation keys vs personal keys

For team environments, create Organisation API keys under Settings → Organisation → API Keys. These are scoped to the organisation billing account, not your personal account — easier to rotate and audit.

Frequently asked questions

Is there a free trial for the Claude API?
Anthropic provides a small credit on new accounts so you can test without adding a card. The amount is shown in the Console billing section. Once exhausted, production use requires a payment method.
How do I rotate my Claude API key?
In the Anthropic Console, create a new key, update all services to use it, then delete the old key. There is no in-place rotation — always create before deleting to avoid downtime.
What happens if I accidentally expose my API key?
Delete the key immediately in console.anthropic.com, then create a new one. API keys are bearer tokens — anyone who holds one can make API calls billed to your account. Check your billing dashboard for unexpected charges.
Can I use the same API key in multiple projects?
Yes, but it is better practice to create separate keys per project so you can revoke a single key without affecting others. Each key appears as a separate row in the Console with its own last-used timestamp.

Free tools

Cost Calculator → Prompt-Pricing Recommender → Diff Summarizer → Skills Browser →

Related

Claude Opus 4.7 vs Sonnet 4.6 Pricing (2026 Comparison)How Much Does Claude Cost? (2026 API Pricing Guide)Claude Prompt Caching: 90% Cost Savings Explained (2026)Claude API Cost Calculator: Estimate Your Anthropic BillClaude vs GPT-4 Pricing: 2026 API Cost Comparison