← Blog

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

2026-10-25 · 5 min read · SubToAPI Team

How to Get an Anthropic API Key

To get an Anthropic API key, create an account at console.anthropic.com, add a payment method under billing, then generate a key from the "API Keys" section of the console. The key will look like sk-ant-... and you use it in the x-api-key header when calling Claude's API directly.

That's the short answer. The rest of this guide walks through each step in detail, covers the billing requirements people trip over, shows your first working request, and explains when you might want a layer on top of the raw Anthropic key instead of using it directly in production.

Step 1: Create an Anthropic Console Account

Go to console.anthropic.com and sign up with an email address or a Google account. You'll be asked to verify your email and accept Anthropic's usage policies. If you're setting this up for a company, use a work email — it makes it easier to invite teammates to the same organization later.

Step 2: Set Up Billing

This is the step most people miss. Anthropic's API is not free — even the first request requires a funded account. In the console:

  1. Go to Settings → Billing
  2. Add a credit card
  3. Optionally set a monthly spend limit so you don't get surprised by usage

Without billing configured, API calls will fail with an authentication or permission error even if your key looks valid. Anthropic occasionally offers trial credits for new accounts, but these are not guaranteed and vary by region and signup batch — don't plan your launch around them.

Step 3: Generate Your API Key

Once billing is active:

  1. Go to Settings → API Keys
  2. Click Create Key
  3. Give it a descriptive name (e.g., prod-backend, local-dev) — this matters once you have more than one key
  4. Copy the key immediately — Anthropic shows the full value only once

The key format is sk-ant-api03-.... Store it in an environment variable, never in source code:

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

Step 4: Make Your First Request

Here's a minimal request using curl against Anthropic's Messages endpoint:

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

If this returns a JSON response with a content array, your key and billing are working correctly.

Common Setup Mistakes

Rate Limits and Account Tiers

New accounts start on a lower-tier rate limit (requests per minute and tokens per minute). Limits increase automatically as your account accumulates spend and history, or you can request a tier increase through the console if you have a specific launch date. If you're building something that needs predictable throughput from day one, factor this into your timeline — tier upgrades aren't instant.

When You Need More Than a Raw API Key

A direct Anthropic key is the right starting point for prototyping and solo projects. But once you're shipping a product, a few gaps show up:

This is the gap SubToAPI fills. It sits on top of your Claude access and gives you application-scoped keys (sub_live_...), a dashboard with usage metadata per key, streaming and tool use support, and team seats so colleagues get their own scoped access instead of one shared secret.

Getting started looks similar to the raw Anthropic flow — sign up, get a key, make a request — but the key is scoped to your application rather than your whole account:

curl https://api.subtoapi.app/v1/messages \
  -H "Authorization: Bearer $SUBTOAPI_KEY" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-3-5-sonnet-20241022",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Say hello in one sentence."}
    ]
  }'

You can see the full request/response shape in the docs, and the quickstart walks through setup end to end. There's a free trial at /signup, and plans start at Solo for €9/month, with Team and Scale tiers for growing teams — details on /pricing.

Recap

Getting a raw Anthropic API key takes four steps: create a console account, add billing, generate the key, and make a test request. That's enough to start building. As soon as you're running a real product with multiple services, customers, or teammates, scoped application keys and per-key usage tracking save you from a lot of operational pain later — whether you build that layer yourself or use something like SubToAPI on top of your existing Claude access.

Questions

Do I need a credit card to get an Anthropic API key? Yes. You can create a console account without one, but you can't make successful API calls until billing is configured with a valid payment method.

Is the Anthropic API key the same as a Claude.ai login? No. Your Claude.ai consumer subscription and your Anthropic Console API account are separate systems with separate billing. An API key only comes from the console.

Can I use one Anthropic API key for multiple apps? You can, but it's not recommended. If that key leaks or needs rotation, every app using it breaks at once. Separate keys per app or environment, or a scoped-key layer like SubToAPI, make this much easier to manage.

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 →