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).
- Sign in or sign up at platform.claude.com.
- Add credits under Settings > Billing (platform.claude.com/settings/billing), or use the free trial credits.
- Open Settings > API keys and choose Create key.
- Name the key, pick an expiration, choose the Linked account (yourself or a service account) and, optionally, one workspace.
- Copy the key at once: it starts with
sk-ant-and the Console shows it only once, at creation. - Store it in the
ANTHROPIC_API_KEYenvironment 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:
- Tool Use: Claude calls functions you define, or Anthropic's server tools such as web search and web fetch and the code execution tool.
- Structured Outputs: responses that match a JSON Schema exactly.
- Prompt Caching: reuse a long system prompt or document at a fraction of the price.
- Message Batches API: up to 100,000 requests per batch at half price.
- Files API: upload a PDF or image once and reference it by
file_id. - Computer Use: Claude drives a desktop or a browser that your application runs.
- Vision and PDFs: images and documents as input, up to 600 images per request.
- Extended and Adaptive Thinking: Claude reasons before answering, controlled by an effort setting.
- Model Context Protocol: the MCP connector reaches remote MCP servers from a request.
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_pandtop_kare removed and return a 400 error on every model, even at default values.- A
documentblock in anassistantmessage returns 400. - A
textblock with citations in ausermessage 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
- Ship your first Managed Agent, Claude, May 26, 2026 (video)
- Intro to Claude, Anthropic docs, read Nov 6, 2026
- Get started, Anthropic docs, read Nov 6, 2026
- API overview, Anthropic docs, read Nov 6, 2026
- Get your Claude API key, Anthropic docs, read Nov 6, 2026
- Using the Messages API, Anthropic docs, read Nov 6, 2026
- Models overview, Anthropic docs, read Nov 6, 2026
- Model IDs and versioning, Anthropic docs, read Nov 6, 2026
- Model deprecations, Anthropic docs, read Nov 6, 2026
- Pricing, Anthropic docs, read Nov 6, 2026
- API credits for Max, Ultra, and Team plans, Anthropic docs, read Nov 6, 2026
- Rate limits, Anthropic docs, read Nov 6, 2026
- Claude API errors, Anthropic docs, read Nov 6, 2026
- Versions, Anthropic docs, read Nov 6, 2026
- Migrating to API version 2026-10-21, Anthropic docs, read Nov 6, 2026
- SDKs, CLI, and libraries, Anthropic docs, read Nov 6, 2026
- SDK versions, Anthropic, read Nov 6, 2026
- OpenAI SDK compatibility, Anthropic docs, read Nov 6, 2026
- Batch processing, Anthropic docs, read Nov 6, 2026
- Vision, Anthropic docs, read Nov 6, 2026
- Supported regions, Anthropic docs, read Nov 6, 2026
- API and data retention, Anthropic docs, read Nov 6, 2026
- Release notes, Anthropic docs, read Nov 6, 2026
Moments
Ship your first Managed Agent
Claude
See also
-
ClaudeClaude is the AI assistant and family of AI models made by Anthropic, used in the claude.ai web, desktop and mobile apps, in Claude Code for programming, and through the Claude API; it is free to start, with paid plans from $20 a month. -
Claude CodeClaude Code is Anthropic's agentic coding tool. It reads a codebase, edits files, runs commands and opens pull requests from the terminal, VS Code, JetBrains IDEs, the Claude desktop app, the browser and Slack, and it comes with every paid Claude plan or a pay-as-you-go Console account. -
Claude ConsoleThe Claude Console at platform.claude.com is Anthropic's web dashboard for the Claude API, where developers create API keys, test prompts in the playground, organize workspaces, watch usage and rate limits, and buy credits. It was called the Anthropic Console until Sep 2025, and its Workbench became the playground in Aug 2026.
-
Managed AgentsClaude Managed Agents is Anthropic's hosted agent service: you define an agent once, and Anthropic runs its loop, tools and sandbox for each session, billing normal token prices plus $0.08 per session-hour of running time. It has been in beta on the Claude API since Apr 8, 2026. -
Messages APIThe Messages API is the Claude API's main endpoint, POST /v1/messages: you send a model, max_tokens and a list of user and assistant messages, and Claude returns a message with content blocks, a stop_reason and token usage, whole or streamed.
-
Claude ProClaude Pro is Anthropic's $20-a-month plan ($17 a month billed annually) that adds at least five times Free's usage, the Opus models, Claude Code, Research and unlimited projects.