Independent guide, reviewed Dec 3, 2026

Anthropic API keys, from first call to production.

What a key is, how to get one, and how to keep it out of trouble.

A plain-English handbook for developers. Create your first key, store and rotate it safely, read your bill, work within your limits, and find the official Anthropic programs that help you build.

16 min read7 sectionsNothing for sale

first-request.shcURL
$ export ANTHROPIC_API_KEY="sk-ant-…"

$ curl https://api.anthropic.com/v1/messages \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2026-10-21" \
    -H "content-type: application/json" \
    -d '{
      "model": "claude-opus-5-5",
      "max_tokens": 1000,
      "messages": [
        {
          "role": "user",
          "content": "Hello, Claude"
        }
      ]
    }'
Your first request, as it appears in Anthropic’s quickstart.

$5

Minimum credit purchase. There is no free tier, and new accounts include no free credits.

4

Standard usage tiers: Start, Build, Scale, and Custom, each with its own limits.

1 yr

Life of purchased credits, counted from the purchase date.

01 — The basics

What an API key is, and why you need one

A long random string that stands in for you.

An API key is a credential: a long, random string that stands in for you when your code talks to a service. Instead of a username and a password, your program sends the key with every request, and the service uses it to decide who is calling, what they may do, and which account to charge. With Anthropic, the string begins with sk-ant-, and the service on the other end is the Claude API, the platform that lets your software call Claude models.

Anthropic issues two kinds of key, each named for its job. A Developer API key calls Claude. An Admin API key manages your organization instead: its members, workspaces, usage reports, and its developer keys. An admin key cannot call Claude at all, so for building you always want a Developer API key.

Every Developer API key is created in the Anthropic Console, the web dashboard at platform.claude.com, which Anthropic’s current documentation calls the Claude Console. It is also where a key is named, scoped to a workspace, given an expiration date, and switched off when its work is done. You will meet it in every section that follows, because for an API key it is the center of gravity.

It identifies you
Each request is attributed to your organization and, for personal and service account keys, to one identity with its own roles.
It carries permissions
A key works only in the workspace it was scoped to, and stops working when its owner leaves or its expiration passes.
It routes billing
Usage is charged against your prepaid credits and appears, broken down by key, on the Console’s Usage and Cost pages.

Anthropic and the Claude API: a short history

Anthropic was founded in San Francisco in 2021 by a group of former OpenAI researchers, among them Dario Amodei, who leads the company as chief executive. It is organized as a public benefit corporation, a legal structure that writes its mission, the responsible development of artificial intelligence for humanity’s benefit, into its charter. Claude, its AI assistant, was introduced on March 14, 2023, with access offered through both a chat interface and an API in the developer console.

The API has grown steadily since. Claude 2 brought 100,000-token prompts in July 2023. The Claude 3 family of Haiku, Sonnet, and Opus arrived in March 2024, and that October computer use let Claude control a computer through the API. Claude 3.7 Sonnet, released in February 2025, was described by Anthropic as the first hybrid reasoning model generally available on the market, and the Claude 4 generation followed in May with models able to use tools in parallel. In 2026 the range widened again, adding a one-million-token context window, the Fable and Mythos model lines, and the current Opus 5.5, Sonnet 5.5, and Haiku 5.5. Alongside the first-party API, Claude is also offered through Amazon Bedrock, Google Cloud’s Vertex AI, and Microsoft Foundry.

02 — Getting started

How to get your first key

Four steps, about ten minutes, five dollars.

There is no free tier: new accounts do not include free credits, and the smallest purchase is $5. You pay by card, the credits join your prepaid balance, and usage is deducted from it as you go.

  1. Create an account

    Sign in at platform.claude.com or create an account. New organizations may begin in an Evaluation tier with lower limits while Anthropic establishes an account history. Those limits rise automatically as you use the API.

  2. Add credits

    Open Billing in the Anthropic Console and buy at least $5 of credits with a card. If you switch on auto-reload, more is bought whenever your balance falls below a threshold you choose. Subscribers to the Claude Max, Ultra, and Team plans can instead claim the monthly API credits those plans include.

  3. Create the key

    On the API keys page, click Create key, give it a name you will recognize later, and choose its settings: how long it lasts, which account it is linked to, and which workspace it works in. The Console shows the full key exactly once, so copy it into a password manager or secrets manager before you close the dialog.

  4. Make a request

    Store the key in the ANTHROPIC_API_KEY environment variable, which every official SDK and the ant command-line tool read automatically. Then send a message to the Messages API.

first-request.shcURL
$ export ANTHROPIC_API_KEY="sk-ant-…"

$ curl https://api.anthropic.com/v1/messages \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2026-10-21" \
    -H "content-type: application/json" \
    -d '{
      "model": "claude-opus-5-5",
      "max_tokens": 1000,
      "messages": [
        {
          "role": "user",
          "content": "Hello, Claude"
        }
      ]
    }'
first-request.pyPython
# pip install anthropic
import anthropic  # reads ANTHROPIC_API_KEY

client = anthropic.Anthropic()

message = client.messages.create(
    model="claude-opus-5-5",
    max_tokens=1000,
    messages=[{
        "role": "user",
        "content": "Hello, Claude",
    }],
)
print(message.content[0].text)

03 — Working with API keys

Store it well. Scope it narrowly. Rotate it often.

A leaked key is a leak of your budget.

Anyone holding your key can spend your credits until it is switched off. The safe path also happens to be the short one: every control it needs sits on the API keys page of the Anthropic Console.

Keep it in the environment

A key hard-coded into source ends up in version history, logs, and screenshots. Load it at runtime from the ANTHROPIC_API_KEY environment variable, which every official SDK reads by default, and add your local .env file to .gitignore.

Never ship it to a client

Anything sent to a browser or bundled into a mobile app can be read. Call the Claude API from your own back end, never from code running in your users’ browsers, and keep keys out of prompts. Anthropic scans public GitHub repositories and automatically deactivates keys it finds there.

Rotate on a schedule

Set an expiration when you create a key; presets run from 3 hours to 30 days. To rotate, create a replacement, deploy it, then retire the old key. In the Anthropic Console, Disable can be undone and Delete cannot.

Grant the least privilege

Use one key per environment and per service. Give shared or unattended workloads a service account key, which outlives any single employee, and scope each key to one workspace so a leak cannot reach the rest of the organization.

.env · .gitignoreShell
# .env — local only, never committed
export ANTHROPIC_API_KEY="sk-ant-…"

# .gitignore
.env
.env.*
app.pyPython
import os
import anthropic  # the SDK reads ANTHROPIC_API_KEY, so no secret lives in this file

if not os.environ.get("ANTHROPIC_API_KEY"):
    raise SystemExit("Set ANTHROPIC_API_KEY before starting the app.")

client = anthropic.Anthropic()

Personal keys scoped to a single workspace can be created by workspace developers and admins. Service account keys require an organization admin, who can also switch off key creation for everyone on the Security page of the Anthropic Console.

A code editor showing a terminal and source files
Keep keys out of source control

04 — Integration

Billing, rate limits, and usage tiers

What you pay for, and how much you can send.

The Claude API bills by the token, the small chunk of text that models read and write. You pay for input tokens (your prompt), output tokens (the reply), and a few feature-specific extras: web search, for example, is charged at $10 per 1,000 searches on top of token costs. Prices are quoted per million tokens and differ by model.

Standard prices for current Claude models
ModelInputOutputCache readIntended for
Claude Fable 5.2$8$40$0.20Demanding reasoning and long-horizon agentic work
Claude Opus 5.5$4$20$0.20Long-running agentic coding and knowledge work
Claude Sonnet 5.5$2$10$0.10The best combination of speed and intelligence
Claude Haiku 5.5$0.10$0.50$0.01High-volume, latency-sensitive tasks such as classification

Standard prices in US dollars per million tokens, as published on Anthropic’s pricing page in December 2026. Writing to the prompt cache costs 1.25 times the input price for a five-minute cache, and Haiku 5.5 is priced higher for prompts over 100,000 tokens.

Three levers bring a bill down quickly. Prompt caching stores the reusable parts of a prompt, such as a system prompt or a long document, so later requests read them at a tenth of the input price or less. The Batch API runs non-urgent requests asynchronously at a 50% discount. Model choice matters most of all: moving a simple classification task from Opus 5.5 to Haiku 5.5 cuts its input cost from $4 to $0.10 per million tokens.

Prepaid credits, explained

The Claude API has no free tier or self-serve trial. Standard accounts are prepaid: you buy credits by card in the Anthropic Console, starting at $5, and usage is deducted from that balance. When it reaches zero, requests stop until you add more, and auto-reload can do that for you. Purchased credits are valid for one year and are non-refundable, and a receipt is emailed for every purchase. Organizations on custom terms can arrange monthly invoicing instead.

Rate limits and usage tiers

Two kinds of limits apply to every organization. Spend limits cap how much you may spend in a calendar month. Rate limits cap how much you may send per minute, measured in requests (RPM), input tokens (ITPM), and output tokens (OTPM) for each model class. Both follow your usage tier, and Anthropic moves organizations to higher tiers automatically as they build a history of paid usage and good standing.

Usage tiers and their monthly spend caps
TierMonthly spend capTypical fit
EvaluationLower than StartBrand-new organizations, while account history is established
Start$500First projects and prototypes
Build$1,000Applications with steady traffic
Scale$200,000Production workloads at volume
CustomNoneLimits negotiated with an account team

Spend caps are the most an organization on each tier can spend per calendar month. “Typical fit” is our summary, not Anthropic’s wording. You can set a lower limit of your own under Spend limits in the Console.

To see where you stand, open the Rate limits page in the Console. It shows your current tier and every ceiling that applies to you, and the Usage page next to it charts your requests, tokens, cache rate, and remaining headroom.

Three details are worth knowing. Input tokens read from the prompt cache do not count toward your input-tokens-per-minute limit, so good caching raises effective throughput for free. A 429 with a retry-after header is an ordinary rate limit, but a 429 without one, carrying the code enforced_spend_limit_reached, means the monthly cap has been reached. And ramp limits can return 429s during sudden spikes in traffic, so increase volume gradually. Once you are using at least half of your current limits, Request tier increase on the same page is the route to more.

handle-429.pyPython
import time
import anthropic

client = anthropic.Anthropic(max_retries=0)  # retry by hand so each wait is deliberate


def ask(prompt: str, attempts: int = 5) -> str:
    for _ in range(attempts):
        try:
            message = client.messages.create(
                model="claude-sonnet-5-5",
                max_tokens=1024,
                messages=[{"role": "user", "content": prompt}],
            )
            return message.content[0].text
        except anthropic.RateLimitError as error:
            retry_after = error.response.headers.get("retry-after")
            if retry_after is None:
                # No header means the monthly spend cap: retrying will not help.
                raise RuntimeError("Monthly spend limit reached") from error
            time.sleep(float(retry_after))
    raise RuntimeError("Still rate-limited after several attempts")

Claude API pricing in depth Rate limits and usage tiers in depth

05 — Developer programs

Anthropic developer programs

Credits, access, and support for founders, researchers, and students.

Anthropic runs several official programs that give small teams something money cannot easily buy at the start: free API credits, higher limits, and direct access to its own teams. Nothing can be applied for from this website. Each card explains what a program offers and links to its official page, where current terms and application windows are published.

Claude Startups

For early-stage founders building on Claude. Selected companies may receive API credits, priority rate limits, and access to Anthropic resources.

  • Up to $100,000 in additional credits for founders backed by a venture firm in Anthropic’s partner network
  • Credits apply to the first-party Claude API only

claude.com/programs/startups

AI for Science

API credits for researchers at universities and nonprofits working on high-impact scientific projects, with a focus on biology and the life sciences.

  • Up to $50,000 in credits per project after the 2026 expansion
  • Applications are reviewed on the first Monday of each month

anthropic.com/news/expanding-support-for-scientists

Research access and plans

The External Researcher Access Program provides $1,000 in API credits for work on AI safety and alignment.

  • A discounted Claude Team plan for research groups, with promotional pricing for 12 months
  • Claude Campus supports student builders with clubs, workshops, and stipends

support.claude.com: researcher access

Usage tiers and support

Organizations advance through the Start, Build, and Scale tiers as they grow. Beyond Scale, the Custom tier brings negotiated limits and terms.

  • Custom rate limits, monthly invoicing, volume discounts, and hands-on support
  • Self-serve help is available in writing through the Help Center

platform.claude.com/docs: rate limits

Docs, Cookbooks, and Academy

Official documentation covers everything from the first API call to production, and is free to everyone.

  • The Claude Cookbooks repository offers copyable code under an MIT license
  • Claude Academy teaches the Claude API and the Model Context Protocol

github.com/anthropics/claude-cookbooks

Community and events

Around the documentation sits an active community of developers building with Claude.

  • The Code with Claude conference and hackathons with API-credit prizes
  • A Discord server for real-time help and project sharing

claude.com/community

Program names, credit amounts, and eligibility rules change often, and several programs accept applications only during announced windows. Check the official pages above before you apply. AnthropicAPIGuide is an independent publication, is not affiliated with Anthropic, and does not accept or forward applications.

06 — Articles

Go deeper

Six long-form guides, one for every part of a key’s life.

Is the Claude API free to try?

No. Anthropic’s documentation states that the Claude API has no free tier or self-serve trial and that new accounts do not include free credits. The smallest purchase is $5 of prepaid credits. Subscribers to the Claude Max, Ultra, and Team plans can claim monthly API credits as part of those plans, and eligible startups and researchers can apply for credit programs.

Personal, service account, workspace: which key do I need?

A personal key acts as you, with your roles, and stops working when you leave the organization. A service account key acts as a service account and keeps working when people leave, which makes it the right choice for shared or unattended workloads. Workspace keys are legacy: they act as no one, and Anthropic advises a personal or service account key for new integrations.

I leaked a key. What do I do now?

Disable it at once on the API keys page, create a replacement, update your services, review the Usage page for unexpected spend, and delete the old key. Anthropic automatically deactivates keys exposed in public GitHub repositories, but do not wait for that to happen.

What does a 429 error mean?

That a limit was exceeded. With a retry-after header, it is a per-minute rate limit or a ramp limit: wait the stated number of seconds and try again. Without the header, and with the code enforced_spend_limit_reached, you have reached your tier’s monthly spend cap, and access resumes at 00:00 UTC on the first day of the next month unless the cap is raised.

Do API credits expire?

Yes. Credits purchased in the Console expire one year from the purchase date, and the date cannot be extended. Credits that come with Claude subscription plans expire at the end of each billing cycle and do not roll over.

Can I call the Claude API straight from the browser?

You should not. Anyone who loads a page can read a key inside it. Anthropic’s guidance is to call the API from your own back end, which holds the credential, and have the front end call that back end.

Is this website part of Anthropic?

No. AnthropicAPIGuide is an independent information resource. It is not affiliated with, endorsed by, or sponsored by Anthropic, and it does not sell API access. For authoritative answers, always use the official Anthropic documentation.

About this guide

Independent, unsponsored, and checked against the source

AnthropicAPIGuide is an independent publication for developers working with the Claude API. It exists to explain, in plain English, how API keys, billing, limits, and support programs fit together. Nothing here is for sale, there is no sign-up, and no payment is accepted for coverage.

Every fact on this page was checked against Anthropic’s documentation and Help Center on December 3, 2026. Prices, limits, and program terms change, and where our summary and Anthropic’s own pages ever disagree, the official pages win.