How to Get an Anthropic (Claude) API Key

Status: 🟩 COMPLETE 🟦 LIVING Section: how-to Tags: anthropic, claude, api-key, developer, setup, walkthrough


What you’re doing

An API key is a long secret string that lets your applications and developer tools connect to Anthropic’s Claude models directly. You need one if you want to:

  • Build apps that use Claude
  • Use developer tools (Cursor, Cline, Continue.dev) configured with Claude
  • Run scripts that generate text or process documents with Claude
  • Use Claude programmatically through the API

You do not need an API key for using Claude.ai (the chat website) or the Claude mobile app — those use your account login.

The Claude.ai consumer subscription (Claude Pro/Max) is completely separate from API billing. They don’t share usage or credit.

This guide takes about 5–10 minutes.


What you need

  • A web browser
  • An email address (you can use your existing Claude.ai account)
  • A credit card or other payment method
  • A few minutes

Step-by-step

Step 1 — Go to the Anthropic Console

Open https://console.anthropic.com in your browser.

This is the developer console — different from claude.ai (which is the chat product).

Step 2 — Sign in

Use your existing Anthropic account, or create a new one with an email address.

Step 3 — Verify your phone number (if first time)

Anthropic asks for phone verification, similar to other AI providers. Enter your Australian mobile (+61) and confirm with the SMS code.

Step 4 — Add a payment method and credits

Anthropic uses a prepaid credit model:

  1. Settings → Billing → Plans & billing
  2. Click Add credits
  3. Choose an amount (10, 100) and add a payment method
  4. Anthropic charges your card the amount; credits are deposited in your account
  5. As you use the API, credits are drawn down

You can set up auto-recharge so credits top up automatically when low.

Step 5 — Set usage limits

To prevent runaway bills:

  1. Settings → Limits
  2. Set a monthly spend limit (e.g., 50)
  3. Set email alerts at lower thresholds

Once you hit your limit, the API stops accepting requests until next month or you adjust the limit.

Step 6 — Create your API key

  1. API keys in the left sidebar
  2. Click Create key
  3. Give it a descriptive name (“MacBook dev key” or “Production website”)
  4. Optionally set Workspace if you have multiple
  5. Click Create
  6. CRITICAL: Copy the key (starts with sk-ant-) — you cannot see it again

Where to save the key:

  • âś… Password manager
  • âś… .env file (for developers)
  • ❌ Don’t commit to public Git repositories
  • ❌ Don’t share via email or chat
  • ❌ Don’t paste into screenshots

Step 7 — Test the key

The easiest test is via the Console’s built-in Workbench:

  1. Workbench (left sidebar)
  2. Type a test message
  3. Submit
  4. You should see Claude respond, with your usage billed

Or test in your development tool of choice (Cursor, Cline, etc.).


Pricing (mid-2026, USD per million tokens)

ModelInputOutputBest for
Claude Haiku$0.80$4Cheapest; basic tasks
Claude Sonnet$3$15Daily driver; best value
Claude Opus$15$75Hardest tasks; long reasoning

A typical chat turn might be 1,000 input + 500 output tokens. With Sonnet:

  • Per turn: ~$0.01
  • 100 turns/day: ~30/month

Reasonable hobbyist use rarely exceeds 50/month.


Common uses

In Cursor

Settings → Models → Anthropic API key → paste your sk-ant-... key.

In Cline

Cline icon → API Provider: Anthropic → paste your key.

In Claude Code (CLI)

Claude Code uses your Claude Pro/Max subscription by default (not the API). If you want to use API billing instead:

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

Then run claude with API as the backend.

In Python

import anthropic
client = anthropic.Anthropic(api_key="sk-ant-...")
message = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello, Claude"}]
)
print(message.content)

(Use environment variables for the key, not hardcoded as shown.)


Australian-specific notes

  • Currency: All pricing in USD. Australian credit cards work; charged in USD with your card’s currency conversion fees.
  • GST: Anthropic charges 10% GST on Australian customers; ensure your business details are entered for proper invoicing.
  • ABN: Add your ABN in Settings → Billing → Business details for proper tax invoice handling.
  • Pricing fluctuation: AUD-equivalent prices fluctuate with USD/AUD exchange rate.

Privacy and data handling

Anthropic API has stronger commitments than ChatGPT consumer:

  • No training on API content by default — your API queries and outputs are not used to improve Claude
  • 30-day retention for abuse monitoring; then deleted
  • Zero Data Retention available for enterprise customers
  • SOC 2 Type II certified
  • DPA available for Australian businesses requiring Privacy Act compliance

For sensitive data:

  • API content is more protected than consumer Claude.ai (where free users may have data used for training depending on settings)
  • For health, legal, financial data: still review enterprise options and DPA terms
  • See australian-privacy-considerations

Anthropic API vs Claude Pro subscription

These are commonly confused:

FeatureClaude Pro ($20/month)API
Web app (claude.ai)✅ Included❌ No web access
Mobile app✅ Included❌ Not directly
Claude Code CLIâś… Includedâś… Works with API key
Cursor/Cline/dev toolsLimitedâś… Full API access
PricingFlat $20/monthPay-per-token
Best forPersonal chat useDeveloper/programmatic use
Power usersUp to a heavy limitNo hard limit

You can have both — Pro for chat use, API for development. They’re separately billed.


Rate limits and tiers

Anthropic uses a tier system based on usage:

  • Tier 1: Default for new accounts; low rate limits
  • Tier 2/3/4: Higher tiers unlock with usage and time
  • Custom: Available for enterprise

If you’re hitting rate limits, you’ll see HTTP 429 errors. Solutions:

  • Wait and retry
  • Slow down request rate
  • Continue using to qualify for next tier
  • Contact Anthropic for limit increases (for production apps)

Common gotchas

  • Insufficient credits — top up at Billing.
  • Wrong model name — Anthropic’s model names change. Check current available models in the Console.
  • Rate limit (429) — slow down or wait.
  • Forgot to set ABN — your invoice won’t have the GST treatment you need for business.
  • Mixed up with Claude Pro — these are separate billing. Pro doesn’t give you API credits.
  • Key visibility — once you create a key, you can’t see it again. Save it immediately.

Rotating and revoking keys

  1. API keys → find your key
  2. Click the trash icon to delete
  3. Create a replacement
  4. Update wherever you use it

Revoke immediately if a key is compromised (committed to Git, shared accidentally, etc.).


See also


Sources

  • Anthropic Console: console.anthropic.com
  • Anthropic API documentation: docs.anthropic.com
  • Anthropic Privacy and Trust pages
  • Tested signup flow (June 2026)