오류는 Anthropic 오류 봉투를 사용합니다.
  • error.type이 HTTP 상태를 결정합니다. 일반적인 분기는 이것으로 합니다.
  • error.code는 안정적이고 기계가 읽을 수 있는 사유입니다. 구체적인 사유로 분기할 때 사용합니다. 아래 목록은 계속 늘어나므로, 모르는 코드는 같은 type의 다른 오류처럼 처리하세요.
  • error.message는 사람을 위한 것이므로 파싱하지 마세요.
  • 지원팀에 문의할 때 request_id를 함께 알려 주세요.
  • 같은 요청을 다시 보내면 성공할 수 있는 경우(예: Idempotency-Key가 아직 처리 중)에만 409에 x-should-retry: true가 붙습니다.
retry로 표시된 행은 같은 요청을 바꾸지 않고 나중에 다시 보내면 성공할 수 있다는 뜻입니다. 지수 백오프로 재시도하세요. 표시가 없는 행은 요청이나 상태를 바꾸기 전에는 다시 실패합니다.

invalid_request_error (HTTP 400)

요청 형식이 잘못되었거나 받아들일 수 없습니다. 대처(행에 따로 적혀 있지 않은 경우): Correct the request as the message describes and send it again; the same request will keep failing.

authentication_error (HTTP 401)

자격 증명이 없거나 잘못되었거나 만료되었습니다. 대처(행에 따로 적혀 있지 않은 경우): Send a valid credential (API key, access token or console session) and retry.

permission_error (HTTP 403)

자격 증명은 유효하지만 이 작업을 할 수 없습니다. 대처(행에 따로 적혀 있지 않은 경우): Use a credential with the required role or access; retrying with the same credential will not help.

not_found_error (HTTP 404)

대상 리소스가 없습니다(또는 호출자에게 보이지 않습니다). 대처(행에 따로 적혀 있지 않은 경우): Check the ID and the organization or workspace it belongs to; do not retry the same request.

conflict_error (HTTP 409)

요청이 리소스의 현재 상태와 충돌합니다. 대처(행에 따로 적혀 있지 않은 경우): Re-read the resource, resolve the conflicting state, then send the request again.

request_too_large (HTTP 413)

요청이 크기 제한을 초과합니다. 대처(행에 따로 적혀 있지 않은 경우): Delete older machine backups or raise the limit, then retry.

rate_limit_error (HTTP 429)

요청 또는 시도가 너무 많습니다. 대처(행에 따로 적혀 있지 않은 경우): Wait for the Retry-After interval (or back off exponentially) and retry.

api_error (HTTP 500)

플랫폼 측 오류입니다. 대처(행에 따로 적혀 있지 않은 경우): Retry with exponential backoff; the dependency is temporarily unavailable.

timeout_error (HTTP 504)

업스트림 또는 머신이 제때 응답하지 않았습니다. 대처(행에 따로 적혀 있지 않은 경우): Retry with exponential backoff; the operation may have continued, so read the resource first.

overloaded_error (HTTP 529)

플랫폼 또는 의존 서비스가 일시적으로 과부하 상태입니다. 대처(행에 따로 적혀 있지 않은 경우): Retry with exponential backoff.