Claude api
★★★★★ 4.7 CE

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

Verified today·5 sources checked

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.

How to build on it

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.

Honest limits
  • 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
View sources

Build with the Claude API

Your first Claude API request

curl https://api.anthropic.com/v1/messagesbash
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

AspectDetailNotes
Base URLhttps://api.anthropic.com (REST)Models + Managed Agents
Authx-api-key header (or Authorization: Bearer via WIF)One of the two is required
Required headersanthropic-version (e.g. 2023-06-01), content-type: application/jsonSDKs send these automatically
KeysGenerated in the Console; workspaces segment keys and spendWorkbench to try in-browser
AvailabilityMany countries and regions worldwideCheck supported-regions page
Cloud platformsClaude Platform on AWS, Bedrock, Vertex AI, Microsoft FoundryCloud IAM auth; feature availability varies
ThinkingAdaptive thinking config; effort low..maxOutputConfig {effort, format}

Claude core endpoints

EndpointMethod / pathPurpose
MessagesPOST /v1/messagesConversational interactions (GA)
Message BatchesPOST /v1/messages/batchesAsync volume at 50% cost reduction (GA)
Token CountingPOST /v1/messages/count_tokensCount tokens before sending (GA)
ModelsGET /v1/modelsList models and details (GA)
Files / Skills (beta)POST /v1/files, /v1/skillsFiles across calls; custom agent skills
Managed Agents (beta)POST /v1/agents, /v1/sessions, /v1/environmentsVersioned agents, stateful cloud sessions

Claude rate limits and tiers

LimitDetailNotes
DimensionsRPM, ITPM, OTPM per model class429 + retry-after on breach
Claude Fable 5 (Tier 1)50 RPM / 100,000 ITPM / 20,000 OTPMRises automatically with tier
Claude Opus 4.x (Tier 1)50 RPM / 500,000 ITPM / 80,000 OTPMCombined pool across 4.8 to 4.1
AlgorithmToken bucket (continuous replenishment)Short bursts can still trip limits
Cache-aware ITPMcache_read tokens do NOT count toward ITPM on most modelsCached input billed at 10% of base
Usage tiersTier 1-4 + Monthly Invoicing; auto-advance by depositDeposits $5 / $40 / $200 / $400
Batches APITier 1: 50 RPM, 100,000 in queueShared across models
Managed Agents300 RPM create, 600 RPM readSeparate from Messages limits

Claude SDKs, error handling and developer fit

AspectDetailNotes
Official SDKsPython, TypeScript, C#, Go, Java, PHP, RubyHandle auth, formatting, errors
SDK featuresAuto headers, type-safe, retries, streaming, timeoutsRecommended over raw HTTP
Request sizeMessages 32 MB, Batches 256 MB, Files 500 MB413 request_too_large if exceeded
Response headersrequest-id, anthropic-organization-id on every responseAWS adds x-amzn-requestid
Errors429 (rate limit, retry-after), 413 (too large)Ramp gradually to avoid acceleration limits
Cost leversBatches 50% off; prompt caching 10% of input; pre-send token countingCaching also raises effective throughput
Refusal handlingstop_reason can be 'refusal'; opt into server-side fallbacksRefusalStopDetails carries the category
API pricing (Fable 5)$10/1M in, $50/1M out, cache hit $1/1MIndependent 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

Verified by ComparEdgeMethod: Vendor docs, official pages, and selected independent sources
SourceWhat was checkedLast checked
AnthropicOfficial product pageJuly 10, 2026
AnthropicAPI OverviewJuly 10, 2026
AnthropicAPI MessagesJuly 10, 2026
AnthropicAPI Rate LimitsJuly 10, 2026
Artificial AnalysisIndependent referenceJuly 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.