Claude Platform Docs

Shared

Models
interface APIErrorObject { type: "api_error"; message }
type: "api_error"

The broad category of the error.

defaultapi_error
message: string

A human-readable explanation of the error. Its wording can change, so don't match on it.

defaultInternal server error
interface AuthenticationErrorObject { type: "authentication_error"; message }
type: "authentication_error"

The broad category of the error.

defaultauthentication_error
message: string

A human-readable explanation of the error. Its wording can change, so don't match on it.

defaultAuthentication error
interface BillingErrorObject { type: "billing_error"; message }
type: "billing_error"

The broad category of the error.

defaultbilling_error
message: string

A human-readable explanation of the error. Its wording can change, so don't match on it.

defaultBilling error
interface ClaudeCodeKeyCreatorNotMemberErrorDetails { error_code }
error_code: "claude_code_key_creator_not_member"
interface ClaudeCodeVersionTooOldErrorDetails { error_code }
error_code: "claude_code_version_too_old"
interface CMEKContextUnavailableErrorDetails { error_code }
error_code: "cmek_context_unavailable"
interface CMEKKeyDisabledErrorDetails { error_code }
error_code: "cmek_key_disabled"
interface CMEKKeyNetworkBlockedErrorDetails { error_code }
error_code: "cmek_key_network_blocked"
interface CMEKKeyUnreachableErrorDetails { error_code }
error_code: "cmek_key_unreachable"
interface ContractSpendLimitReachedErrorDetails { error_code }
error_code: "contract_spend_limit_reached"
interface EnforcedSpendLimitReachedErrorDetails { error_code }
error_code: "enforced_spend_limit_reached"
One of the following:
interface ErrorResponse { type: "error"; error; request_id }
type: "error"
defaulterror
One of the following:
request_id: string | null
type ErrorType = "invalid_request_error" | "authentication_error" | "billing_error" | 9 more
One of the following:
"invalid_request_error"
"authentication_error"
"billing_error"
"permission_error"
"not_found_error"
"rate_limit_error"
"timeout_error"
"api_error"
"overloaded_error"
"memory_precondition_failed_error"
"memory_path_conflict_error"
"conflict_error"
interface GatewayTimeoutErrorObject { type: "timeout_error"; message }
type: "timeout_error"

The broad category of the error.

defaulttimeout_error
message: string

A human-readable explanation of the error. Its wording can change, so don't match on it.

defaultRequest timeout
interface InvalidRequestErrorObject { type: "invalid_request_error"; message }
type: "invalid_request_error"

The broad category of the error.

defaultinvalid_request_error
message: string

A human-readable explanation of the error. Its wording can change, so don't match on it.

defaultInvalid request
interface LinkedOrganizationBillingUnavailableErrorDetails { error_code }
error_code: "linked_organization_billing_unavailable"
interface LinkedOrganizationSpendLimitReachedErrorDetails { error_code }
error_code: "linked_organization_spend_limit_reached"
interface NotFoundErrorObject { type: "not_found_error"; message }
type: "not_found_error"

The broad category of the error.

defaultnot_found_error
message: string

A human-readable explanation of the error. Its wording can change, so don't match on it.

defaultNot found
interface OrganizationOnHoldErrorDetails { error_code; appeal_url }
error_code: "organization_on_hold"
appeal_url?: string | null
interface OrganizationTypeNotSupportedErrorDetails { error_code }
error_code: "organization_type_not_supported"
interface OverloadedErrorObject { type: "overloaded_error"; message }
type: "overloaded_error"

The broad category of the error.

defaultoverloaded_error
message: string

A human-readable explanation of the error. Its wording can change, so don't match on it.

defaultOverloaded
interface ParentOrganizationRequiredErrorDetails { error_code }
error_code: "parent_organization_required"
interface PermissionErrorObject { type: "permission_error"; message }
type: "permission_error"

The broad category of the error.

defaultpermission_error
message: string

A human-readable explanation of the error. Its wording can change, so don't match on it.

defaultPermission denied
interface RampLimitExceededErrorDetails { error_code }
error_code: "ramp_limit_exceeded"
interface RateLimitErrorObject { type: "rate_limit_error"; message }
type: "rate_limit_error"

The broad category of the error.

defaultrate_limit_error
message: string

A human-readable explanation of the error. Its wording can change, so don't match on it.

defaultRate limited
interface RequestBodyEncodingInvalidErrorDetails { error_code }
error_code: "request_body_encoding_invalid"
interface RequestBodyEncodingUnsupportedErrorDetails { error_code }
error_code: "request_body_encoding_unsupported"
interface RequestBodyTooLargeAfterDecodingErrorDetails { error_code }
error_code: "request_body_too_large_after_decoding"
interface SandboxEgressRestrictedErrorDetails { error_code }
error_code: "sandbox_egress_restricted"
interface WorkspaceHumanReviewDisabledErrorDetails { error_code }
error_code: "workspace_human_review_disabled"
Errors
class ClaudeCodeKeyCreatorNotMemberError extends BadRequestError { errorCode; details }⁠HTTP status 400

The API key belongs to the Claude Code workspace, and the user who created it is no longer a member of the organization or of that workspace.

errorCode: "claude_code_key_creator_not_member"
error_code: "claude_code_key_creator_not_member"
class ClaudeCodeVersionTooOldError extends BadRequestError { errorCode; details }⁠HTTP status 400

The request comes from a Claude Code version older than the minimum that the requested model or the organization requires. Update Claude Code, then retry.

errorCode: "claude_code_version_too_old"
details: ClaudeCodeVersionTooOldErrorDetails { error_code }
error_code: "claude_code_version_too_old"
class CMEKKeyDisabledError extends BadRequestError { errorCode; details }⁠HTTP status 400

The workspace's customer-managed encryption key is disabled or revoked. Re-enable the key, then retry.

errorCode: "cmek_key_disabled"
details: CMEKKeyDisabledErrorDetails { error_code }
error_code: "cmek_key_disabled"
class CMEKKeyNetworkBlockedError extends BadRequestError { errorCode; details }⁠HTTP status 400

The key management service's network access controls blocked the request to the workspace's customer-managed encryption key. The key itself may be healthy.

errorCode: "cmek_key_network_blocked"
details: CMEKKeyNetworkBlockedErrorDetails { error_code }
error_code: "cmek_key_network_blocked"
class OrganizationOnHoldError extends BadRequestError { errorCode; details }⁠HTTP status 400

Anthropic has disabled the organization for trust and safety reasons. An organization disabled for any other reason, such as billing, does not get this code. appeal_url, when present, is where the organization can appeal.

errorCode: "organization_on_hold"
details: OrganizationOnHoldErrorDetails { error_code; appeal_url }
error_code: "organization_on_hold"
appeal_url?: string | null
class OrganizationTypeNotSupportedError extends BadRequestError { errorCode; details }⁠HTTP status 400

The endpoint does not support the organization's type. Each endpoint's description says which organization types it supports.

errorCode: "organization_type_not_supported"
error_code: "organization_type_not_supported"
class ParentOrganizationRequiredError extends BadRequestError { errorCode; details }⁠HTTP status 400

The endpoint serves only organizations that belong to a parent organization, and this organization belongs to none.

errorCode: "parent_organization_required"
error_code: "parent_organization_required"
class RequestBodyEncodingInvalidError extends BadRequestError { errorCode; details }⁠HTTP status 400

The request body is not valid for its Content-Encoding.

errorCode: "request_body_encoding_invalid"
error_code: "request_body_encoding_invalid"
class RequestBodyEncodingUnsupportedError extends BadRequestError { errorCode; details }⁠HTTP status 400

The request's Content-Encoding is not supported.

errorCode: "request_body_encoding_unsupported"
error_code: "request_body_encoding_unsupported"
class WorkspaceHumanReviewDisabledError extends BadRequestError { errorCode; details }⁠HTTP status 400

The request's Workspace has Human Review turned off, and this operation is not available there. Use a Workspace with Human Review on.

errorCode: "workspace_human_review_disabled"
error_code: "workspace_human_review_disabled"
class LinkedOrganizationBillingUnavailableError extends PaymentRequiredError { errorCode; details }⁠HTTP status 402

Anthropic cannot currently bill the organization linked to the request's user profile, for a reason that lies with that organization's own account. The response does not say what the reason is.

errorCode: "linked_organization_billing_unavailable"
error_code: "linked_organization_billing_unavailable"
class LinkedOrganizationSpendLimitReachedError extends PaymentRequiredError { errorCode; details }⁠HTTP status 402

The organization linked to the request's user profile has reached a spend limit that it set, or lacks credit for the request. The response does not say which applies.

errorCode: "linked_organization_spend_limit_reached"
error_code: "linked_organization_spend_limit_reached"
class SandboxEgressRestrictedError extends PermissionDeniedError { errorCode; details }⁠HTTP status 403

The request came from a Claude sandbox with restricted network access, which is not allowed to make this request. Send it from outside the sandbox, or from a sandbox with unrestricted network access.

errorCode: "sandbox_egress_restricted"
details: SandboxEgressRestrictedErrorDetails { error_code }
error_code: "sandbox_egress_restricted"
class RequestBodyTooLargeAfterDecodingError extends ContentTooLargeError { errorCode; details }⁠HTTP status 413

The compressed request body exceeds the request size limit once decoded.

errorCode: "request_body_too_large_after_decoding"
error_code: "request_body_too_large_after_decoding"
class ContractSpendLimitReachedError extends RateLimitError { errorCode; details }⁠HTTP status 429

The organization has reached the spend limit of its contract.

errorCode: "contract_spend_limit_reached"
details: ContractSpendLimitReachedErrorDetails { error_code }
error_code: "contract_spend_limit_reached"
class EnforcedSpendLimitReachedError extends RateLimitError { errorCode; details }⁠HTTP status 429

The organization has crossed the monthly API usage threshold of its API tier.

errorCode: "enforced_spend_limit_reached"
details: EnforcedSpendLimitReachedErrorDetails { error_code }
error_code: "enforced_spend_limit_reached"
class RampLimitExceededError extends RateLimitError { errorCode; details }⁠HTTP status 429

The request would exceed a ramp limit, which caps how fast usage can grow. Retry after the time in the retry-after header.

errorCode: "ramp_limit_exceeded"
details: RampLimitExceededErrorDetails { error_code }
error_code: "ramp_limit_exceeded"
class CMEKContextUnavailableError extends ServiceUnavailableError { errorCode; details }⁠HTTP status 503

The workspace's encryption settings could not be read, so the request was refused. Retry in a few minutes.

errorCode: "cmek_context_unavailable"
details: CMEKContextUnavailableErrorDetails { error_code }
error_code: "cmek_context_unavailable"
class CMEKKeyUnreachableError extends ServiceUnavailableError { errorCode; details }⁠HTTP status 503

The workspace's customer-managed encryption key could not be reached. Retry the request; if this continues, check that the key is available in your key management service, or contact Anthropic support.

errorCode: "cmek_key_unreachable"
details: CMEKKeyUnreachableErrorDetails { error_code }
error_code: "cmek_key_unreachable"