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 AuthenticationErrorObject 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 BillingErrorObject 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 ContractSpendLimitReachedErrorDetails struct { ErrorCode }
ErrorCode ContractSpendLimitReachedErrorCode
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 GatewayTimeoutErrorObject 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 InvalidRequestErrorObject 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 LinkedOrganizationBillingUnavailableErrorDetails struct { ErrorCode }
ErrorCode LinkedOrganizationBillingUnavailableErrorCode
type LinkedOrganizationSpendLimitReachedErrorDetails struct { ErrorCode }
ErrorCode LinkedOrganizationSpendLimitReachedErrorCode
type NotFoundErrorObject 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 OverloadedErrorObject 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 PermissionErrorObject 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 RateLimitErrorObject 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
type StorageNotReadyErrorDetails struct { ErrorCode }
ErrorCode StorageNotReadyErrorCode
type WorkspaceHumanReviewDisabledErrorDetails struct { ErrorCode }
ErrorCode WorkspaceHumanReviewDisabledErrorCode
Errors
const ErrorCodeClaudeCodeKeyCreatorNotMember ErrorCode = "claude_code_key_creator_not_member"⁠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.

const ErrorCodeClaudeCodeVersionTooOld ErrorCode = "claude_code_version_too_old"⁠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.

const ErrorCodeCMEKKeyDisabled ErrorCode = "cmek_key_disabled"⁠HTTP status 400

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

const ErrorCodeCMEKKeyNetworkBlocked ErrorCode = "cmek_key_network_blocked"⁠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.

const ErrorCodeOrganizationOnHold ErrorCode = "organization_on_hold"⁠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.

const ErrorCodeOrganizationTypeNotSupported ErrorCode = "organization_type_not_supported"⁠HTTP status 400

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"⁠HTTP status 400

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

const ErrorCodeRequestBodyEncodingInvalid ErrorCode = "request_body_encoding_invalid"⁠HTTP status 400

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

const ErrorCodeRequestBodyEncodingUnsupported ErrorCode = "request_body_encoding_unsupported"⁠HTTP status 400

The request's Content-Encoding is not supported.

const ErrorCodeWorkspaceHumanReviewDisabled ErrorCode = "workspace_human_review_disabled"⁠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.

const ErrorCodeLinkedOrganizationBillingUnavailable ErrorCode = "linked_organization_billing_unavailable"⁠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.

const ErrorCodeLinkedOrganizationSpendLimitReached ErrorCode = "linked_organization_spend_limit_reached"⁠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.

const ErrorCodeSandboxEgressRestricted ErrorCode = "sandbox_egress_restricted"⁠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.

const ErrorCodeRequestBodyTooLargeAfterDecoding ErrorCode = "request_body_too_large_after_decoding"⁠HTTP status 413

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

const ErrorCodeContractSpendLimitReached ErrorCode = "contract_spend_limit_reached"⁠HTTP status 429

The organization has reached the spend limit of its contract.

const ErrorCodeEnforcedSpendLimitReached ErrorCode = "enforced_spend_limit_reached"⁠HTTP status 429

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

const ErrorCodeRampLimitExceeded ErrorCode = "ramp_limit_exceeded"⁠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.

const ErrorCodeCMEKContextUnavailable ErrorCode = "cmek_context_unavailable"⁠HTTP status 503

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"⁠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.

const ErrorCodeStorageNotReady ErrorCode = "storage_not_ready"⁠HTTP status 503

This workspace isn't ready yet: it's still being connected to its storage. Try again in a few minutes.