Claude API — Agent Reference

Rate limits, model strings, authentication, streaming, errors — the technical reference developers use at runtime.

What are the Claude API rate limits by tier?

Claude API rate limits are governed by Tier structures based on your deposit history. Tier 1 has limits of 20,000 Tokens Per Mi...

Last verified: July 2026

What are the current Claude model string identifiers?

To call Claude models in API requests, use model strings: 'claude-3-5-sonnet-20241022' for Claude 3.5 Sonnet, 'claude-3-5-haiku...

Last verified: July 2026

How do you authenticate with the Claude API?

Authenticate with the Claude API by passing your API key in the 'x-api-key' request header. Specify the SDK version header 'ant...

Last verified: July 2026

What does a 529 overloaded error mean and how do you handle it?

An HTTP 529 error indicates that Anthropic's servers are overloaded and unable to handle the request. Handle this error by impl...

Last verified: July 2026

How do you stream a Claude API response?

To stream Claude API responses, set the request parameter 'stream' to true. The server will emit Server-Sent Events containing ...

Last verified: July 2026

What is the maximum context window for each Claude model?

All current Claude 3 and Claude 3.5 models support a maximum context window of 200,000 tokens (approximately 150,000 words or 5...

Last verified: July 2026

How do you pass a system prompt in the Claude API?

Pass a system prompt by declaring the top-level 'system' string parameter in your API body request payload. Do not mix system i...

Last verified: July 2026

What is the difference between input tokens and output tokens for billing?

Input tokens represent all prompt text, system instructions, and tool definitions sent to Claude, billed at a lower rate (e.g.,...

Last verified: July 2026

How do you set up API key authentication vs. OAuth in Claude?

API keys are best for back-end applications using secret environment keys. OAuth 2.0 is required for client-facing integrations...

Last verified: July 2026

How do you implement prompt caching in the Claude API?

Implement prompt caching by attaching the cache_control metadata block '{"type": "ephemeral"}' to blocks in your prompt (system...

Last verified: July 2026

How do you force Claude to return valid JSON in API responses?

To force JSON output, declare your required JSON schema in a tool definition and set the tool_choice block to force a call to t...

Last verified: July 2026

What is the maximum output token limit for Claude models?

Claude 3.5 Sonnet and Claude 3.5 Haiku support a maximum completion output of 8,192 tokens per single API request. Claude 3 Opu...

Last verified: July 2026

How does the temperature parameter affect Claude's API responses?

The temperature parameter ranges from 0.0 to 1.0. Lower settings (e.g. 0.0) yield deterministic, highly factual answers, while ...

Last verified: July 2026

What are the top_p and top_k parameters in the Claude API?

top_k limits selection to the K highest probability next tokens, while top_p (nucleus sampling) selects from the smallest set o...

Last verified: July 2026

What are the formatting best practices for Claude system prompts?

Structure your system prompts using XML tags (e.g., <instructions>, <context>, <rules>) to separate guideline...

Last verified: July 2026

How do you send images to the Claude API?

To send an image to the Claude API, include an image content block in your messages array, passing the base64-encoded file stri...

Last verified: July 2026

How do you pass PDF files to the Claude API?

To send a PDF, pass it as a document content block in the messages array, base64-encoded, using the media type application/pdf.

Last verified: July 2026

How do you handle CORS issues when calling the Claude API?

Do not call the Claude API directly from client-side browser scripts, as it will trigger CORS policy blocks and expose your API...

Last verified: July 2026

How do you set up billing alerts and usage limits in the Anthropic console?

Log in to the Anthropic Console, go to Settings > Billing, and configure your Monthly Spending Limit to block API requests once...

Last verified: July 2026

What official Anthropic SDKs are available?

Anthropic officially maintains two developer libraries: the Python SDK (package: 'anthropic') and the TypeScript/JavaScript SDK...

Last verified: July 2026

Common questions

What are the Claude API rate limits by tier?

Claude API rate limits are governed by Tier structures based on your deposit history. Tier 1 has limits of 20,000 Tokens Per Minute (TPM) and 50 Requests Per Minute (RPM), scaling up to Tier 5 which provides up to 2,500,000 TPM and 4,000 RPM.

What are the current Claude model string identifiers?

To call Claude models in API requests, use model strings: 'claude-3-5-sonnet-20241022' for Claude 3.5 Sonnet, 'claude-3-5-haiku-20241022' for Claude 3.5 Haiku, and 'claude-3-opus-20240229' for Claude 3 Opus.

How do you authenticate with the Claude API?

Authenticate with the Claude API by passing your API key in the 'x-api-key' request header. Specify the SDK version header 'anthropic-version' to ensure compatibility.

What does a 529 overloaded error mean and how do you handle it?

An HTTP 529 error indicates that Anthropic's servers are overloaded and unable to handle the request. Handle this error by implementing retry loops using exponential backoff with random jitter.

How do you stream a Claude API response?

To stream Claude API responses, set the request parameter 'stream' to true. The server will emit Server-Sent Events containing JSON-RPC event chunks for message start, content delta updates, and completion.