Shared
Models
class APIErrorObject: type: "api_error"; message
type: Literal["api_error"]The broad category of the error.
The broad category of the error.
message: strA human-readable explanation of the error. Its wording can change, so don't match on it.
A human-readable explanation of the error. Its wording can change, so don't match on it.
class AuthenticationErrorObject: type: "authentication_error"; message
type: Literal["authentication_error"]The broad category of the error.
The broad category of the error.
message: strA human-readable explanation of the error. Its wording can change, so don't match on it.
A human-readable explanation of the error. Its wording can change, so don't match on it.
class BillingErrorObject: type: "billing_error"; message
type: Literal["billing_error"]The broad category of the error.
The broad category of the error.
message: strA human-readable explanation of the error. Its wording can change, so don't match on it.
A human-readable explanation of the error. Its wording can change, so don't match on it.
class ClaudeCodeKeyCreatorNotMemberErrorDetails: error_code
class ClaudeCodeVersionTooOldErrorDetails: error_code
class CMEKContextUnavailableErrorDetails: error_code
class CMEKKeyDisabledErrorDetails: error_code
class CMEKKeyNetworkBlockedErrorDetails: error_code
class CMEKKeyUnreachableErrorDetails: error_code
class ContractSpendLimitReachedErrorDetails: error_code
class EnforcedSpendLimitReachedErrorDetails: error_code
type ErrorDetails = ...
type ErrorObject = ...
class ErrorResponse: type: "error"; error; request_id
type: Literal["error"]
error: ErrorObject
type ErrorType = Literal["invalid_request_error", "authentication_error", "billing_error", 9 more]
class GatewayTimeoutErrorObject: type: "timeout_error"; message
type: Literal["timeout_error"]The broad category of the error.
The broad category of the error.
message: strA human-readable explanation of the error. Its wording can change, so don't match on it.
A human-readable explanation of the error. Its wording can change, so don't match on it.
class InvalidRequestErrorObject: type: "invalid_request_error"; message
type: Literal["invalid_request_error"]The broad category of the error.
The broad category of the error.
message: strA human-readable explanation of the error. Its wording can change, so don't match on it.
A human-readable explanation of the error. Its wording can change, so don't match on it.
class LinkedOrganizationBillingUnavailableErrorDetails: error_code
class LinkedOrganizationSpendLimitReachedErrorDetails: error_code
class NotFoundErrorObject: type: "not_found_error"; message
type: Literal["not_found_error"]The broad category of the error.
The broad category of the error.
message: strA human-readable explanation of the error. Its wording can change, so don't match on it.
A human-readable explanation of the error. Its wording can change, so don't match on it.
class OrganizationOnHoldErrorDetails: error_code; appeal_url
class OrganizationTypeNotSupportedErrorDetails: error_code
class OverloadedErrorObject: type: "overloaded_error"; message
type: Literal["overloaded_error"]The broad category of the error.
The broad category of the error.
message: strA human-readable explanation of the error. Its wording can change, so don't match on it.
A human-readable explanation of the error. Its wording can change, so don't match on it.
class ParentOrganizationRequiredErrorDetails: error_code
class PermissionErrorObject: type: "permission_error"; message
type: Literal["permission_error"]The broad category of the error.
The broad category of the error.
message: strA human-readable explanation of the error. Its wording can change, so don't match on it.
A human-readable explanation of the error. Its wording can change, so don't match on it.
class RampLimitExceededErrorDetails: error_code
class RateLimitErrorObject: type: "rate_limit_error"; message
type: Literal["rate_limit_error"]The broad category of the error.
The broad category of the error.
message: strA human-readable explanation of the error. Its wording can change, so don't match on it.
A human-readable explanation of the error. Its wording can change, so don't match on it.
class RequestBodyEncodingInvalidErrorDetails: error_code
class RequestBodyEncodingUnsupportedErrorDetails: error_code
class RequestBodyTooLargeAfterDecodingErrorDetails: error_code
class SandboxEgressRestrictedErrorDetails: error_code
class WorkspaceHumanReviewDisabledErrorDetails: error_code
Errors
class ClaudeCodeKeyCreatorNotMemberError(BadRequestError): error_code; detailsHTTP status 400The 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.
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.
class ClaudeCodeVersionTooOldError(BadRequestError): error_code; detailsHTTP status 400The request comes from a Claude Code version older than the minimum that the requested model or the organization requires. Update Claude Code, then retry.
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.
details: ClaudeCodeVersionTooOldErrorDetails
class CMEKKeyDisabledError(BadRequestError): error_code; detailsHTTP status 400The workspace's customer-managed encryption key is disabled or revoked. Re-enable the key, then retry.
The workspace's customer-managed encryption key is disabled or revoked. Re-enable the key, then retry.
details: CMEKKeyDisabledErrorDetails
class CMEKKeyNetworkBlockedError(BadRequestError): error_code; detailsHTTP status 400The key management service's network access controls blocked the request to the workspace's customer-managed encryption key. The key itself may be healthy.
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.
details: CMEKKeyNetworkBlockedErrorDetails
class OrganizationOnHoldError(BadRequestError): error_code; detailsHTTP status 400Anthropic 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.
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.
details: OrganizationOnHoldErrorDetails
class OrganizationTypeNotSupportedError(BadRequestError): error_code; detailsHTTP status 400The endpoint does not support the organization's type. Each endpoint's description says which organization types it supports.
The endpoint does not support the organization's type. Each endpoint's description says which organization types it supports.
class ParentOrganizationRequiredError(BadRequestError): error_code; detailsHTTP status 400The endpoint serves only organizations that belong to a parent organization, and this organization belongs to none.
The endpoint serves only organizations that belong to a parent organization, and this organization belongs to none.
class RequestBodyEncodingInvalidError(BadRequestError): error_code; detailsHTTP status 400The request body is not valid for its Content-Encoding.
The request body is not valid for its Content-Encoding.
class RequestBodyEncodingUnsupportedError(BadRequestError): error_code; detailsHTTP status 400The request's Content-Encoding is not supported.
The request's Content-Encoding is not supported.
class WorkspaceHumanReviewDisabledError(BadRequestError): error_code; detailsHTTP status 400The request's Workspace has Human Review turned off, and this operation is not available there. Use a Workspace with Human Review on.
The request's Workspace has Human Review turned off, and this operation is not available there. Use a Workspace with Human Review on.
class LinkedOrganizationBillingUnavailableError(PaymentRequiredError): error_code; detailsHTTP status 402Anthropic 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.
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.
class LinkedOrganizationSpendLimitReachedError(PaymentRequiredError): error_code; detailsHTTP status 402The 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.
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.
class SandboxEgressRestrictedError(PermissionDeniedError): error_code; detailsHTTP status 403The 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.
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.
details: SandboxEgressRestrictedErrorDetails
class RequestBodyTooLargeAfterDecodingError(ContentTooLargeError): error_code; detailsHTTP status 413The compressed request body exceeds the request size limit once decoded.
The compressed request body exceeds the request size limit once decoded.
class ContractSpendLimitReachedError(RateLimitError): error_code; detailsHTTP status 429The organization has reached the spend limit of its contract.
The organization has reached the spend limit of its contract.
class EnforcedSpendLimitReachedError(RateLimitError): error_code; detailsHTTP status 429The organization has crossed the monthly API usage threshold of its API tier.
The organization has crossed the monthly API usage threshold of its API tier.
class RampLimitExceededError(RateLimitError): error_code; detailsHTTP status 429The request would exceed a ramp limit, which caps how fast usage can grow. Retry after the time in the retry-after header.
The request would exceed a ramp limit, which caps how fast usage can grow. Retry after the time in the retry-after header.
details: RampLimitExceededErrorDetails
class CMEKContextUnavailableError(ServiceUnavailableError): error_code; detailsHTTP status 503The workspace's encryption settings could not be read, so the request was refused. Retry in a few minutes.
The workspace's encryption settings could not be read, so the request was refused. Retry in a few minutes.
details: CMEKContextUnavailableErrorDetails
class CMEKKeyUnreachableError(ServiceUnavailableError): error_code; detailsHTTP status 503The 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.
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.