← Blog

How to Get an Anthropic Claude API Key (Step by Step)

2026-09-13 · 5 min read · SubToAPI Team

Getting an Anthropic Claude API key takes about five minutes: create an account at console.anthropic.com, add a billing method, then generate a key from the API Keys page. That key is what you put in the x-api-key header (or Authorization header, depending on the SDK) to call the Messages API from your own code.

The rest of this guide walks through each step, explains the gotchas that trip people up (billing limits, key scoping, rate limits), and covers what to do once the key actually works — including how to turn it into a stable, team-friendly HTTPS API if you're building a product on top of it.

Step 1: Create an Anthropic Console account

Go to console.anthropic.com and sign up with an email address or a Google account. This console account is separate from a consumer Claude.ai subscription — a Claude Pro subscription does not give you API access, and API access does not include the Claude.ai chat interface. They're billed and managed independently.

If your company already has an Anthropic organization, ask an admin to invite you instead of creating a new one. Multiple orgs per email address get confusing fast, especially once billing and usage limits are involved.

Step 2: Add a payment method and set usage limits

The Anthropic API is pay-as-you-go, billed per token, with no free tier for production use (new accounts sometimes get a small trial credit, but it expires). Before you can generate a working key, you need to:

  1. Open Settings → Billing in the console.
  2. Add a credit card.
  3. Optionally set a monthly spend limit so a bug or infinite loop doesn't produce a surprise bill.

Skipping this step is the most common reason a freshly generated key returns a 403 or billing error on the first request — the key exists, but the account isn't authorized to spend yet.

Step 3: Generate the API key

Once billing is set up:

  1. Go to Settings → API Keys.
  2. Click Create Key, give it a descriptive name (e.g. prod-backend, local-dev), and save it.
  3. Copy the key immediately — Anthropic shows the full value only once. If you lose it, you'll need to revoke it and create a new one.

Store it as an environment variable, never in source control:

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

Step 4: Make your first request

Test the key with a plain curl call before wiring up any SDK:

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-5-sonnet-20241022",
    "max_tokens": 256,
    "messages": [{"role": "user", "content": "Say hello in one sentence."}]
  }'

A 200 response with a JSON body containing content confirms the key works end to end. Common failure modes:

Step 5: Scope and rotate keys sensibly

Once the first call works, treat key management as an ongoing task, not a one-time setup:

Anthropic's raw API keys are account-level and don't have built-in scoping for individual applications, teams, or products — every key can do everything the account can do, up to the account's rate and spend limits.

When a raw API key isn't enough

A single Anthropic key works fine for a personal project or a single backend service. It gets harder once you have multiple apps, multiple developers, or customers who each need their own key with their own limits — the console doesn't give you per-application keys, seat-based access, or usage breakdowns by team member out of the box.

This is the gap SubToAPI fills. It sits between your existing Claude access and your applications: you connect your account once, and SubToAPI issues application-scoped keys (sub_live_...) that you distribute to individual apps or team members, each with its own usage metadata, without touching your underlying Anthropic credentials again. It supports streaming responses and tool use the same way the native API does, so switching an existing integration over is usually a header change.

const res = await fetch("https://api.subtoapi.app/v1/messages", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.SUBTOAPI_KEY}`,
    "content-type": "application/json"
  },
  body: JSON.stringify({
    model: "claude-3-5-sonnet-20241022",
    max_tokens: 256,
    messages: [{ role: "user", content: "Summarize this in one line." }]
  })
});

Plans start at €9/month for solo use, with Team (€19/seat) and Scale (€49/seat) tiers for organizations that need multiple keys and per-seat billing — see /pricing for details. There's a free trial at /signup, and the /docs/quickstart walks through connecting your account and issuing your first sub_live_ key in a few minutes. Streaming and tool-calling specifics are covered in /docs/streaming and /docs/tools, and the full request/response shape is in /docs/messages.

Questions

Does a Claude Pro subscription include API access? No. Claude Pro is for the Claude.ai chat app only. API access requires a separate Anthropic Console account with its own billing, and usage is charged per token independently of any Claude.ai subscription.

Is there a free Anthropic API key? New console accounts sometimes receive a small trial credit, but there is no ongoing free tier — production use requires an active payment method and is billed per token based on usage.

Can I give different apps or team members separate limits with one Anthropic account? Not natively — Anthropic API keys are account-level, so any key can access everything the account allows. If you need per-app or per-seat keys with individual usage tracking, a layer like SubToAPI issues scoped sub_live_ keys on top of your account.

Turn your Claude access into an HTTPS API

SubToAPI gives you application API keys, streaming, tool use and usage insights on top of your existing Claude access — set up in minutes.

Start free  Read the quickstart →