Claude Platform Docs

Shared

Models
type APIErrorObject struct { Type: "api_error"; Message }
Type APIError

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
type AuthenticationError struct { Type: "authentication_error"; Message }
Type AuthenticationError

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
type BillingError struct { Type: "billing_error"; Message }
Type BillingError

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
type ClaudeCodeKeyCreatorNotMemberErrorDetails struct { ErrorCode }
ErrorCode ClaudeCodeKeyCreatorNotMemberErrorCode
type ClaudeCodeVersionTooOldErrorDetails struct { ErrorCode }
ErrorCode ClaudeCodeVersionTooOldErrorCode
type CMEKContextUnavailableErrorDetails struct { ErrorCode }
ErrorCode CMEKContextUnavailableErrorCode
type CMEKKeyDisabledErrorDetails struct { ErrorCode }
ErrorCode CMEKKeyDisabledErrorCode
type CMEKKeyNetworkBlockedErrorDetails struct { ErrorCode }
ErrorCode CMEKKeyNetworkBlockedErrorCode
type CMEKKeyUnreachableErrorDetails struct { ErrorCode }
ErrorCode CMEKKeyUnreachableErrorCode
type EnforcedSpendLimitReachedErrorDetails struct { ErrorCode }
ErrorCode EnforcedSpendLimitReachedErrorCode
type ErrorDetailsUnion interface{…}
One of the following:
type ErrorObjectUnion interface{…}
One of the following:
type ErrorResponse struct { Type: "error"; Error; RequestID }
Type Error
defaulterror
One of the following:
RequestID string
type ErrorType string
One of the following:
const ErrorTypeInvalidRequestError ErrorType = "invalid_request_error"
const ErrorTypeAuthenticationError ErrorType = "authentication_error"
const ErrorTypeBillingError ErrorType = "billing_error"
const ErrorTypePermissionError ErrorType = "permission_error"
const ErrorTypeNotFoundError ErrorType = "not_found_error"
const ErrorTypeRateLimitError ErrorType = "rate_limit_error"
const ErrorTypeTimeoutError ErrorType = "timeout_error"
const ErrorTypeAPIError ErrorType = "api_error"
const ErrorTypeOverloadedError ErrorType = "overloaded_error"
const ErrorTypeMemoryPreconditionFailedError ErrorType = "memory_precondition_failed_error"
const ErrorTypeMemoryPathConflictError ErrorType = "memory_path_conflict_error"
const ErrorTypeConflictError ErrorType = "conflict_error"
type GatewayTimeoutError struct { Type: "timeout_error"; Message }
Type TimeoutError

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
type InvalidRequestError struct { Type: "invalid_request_error"; Message }
Type InvalidRequestError

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
type NotFoundError struct { Type: "not_found_error"; Message }
Type NotFoundError

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
type OrganizationOnHoldErrorDetails struct { ErrorCode; AppealURL }
ErrorCode OrganizationOnHoldErrorCode
AppealURL string Optional
type OrganizationTypeNotSupportedErrorDetails struct { ErrorCode }
ErrorCode OrganizationTypeNotSupportedErrorCode
type OverloadedError struct { Type: "overloaded_error"; Message }
Type OverloadedError

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
type ParentOrganizationRequiredErrorDetails struct { ErrorCode }
ErrorCode ParentOrganizationRequiredErrorCode
type PermissionError struct { Type: "permission_error"; Message }
Type PermissionError

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
type RampLimitExceededErrorDetails struct { ErrorCode }
ErrorCode RampLimitExceededErrorCode
type RateLimitError struct { Type: "rate_limit_error"; Message }
Type RateLimitError

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
type RequestBodyEncodingInvalidErrorDetails struct { ErrorCode }
ErrorCode RequestBodyEncodingInvalidErrorCode
type RequestBodyEncodingUnsupportedErrorDetails struct { ErrorCode }
ErrorCode RequestBodyEncodingUnsupportedErrorCode
type RequestBodyTooLargeAfterDecodingErrorDetails struct { ErrorCode }
ErrorCode RequestBodyTooLargeAfterDecodingErrorCode
type SandboxEgressRestrictedErrorDetails struct { ErrorCode }
ErrorCode SandboxEgressRestrictedErrorCode
Errors
const ErrorCodeClaudeCodeKeyCreatorNotMember ErrorCode = "claude_code_key_creator_not_member"

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.

const ErrorCodeClaudeCodeVersionTooOld ErrorCode = "claude_code_version_too_old"

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.

const ErrorCodeCMEKKeyDisabled ErrorCode = "cmek_key_disabled"

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

const ErrorCodeCMEKKeyNetworkBlocked ErrorCode = "cmek_key_network_blocked"

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.

const ErrorCodeOrganizationOnHold ErrorCode = "organization_on_hold"

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.

const ErrorCodeOrganizationTypeNotSupported ErrorCode = "organization_type_not_supported"

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

const ErrorCodeParentOrganizationRequired ErrorCode = "parent_organization_required"

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

const ErrorCodeRequestBodyEncodingInvalid ErrorCode = "request_body_encoding_invalid"

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

const ErrorCodeRequestBodyEncodingUnsupported ErrorCode = "request_body_encoding_unsupported"

The request's Content-Encoding is not supported.

const ErrorCodeSandboxEgressRestricted ErrorCode = "sandbox_egress_restricted"

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

const ErrorCodeRequestBodyTooLargeAfterDecoding ErrorCode = "request_body_too_large_after_decoding"

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

const ErrorCodeEnforcedSpendLimitReached ErrorCode = "enforced_spend_limit_reached"

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

const ErrorCodeRampLimitExceeded ErrorCode = "ramp_limit_exceeded"

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

const ErrorCodeCMEKContextUnavailable ErrorCode = "cmek_context_unavailable"

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

const ErrorCodeCMEKKeyUnreachable ErrorCode = "cmek_key_unreachable"

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.