Claude API

The Claude API is Anthropic's REST API at api.anthropic.com for building with Claude models: create an API key in the Claude Console at platform.claude.com, then send requests to the Messages API, paying per token.

The Claude API is Anthropic's REST API at https://api.anthropic.com: you create an API key in the Claude Console at platform.claude.com, send a POST /v1/messages request naming a model such as claude-opus-5-5, and pay per token used, from $0.10 per million input tokens on Claude Haiku 5.5 to $10 on Claude Fable 5.1 (as of Nov 6, 2026). It is the same family of models that runs the Claude apps and Claude Code, sold to developers by usage instead of by subscription. Anthropic calls the whole offering the Claude Developer Platform: the API itself, the Claude Console, the official SDKs, a command-line tool called ant, and a hosted agent service, Managed Agents.

Quick facts

Endpoint https://api.anthropic.com (API overview)
Main API Messages API, POST /v1/messages
Current API version 2026-10-21, released Oct 21, 2026
Where to get a key Claude Console > API keys (platform.claude.com/settings/keys)
Recommended starting model Claude Opus 5.5, claude-opus-5-5 (Models overview)
Context window 1M tokens on all four current models
Cheapest model Claude Haiku 5.5, $0.10 in and $0.50 out per million tokens up to 100,000-token prompts (as of Nov 6, 2026)
Official SDKs Seven languages: Python, TypeScript, C#, Go, Java, PHP, Ruby
Free trial New users get "a small amount of free credits"
Status page status.claude.com

How do you get a Claude API key?

A Claude API key comes from the Claude Console, which is a separate account from a claude.ai chat subscription. Paying for Claude Pro does not by itself give API access; Claude Max, Claude Ultra and Team plans include monthly API credits that you claim by linking a Console organization (below).

  1. Sign in or sign up at platform.claude.com.
  2. Add credits under Settings > Billing (platform.claude.com/settings/billing), or use the free trial credits.
  3. Open Settings > API keys and choose Create key.
  4. Name the key, pick an expiration, choose the Linked account (yourself or a service account) and, optionally, one workspace.
  5. Copy the key at once: it starts with sk-ant- and the Console shows it only once, at creation.
  6. Store it in the ANTHROPIC_API_KEY environment variable, never in source control or browser code.

Since Aug 27, 2026 the Console issues two kinds of key: a personal key, which acts as you and stops working if you leave the organization, and a service account key for servers, CI and agents. Older workspace keys still work but are now called legacy. A key not tied to one workspace must send the anthropic-workspace-id header with each request. A lost key cannot be recovered, even through the Admin API, which only shows a redacted hint (Get your Claude API key). For local work, the ant CLI can sign in through the browser with ant auth login instead of a key (Get started).

Your first request

Every request needs a key and an anthropic-version header. This is the smallest working call, as Anthropic's docs show it on Nov 6, 2026:

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": 1024,
    "messages": [{"role": "user", "content": "Hello, Claude"}]
  }'

The same call in Python, after pip install anthropic:

import anthropic

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

The reply is a JSON message with a content list, a stop_reason and a usage count of input and output tokens (Using the Messages API). The Messages API page covers the request and response field by field. The API also accepts the key as Authorization: Bearer <key>, which the newest SDKs send by default (migration guide).

Which Claude models are in the API?

Four models are current on Nov 6, 2026, all with a 1M-token context window and up to 128K output tokens:

Model API id Input / output per million tokens Docs' description
Claude Fable 5.1 claude-fable-5-1 $10 / $50 Demanding reasoning, long-horizon agentic work
Claude Opus 5.5 claude-opus-5-5 $4 / $20 Long-running agentic coding and knowledge work
Claude Sonnet 5.5 claude-sonnet-5-5 $2 / $10 Speed and intelligence balanced
Claude Haiku 5.5 claude-haiku-5-5 $0.10 / $0.50 (prompts up to 100,000 tokens) High-volume, latency-sensitive tasks

Sources: Models overview and Pricing, Anthropic docs, read Nov 6, 2026.

Anthropic's docs suggest starting with Opus 5.5 for most work and moving to Fable 5.1 for the hardest problems. Claude Mythos models are offered only to organizations verified through programs such as the Cyber Verification Program. Older models (Fable 5, Opus 5, Opus 4.8 to 4.5, Sonnet 5, Sonnet 4.6, Haiku 4.5) remain available, and each has a published earliest retirement date; Claude Sonnet 4.5 retires on Nov 30, 2026. Since the Claude 4.6 generation, an id such as claude-opus-5-5 is a fixed snapshot rather than an alias, so its weights never change (Model IDs and versioning). The whole lineup is on Claude Models.

What does the Claude API cost?

You pay per million tokens (MTok) of input and output, in US dollars, billed monthly on use. Three discounts matter most: Prompt Caching cuts the price of repeated input to a tenth or less, the Message Batches API takes 50% off work that can wait up to a day, and both stack. Server tools add their own fees, such as $10 per 1,000 web searches. Every price, the long-context rules, fast mode and a worked example are on Claude API Pricing.

Max, Ultra and Team subscribers get API credits each month since Oct 7, 2026: $100 on Max, $200 on Ultra, and $20 per Standard or $100 per Premium Team seat, capped at $500. They expire at the end of each billing cycle, cannot pay for Claude Code, and work only on the Claude API itself, not on Amazon Bedrock or other clouds.

What can you build with it?

The Messages API is one endpoint with many features switched on by parameters:

For agents that run for minutes or hours, Anthropic offers two higher-level paths: Managed Agents, where Anthropic runs the loop and the sandbox for $0.08 per session-hour plus tokens, and the Claude Agent SDK, the harness behind Claude Code, run in your own process.

SDKs, the CLI and the Console

Anthropic publishes official SDKs for Python (pip install anthropic), TypeScript (npm install @anthropic-ai/sdk), C#, Go, Java, PHP and Ruby; the versions current on Nov 6, 2026 include Python 2.6.0 and TypeScript 1.6.0. From the releases of Oct 21, 2026 the SDKs are under the Apache License 2.0 rather than MIT (migration guide). The SDKs retry rate-limit and server errors twice by default. The ant CLI (install with brew install anthropics/tap/ant) sends any API request from a terminal. In the Claude Console, the playground (the Workbench until Aug 18, 2026) runs prompts with every Messages API parameter and shows the SDK code for each run.

An OpenAI-compatible endpoint exists for testing, but Anthropic's docs say it is not a long-term or production-ready solution for most uses; Claude API vs OpenAI API compares the two platforms.

Limits, errors and where it runs

New organizations start in a low tier and rise automatically; the Start tier allows 4,000 requests a minute and 2,000,000 input tokens a minute on Opus 5.5, and caps spending at $500 a month. Cached input does not count against the input-token limit. A 429 error means a rate or spend limit; a 529 overloaded_error means the API is busy for everyone, and it can also arrive inside a stream after a 200 response (Claude API errors). Outages and slowdowns are posted on status.claude.com. Details are on Claude API Rate Limits.

The API is offered in 175 countries, regions and territories listed by Anthropic; China, Russia and Hong Kong are not among them. The same models are sold through Amazon Bedrock, Google Cloud and Microsoft Foundry, with differences in features and request size (Claude on Cloud Platforms).

On data: API prompts and outputs are not used for training without permission, and conversation content is not retained by default, except on Fable and Mythos models, which require 30-day retention. Zero data retention is available by arrangement with Anthropic's sales team, but stateful features such as batches, files and code execution fall outside it. More on Claude Privacy and Data Use.

What changed in API version 2026-10-21?

The newest version, released Oct 21, 2026, is the first since 2023-06-01 and has three breaking changes (Versions):

  • temperature, top_p and top_k are removed and return a 400 error on every model, even at default values.
  • A document block in an assistant message returns 400.
  • A text block with citations in a user message returns 400.

Code that depends on a low temperature (on Sonnet 4.6, for example) can stay on 2023-06-01. New major SDK versions (Python 2.0.0, TypeScript 1.0.0, Go 2.0.0 and others) send the new version by default (migration guide). Prefilling Claude's reply was already gone: it returns 400 on Claude 4.6 and later models (Claude API errors). Every API change is logged on Claude Release Notes.

Frequently asked questions

Is the Claude API free? No. The Claude API is pay as you go, though new Console accounts receive a small amount of free credits for testing, and Claude Max, Ultra and Team plans include monthly API credits.

Does a Claude Pro subscription include API access? No. Claude Pro covers the Claude apps and Claude Code only; API use is billed separately in the Claude Console. Max ($100 a month in credits), Ultra ($200) and Team plans include API credits since Oct 7, 2026.

Where do I find my Claude API key? In the Claude Console at platform.claude.com under Settings > API keys. A Claude API key is shown only once when created, so if it is lost you delete it and create a new one.

What is the Claude API model name for Opus 5.5? The Claude API id is claude-opus-5-5; Sonnet 5.5 is claude-sonnet-5-5, Haiku 5.5 is claude-haiku-5-5 and Fable 5.1 is claude-fable-5-1. On Amazon Bedrock the ids start with anthropic..

Is the Anthropic API the same as the Claude API? Yes. Anthropic renamed its developer offering the Claude API and the Claude Developer Platform; the endpoint is still api.anthropic.com, and the SDK packages are still named anthropic and @anthropic-ai/sdk.

Why does the Claude API return a 529 error? A 529 overloaded_error means the Claude API is temporarily overloaded across all users, not that your account hit a limit. The official SDKs retry it automatically; persistent 529s show on status.claude.com.

Sources

Moments

Ship your first Managed Agent

Claude

  1. For agents that run for minutes or hours, Anthropic offers two higher-level paths: Managed Agents, where Anthropic…

See also

About this page

Last updated Nov 6, 2026 by the Vi.ki team. Page text CC BY-SA 4.0.

Edit History

Hotkeys

/
Jump to the search box
? or Ctrl + /
Open this list
Esc
Close this list, the photo viewer, or the account menu

Video

Space or K
Play or pause
← →
Back or forward 5 seconds
J L
Back or forward 10 seconds
0 to 9
Go to 0% to 90% of the video
, .
Previous or next frame, while paused
M
Mute or unmute
C
Captions on or off
F
Full screen on or off
A D
Previous or next moment

Photo viewer

← → or A D
Previous or next photo
↑ ↓ or W S
Previous or next photo
Home End
First or last photo
I
Show or hide the photo's info
Z
Clickless on or off: a pointer over a thumbnail shows it
N
Compare with the last photo: back to the one shown before this, and N again comes back
Q
Move the thumbnails to the next edge: top, bottom, left and round
, or Ctrl + ,
Open or close the viewer's settings
V
Clickless pan: a zoomed photo follows the pointer, rather than being dragged
Shift
Browse on or off
B
Show or hide the button bar
T
Show or hide the thumbnails
1
100% zoom on or off
0
Rate the photo as no opinion; again takes the answer back
+ -
Rate the photo a step higher or lower
F
Full screen: the photo alone. F again puts everything back.
Back to top