C.W.K.
Stream
Lesson 04 of 08 · published

리전 · 쿼터 · 레이트리밋의 현실

~14 min · rate-limits, quota, regions, throughput

Level 0Observer
0 XP0/64 lessons0/13 achievements
0/150 XP to next level150 XP to go0% complete

쿼터는 티어별·org별 예산

Anthropic Console org 마다 레이트리밋이 분당 요청 수(RPM), 분당 입력 토큰(ITPM), 분당 출력 토큰(OTPM)으로, 각 모델별로 따로 잡혀. 새 org는 낮은 사용량 티어에서 시작하고 지출·계정 이력 따라 올라가. 현재 티어를 아는 건 capacity 플래닝의 일부지 출시일 깜짝쇼 아니야.

Bedrock·Vertex는 모양이 달라

Bedrock은 AWS 계정·리전마다 쿼터, AWS support로 올림. Vertex는 GCP 프로젝트마다 쿼터, GCP support로 올림. 직접 API 용량 계산이 두 클라우드에 그대로 옮겨가지 않아 — throughput 약속하기 전에 클라우드 콘솔에서 다시 확인.

429 떨어졌을 때

레이트리밋 걸리면 429 Too Many Requestsretry-after 헤더가 같이 떨어져. SDK가 디폴트 재시도 예산까지 자동으로 따라줘. 그 이상은 코드 책임 — 백오프, 큐, drop, degrade 중 하나, 트래픽이 강제로 고르게 하기 전에 미리 골라.

원칙: Capacity는 프로덕트 기능이야. 쿼터 티어랑 리전 지연을 아키텍처 입력으로 다뤄, 배포일 깜짝쇼 말고.

Code

레이트리밋 헤더 읽기 (Python)·python
from anthropic import Anthropic

client = Anthropic()
response = client.messages.with_raw_response.create(
    model="claude-sonnet-4-6",
    max_tokens=128,
    messages=[{"role": "user", "content": "hi"}],
)
for h in (
    "anthropic-ratelimit-requests-remaining",
    "anthropic-ratelimit-input-tokens-remaining",
    "anthropic-ratelimit-output-tokens-remaining",
    "retry-after",
):
    print(h, response.headers.get(h))
SDK 헬퍼 위에 백오프 한 겹·python
from anthropic import Anthropic, RateLimitError
import time, random

client = Anthropic(max_retries=3)  # SDK가 429/5xx를 이 횟수까지 자동 재시도.

def call_with_backoff(messages, attempts=5):
    delay = 1.0
    for i in range(attempts):
        try:
            return client.messages.create(
                model="claude-sonnet-4-6",
                max_tokens=512,
                messages=messages,
            )
        except RateLimitError as e:
            wait = float(e.response.headers.get("retry-after", delay))
            time.sleep(wait + random.random())
            delay *= 2
    raise RuntimeError("exhausted backoff")

External links

Exercise

Anthropic Console 열어서 모델별 현재 RPM·TPM 한도 적어. 각각에 대해 그 한도를 포화시킬 수 있는 가장 작은 입력 모양과, 계획한 대응(큐 / degrade / 배치)을 같이 써.
Hint
긴 PDF나 이미지 첨부 한 번이면 ITPM 포화시키는 게 생각보다 쉬워.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.