{
  "format": "agent-article-v0",
  "article_id": "GX-0001",
  "content_family": "GX",
  "public_kind": "ARTICLE_PRODUCT",
  "revision_id": "GX-0001-R20261029-01",
  "canonical_url": "/providers/gx-0001-anthropic-claude-api-errors-rate-limits-retry-boundaries",
  "page_type": "reference",
  "claim_ids": [],
  "evidence_ids": [],
  "unknown_ids": [
    "GX-0001-UNKNOWN-01"
  ],
  "operational_object_ids": [],
  "provider": [
    "Anthropic"
  ],
  "models": [
    "Messages API"
  ],
  "plans": [],
  "surfaces": [
    "error handling"
  ],
  "regions": [],
  "current_status": "UNKNOWN",
  "observation_status": "UNOBSERVED",
  "freshness": "UNKNOWN",
  "last_verified": null,
  "supersedes": [],
  "superseded_by": [],
  "provenance": [],
  "article_sources": [],
  "research_sections": [
    {
      "heading": "概要",
      "text": "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して分類する。"
    },
    {
      "heading": "Current version / availability",
      "text": "対象は2026-10-26時点のAnthropic Claude Platform / Claude API current docs。特定モデル固有ではなくAPI共通のエラー・rate-limit surfaceを扱う。Claude Platform on AWSでは認証・請求等にsurface差があるため、本記事の直接API契約を無条件に一般化しない。"
    },
    {
      "heading": "主要エラー境界",
      "text": "- 400 `invalid_request_error`: request形式・内容の問題に加え、organization/workspaceにユーザー設定したspend limit到達でも返り得る。\n- 429 `rate_limit_error`: organizationのrate limit、usage tierの月間spend cap、Claude Code workspace spend limitなどで返り得る。usage-tier spend-capの429には `retry-after` がなく、accessが再開するまで失敗が継続する。\n- 500 `api_error`: Anthropic内部の予期しないエラー。公式docsはexponential backoffでのretryを案内する。\n- 504 `timeout_error`: 処理timeout。長時間requestではstreaming Messages API等を検討する。\n- 529 `overloaded_error`: APIの一時的なoverload。"
    },
    {
      "heading": "Rate limit readback",
      "text": "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で確認できる。"
    },
    {
      "heading": "Retry / failure handling",
      "text": "公式SDKはconnection errors、rate limits、5xx等のtransient failureをexponential backoffで自動retryし、defaultは2回。`max_retries` で変更・無効化でき、`retry-after` があれば尊重する。ただしSDKの自動retryは、アプリケーション側の副作用がidempotentであることを保証しない。HTTP statusだけで安全な再実行を推定しない。\n\nstreaming SSEではHTTP 200受信後にmid-stream errorが発生し得るため、initial statusだけで成功確定しない。sharp traffic growthではacceleration limitにより429が出る場合があり、Anthropicはtrafficを段階的に増やし一貫したusage patternを維持するよう案内している。"
    },
    {
      "heading": "適用境界",
      "text": "本記事はAnthropic Claude APIの現行provider contractを記述する。429の意味、header名、SDK retry既定値を他providerへ一般化しない。organization固有のrate/spend thresholds、将来のlimit値、個別workspaceのeffective policyは固定値として断定しない。"
    },
    {
      "heading": "Unconfirmed",
      "text": "- 各organization/workspaceに現在適用されている具体的rate/spend limit値は環境依存であり、本記事からは確定できない。\n- mid-stream failure後に業務副作用を再実行してよいかはアプリケーションのidempotency設計に依存する。"
    }
  ],
  "human_url": "/providers/gx-0001-anthropic-claude-api-errors-rate-limits-retry-boundaries",
  "markdown_url": "/agent/article.md?path=%2Fproviders%2Fgx-0001-anthropic-claude-api-errors-rate-limits-retry-boundaries",
  "json_url": "/agent/article.json?path=%2Fproviders%2Fgx-0001-anthropic-claude-api-errors-rate-limits-retry-boundaries"
}