
Claude API: Access, Rate Limits & SDKs 2026
The Claude API is one REST endpoint at api.anthropic.com, with SDKs in seven languages. Batches run 50% cheaper, and cached input is billed at 10%.
Claude API verdict
The Claude API is a REST API at api.anthropic.com.
You authenticate with an x-api-key header, or a WIF bearer token, plus a required anthropic-version. The GA surface is small.
Claude's API is straightforward to adopt: one Messages endpoint, official SDKs in seven languages, and predictable token-bucket limits. Budget around three levers. Route non-interactive volume through the Batches API for 50% off. Cache repeated context, since cached input is billed at 10% and excluded from ITPM on most models. Count tokens before sending. For full feature parity, choose the direct API or the Claude Platform on AWS. Pick Bedrock or Vertex only if existing cloud commitments outweigh their smaller request caps and feature lag. If you expect high volume, plan tier-advancement deposits ahead of launch.
- Rate limits are maximums over short windows. A 50 RPM limit can be enforced as roughly 1 request per second, so bursts trip 429s even under the nominal cap.
- Cache-aware ITPM has an exception, since Claude Haiku 3.5 counts cached reads. Confirm it per model before relying on caching for headroom.
- Feature availability and request-size caps differ across platforms. The direct API and Claude Platform on AWS share limits, but Bedrock caps at 20 MB and Vertex at 30 MB, and both lag on some features.
- Tier advancement is deposit-gated, from $5 to $400 cumulative, and spend-capped per tier. Higher limits need a sales contact or Monthly Invoicing.
- Base URL
- api.anthropic.com
- Core endpoint
- POST /v1/messages
- Official SDKs
- 7 languages
- Batch discount
- 50% (async)
- Cached input
- 10% price, off-ITPM
Build with the Claude API
import anthropic
client = anthropic.Anthropic()
message = client.messages.create(
model="claude-opus-4-8",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello, Claude"}],
)
print(message.content[0].text){
"id": "msg_01XFD...",
"type": "message",
"role": "assistant",
"model": "claude-opus-4-8",
"content": [{ "type": "text", "text": "Hello! How can I help?" }],
"stop_reason": "end_turn",
"usage": { "input_tokens": 12, "output_tokens": 9 }
}- Tier-1 limits (Claude Fable 5): 50 RPM, 100,000 ITPM, 20,000 OTPM.
- Cost levers: Message Batches API (50% off, async); prompt caching (cached input 10%, off-ITPM); Token Counting API.
- Handle: 413 (request_too_large), 429 (rate limit, retry-after).
Real Claude code from the official docs. The raw cURL hello-world is the code block above; full limits and endpoints are in the tables on this page.
Your first Claude API request
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-opus-4-8",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello, Claude"}]
}'How to authenticate with the Claude API
| Aspect | Detail | Notes |
|---|---|---|
| Base URL | https://api.anthropic.com (REST) | Models + Managed Agents |
| Auth | x-api-key header (or Authorization: Bearer via WIF) | One of the two is required |
| Required headers | anthropic-version (e.g. 2023-06-01), content-type: application/json | SDKs send these automatically |
| Keys | Generated in the Console; workspaces segment keys and spend | Workbench to try in-browser |
| Availability | Many countries and regions worldwide | Check supported-regions page |
| Cloud platforms | Claude Platform on AWS, Bedrock, Vertex AI, Microsoft Foundry | Cloud IAM auth; feature availability varies |
| Thinking | Adaptive thinking config; effort low..max | OutputConfig {effort, format} |
Claude core endpoints
| Endpoint | Method / path | Purpose |
|---|---|---|
| Messages | POST /v1/messages | Conversational interactions (GA) |
| Message Batches | POST /v1/messages/batches | Async volume at 50% cost reduction (GA) |
| Token Counting | POST /v1/messages/count_tokens | Count tokens before sending (GA) |
| Models | GET /v1/models | List models and details (GA) |
| Files / Skills (beta) | POST /v1/files, /v1/skills | Files across calls; custom agent skills |
| Managed Agents (beta) | POST /v1/agents, /v1/sessions, /v1/environments | Versioned agents, stateful cloud sessions |
Claude rate limits and tiers
| Limit | Detail | Notes |
|---|---|---|
| Dimensions | RPM, ITPM, OTPM per model class | 429 + retry-after on breach |
| Claude Fable 5 (Tier 1) | 50 RPM / 100,000 ITPM / 20,000 OTPM | Rises automatically with tier |
| Claude Opus 4.x (Tier 1) | 50 RPM / 500,000 ITPM / 80,000 OTPM | Combined pool across 4.8 to 4.1 |
| Algorithm | Token bucket (continuous replenishment) | Short bursts can still trip limits |
| Cache-aware ITPM | cache_read tokens do NOT count toward ITPM on most models | Cached input billed at 10% of base |
| Usage tiers | Tier 1-4 + Monthly Invoicing; auto-advance by deposit | Deposits $5 / $40 / $200 / $400 |
| Batches API | Tier 1: 50 RPM, 100,000 in queue | Shared across models |
| Managed Agents | 300 RPM create, 600 RPM read | Separate from Messages limits |
Claude SDKs, error handling and developer fit
| Aspect | Detail | Notes |
|---|---|---|
| Official SDKs | Python, TypeScript, C#, Go, Java, PHP, Ruby | Handle auth, formatting, errors |
| SDK features | Auto headers, type-safe, retries, streaming, timeouts | Recommended over raw HTTP |
| Request size | Messages 32 MB, Batches 256 MB, Files 500 MB | 413 request_too_large if exceeded |
| Response headers | request-id, anthropic-organization-id on every response | AWS adds x-amzn-requestid |
| Errors | 429 (rate limit, retry-after), 413 (too large) | Ramp gradually to avoid acceleration limits |
| Cost levers | Batches 50% off; prompt caching 10% of input; pre-send token counting | Caching also raises effective throughput |
| Refusal handling | stop_reason can be 'refusal'; opt into server-side fallbacks | RefusalStopDetails carries the category |
| API pricing (Fable 5) | $10/1M in, $50/1M out, cache hit $1/1M | Independent cross-reference |
Claude API FAQ
How do I authenticate with the Claude API?
Every request to https://api.anthropic.com needs an x-api-key header, your key from the Console, or an Authorization: Bearer token through Workload Identity Federation. It also needs a required anthropic-version header, for example 2023-06-01, and content-type: application/json. The official SDKs send these automatically. On cloud platforms like AWS, Vertex and Azure, authentication uses the provider's IAM.
What are the core Claude API endpoints?
Four are generally available. Messages, at POST /v1/messages, handles conversational calls. Message Batches, at POST /v1/messages/batches, runs async volume at a 50% discount. Token Counting and Models round out the set. In beta are Files, Skills and the Managed Agents trio of Agents, Sessions and Environments, for stateful agents in cloud sandboxes.
What are Claude's API rate limits?
They are set per model class in requests per minute, input tokens per minute and output tokens per minute, enforced with a token-bucket algorithm. At Tier 1, Claude Fable 5 allows 50 RPM, 100,000 ITPM and 20,000 OTPM, and the Opus 4.x pool allows 50, 500,000 and 80,000. On most models, cached input tokens do not count toward ITPM, so prompt caching raises effective throughput. Breaches return a 429 with a retry-after header.
Which SDKs does Claude offer, and is there streaming?
Official SDKs cover Python, TypeScript, C#, Go, Java, PHP and Ruby. They handle authentication headers, type-safe requests and responses, built-in retries, request timeouts and streaming. Streaming is recommended for long inputs or outputs, so a request does not time out.
How can I reduce Claude API costs?
Three built-in levers. Use the Message Batches API for non-interactive work, which cuts cost by 50%. Use prompt caching for repeated content, since cached input is billed at 10% of the base input price and, on most models, does not count toward your ITPM limit. Use the Token Counting API to estimate cost before sending. A higher max_tokens has no rate-limit downside, because OTPM counts only the tokens actually generated.
Sources & verification
| Source | What was checked | Last checked |
|---|---|---|
| Anthropic | Official product page | July 10, 2026 |
| Anthropic | API Overview | July 10, 2026 |
| Anthropic | API Messages | July 10, 2026 |
| Anthropic | API Rate Limits | July 10, 2026 |
| Artificial Analysis | Independent reference | July 10, 2026 |
Every fact on this Claude page is tied to a named source and a verification date. Freshness-sensitive figures trace to the sources above; verify against the vendor before relying on them.
Explore Claude
Every page on Claude in one place, you are on api.