DEV Community

Sangmin Lee
Sangmin Lee

Posted on • Originally published at claudeguide.io

Claude API 429 rate_limit_error: 원인과 해결법 (2026)

Originally published at claudeguide.io/claude-api-error-429

Claude API 429 rate_limit_error: 원인과 해결법 (2026)

Claude API 429 rate_limit_error는 조직의 분당/일별 요청수(RPM/RPD) 또는 토큰수(TPM/TPD)가 한도 초과에 발생합니다. Rate limit 초과이며, exponential backoff 재시도가 효과적해야 합니다. 이 글은 5가지 흔한 원인과 Python/TypeScript 코드 예시를 다룹니다.

전반적인 Claude API 에러 처리 패턴은 Claude API Error Handling 가이드를 참고하세요.


무엇을 의미하는가?

429 HTTP 상태 코드는 조직의 분당/일별 요청수(RPM/RPD) 또는 토큰수(TPM/TPD)가 한도 초과을 의미합니다. Anthropic API의 에러 응답 본문에는 error.type"rate_limit_error"로 명시되며, error.message에 구체적 사유가 옵니다.

응답 예시:

{
  "type": "error",
  "error": {
    "type": "rate_limit_error",
    "message": "..."
  }
}
Enter fullscreen mode Exit fullscreen mode

흔한 원인 5가지

  1. 분당 요청수(RPM) 초과 — 첫 tier는 보통 50 RPM
  2. 분당 토큰수(TPM) 초과 — 첫 tier는 50,000 TPM
  3. 단일 burst로 한 번에 100건+ 요청 시도
  4. Batch API 미사용 (batch는 별도 quota)

해결 코드 (Python)

import time, anthropic

def with_backoff(fn, max_retries=5):
    for attempt in range(max_retries):
        try:
            return fn()
        except anthropic.RateLimitError as e:
            if attempt == max_retries - 1:
                raise
            wait = 2 ** attempt  # 1, 2, 4, 8, 16
            # Honor Retry-After header if present
            retry_after = e.response.headers.get("retry-after")
            if retry_after:
                wait = max(wait, int(retry_after))
            print(f"Rate limited. Waiting {wait}s (attempt {attempt+1})")
            time.sleep(wait)
Enter fullscreen mode Exit fullscreen mode

해결 코드 (TypeScript)


typescript
async function withBackoff<T
Enter fullscreen mode Exit fullscreen mode

Top comments (0)