SKILL.md
Anthropic Rate Limits
Overview
Anthropic enforces three types of limits: requests per minute (RPM), input tokens per minute (TPM), and output tokens per minute. Limits depend on your spend tier.
Rate Limit Tiers
| Tier | Qualification | RPM | Input TPM | Output TPM |
|---|---|---|---|---|
| Tier 1 | Free | 50 | 40,000 | 8,000 |
| Tier 2 | $40+ spend | 1,000 | 80,000 | 16,000 |
| Tier 3 | $200+ spend | 2,000 | 160,000 | 32,000 |
| Tier 4 | $400+ spend | 4,000 | 400,000 | 80,000 |
| Scale | Custom | Custom | Custom | Custom |
Check your tier: console.anthropic.com → Settings → Limits
Response Headers
Every API response includes rate limit headers:
claude-ratelimit-requests-limit: 1000
claude-ratelimit-requests-remaining: 998
claude-ratelimit-requests-reset: 2025-01-01T00:01:00Z
claude-ratelimit-tokens-limit: 80000
claude-ratelimit-tokens-remaining: 79500
claude-ratelimit-tokens-reset: 2025-01-01T00:01:00Z
retry-after: 5
Built-In SDK Retries
The SDK automatically retries 429 and 529 errors with exponential backoff:
import Anthropic from '@claude-ai/sdk';
const client = new Anthropic({
maxRetries: 3, // default: 2. Set to 0 to disable.
});
Custom Backoff
async function callWithBackoff(params: Anthropic.MessageCreateParams, maxRetries = 5) {
for (let attempt = 0; attempt < maxRetries; attempt++) {
try {
return await client.messages.create(params);
} catch (err) {
if (err instanceof Anthropic.RateLimitError) {
const retryAfter = Number(err.headers?.['retry-after'] || 2 ** attempt);
const jitter = Math.random() * 1000;
console.log(`Rate limited. Retry in ${retryAfter}s (attempt ${attempt + 1})`);
await new Promise(r => setTimeout(r, retryAfter * 1000 + jitter));
} else {
throw err;
}
}
}
throw new Error('Exceeded max retries');
}
