# Anthropic Claude API — errors / rate limits / retry boundaries

ARTICLE_ID: GX-0001
CONTENT_FAMILY: GX
PUBLIC_KIND: ARTICLE_PRODUCT
REVISION_ID: GX-0001-R20261029-01
CURRENT_STATUS: UNKNOWN
OBSERVATION: UNOBSERVED
FRESHNESS: UNKNOWN
PAGE_TYPE: reference
CANONICAL_URL: /providers/gx-0001-anthropic-claude-api-errors-rate-limits-retry-boundaries
CLAIM_IDS: none
EVIDENCE_IDS: none
UNKNOWN_IDS: GX-0001-UNKNOWN-01
OPS_IDS: none

## Summary
Anthropic Claude API のエラー処理では、HTTPステータスだけで再試行可否を決めない。現行Claude Platformでは、同じ429 `rate_limit_error` でも通常のrate limit、usage tierの月間spend cap、Claude Code workspaceのspend limitなど原因が異なる。運用ではerror details、response headers、request ID、適用されたlimitをreadbackして分類する。

## Current judgment
ただしSDKの自動retryは、アプリケーション側の副作用がidempotentであることを保証しない。

## Scope
対象は2026-10-26時点のAnthropic Claude Platform / Claude API current docs。特定モデル固有ではなくAPI共通のエラー・rate-limit surfaceを扱う。Claude Platform on AWSでは認証・請求等にsurface差があるため、本記事の直接API契約を無条件に一般化しない。

## Confirmed

## UNKNOWN
- GX-0001-UNKNOWN-01: - 各organization/workspaceに現在適用されている具体的rate/spend limit値は環境依存であり、本記事からは確定できない。
- mid-stream failure後に業務副作用を再実行してよいかはアプリケーションのidempotency設計に依存する。

## Evidence
- none listed on this page

## Failure / limits
公式SDKはconnection errors、rate limits、5xx等のtransient failureをexponential backoffで自動retryし、defaultは2回。`max_retries` で変更・無効化でき、`retry-after` があれば尊重する。HTTP statusだけで安全な再実行を推定しない。

streaming SSEではHTTP 200受信後にmid-stream errorが発生し得るため、initial statusだけで成功確定しない。sharp traffic growthではacceleration limitにより429が出る場合があり、Anthropicはtrafficを段階的に増やし一貫したusage patternを維持するよう案内している。
## Practice
API responseは `retry-after`、request/token limit・remaining・reset系の `anthropic-ratelimit-*` headersを返す。`retry-after` がある場合、それより早いretryは失敗する。すべての429に `retry-after` があるわけではなく、spend-cap 429にはない。rate-limit headersは現在最も制約的なlimitを示すため、固定値をコードへ埋め込むより実応答とConsole/Rate Limits APIでeffective limitを確認する。workspace attributionは `anthropic-workspace-id` response headerで確認できる。
## 概要
Anthropic Claude API のエラー処理では、HTTPステータスだけで再試行可否を決めない。現行Claude Platformでは、同じ429 `rate_limit_error` でも通常のrate limit、usage tierの月間spend cap、Claude Code workspaceのspend limitなど原因が異なる。運用ではerror details、response headers、request ID、適用されたlimitをreadbackして分類する。

## Current version / availability
対象は2026-10-26時点のAnthropic Claude Platform / Claude API current docs。特定モデル固有ではなくAPI共通のエラー・rate-limit surfaceを扱う。Claude Platform on AWSでは認証・請求等にsurface差があるため、本記事の直接API契約を無条件に一般化しない。

## 主要エラー境界
- 400 `invalid_request_error`: request形式・内容の問題に加え、organization/workspaceにユーザー設定したspend limit到達でも返り得る。
- 429 `rate_limit_error`: organizationのrate limit、usage tierの月間spend cap、Claude Code workspace spend limitなどで返り得る。usage-tier spend-capの429には `retry-after` がなく、accessが再開するまで失敗が継続する。
- 500 `api_error`: Anthropic内部の予期しないエラー。公式docsはexponential backoffでのretryを案内する。
- 504 `timeout_error`: 処理timeout。長時間requestではstreaming Messages API等を検討する。
- 529 `overloaded_error`: APIの一時的なoverload。

## Rate limit readback
API responseは `retry-after`、request/token limit・remaining・reset系の `anthropic-ratelimit-*` headersを返す。`retry-after` がある場合、それより早いretryは失敗する。すべての429に `retry-after` があるわけではなく、spend-cap 429にはない。rate-limit headersは現在最も制約的なlimitを示すため、固定値をコードへ埋め込むより実応答とConsole/Rate Limits APIでeffective limitを確認する。workspace attributionは `anthropic-workspace-id` response headerで確認できる。

## Retry / failure handling
公式SDKはconnection errors、rate limits、5xx等のtransient failureをexponential backoffで自動retryし、defaultは2回。`max_retries` で変更・無効化でき、`retry-after` があれば尊重する。ただしSDKの自動retryは、アプリケーション側の副作用がidempotentであることを保証しない。HTTP statusだけで安全な再実行を推定しない。

streaming SSEではHTTP 200受信後にmid-stream errorが発生し得るため、initial statusだけで成功確定しない。sharp traffic growthではacceleration limitにより429が出る場合があり、Anthropicはtrafficを段階的に増やし一貫したusage patternを維持するよう案内している。

## 適用境界
本記事はAnthropic Claude APIの現行provider contractを記述する。429の意味、header名、SDK retry既定値を他providerへ一般化しない。organization固有のrate/spend thresholds、将来のlimit値、個別workspaceのeffective policyは固定値として断定しない。

## Unconfirmed
- 各organization/workspaceに現在適用されている具体的rate/spend limit値は環境依存であり、本記事からは確定できない。
- mid-stream failure後に業務副作用を再実行してよいかはアプリケーションのidempotency設計に依存する。

NEXT: /agent/start.json
STOP: This is a knowledge projection, not an execution order.