Claude Platform Docs

Shared

Models
class ApiErrorObject { type = "api_error"; message; }
JsonValue type = "api_error"

The broad category of the error.

String message

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

class AuthenticationError { type = "authentication_error"; message; }
JsonValue type = "authentication_error"

The broad category of the error.

String message

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

class BillingError { type = "billing_error"; message; }
JsonValue type = "billing_error"

The broad category of the error.

String message

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

class ClaudeCodeKeyCreatorNotMemberErrorDetails { errorCode; }
JsonValue errorCode = "claude_code_key_creator_not_member"
class ClaudeCodeVersionTooOldErrorDetails { errorCode; }
JsonValue errorCode = "claude_code_version_too_old"
class CmekContextUnavailableErrorDetails { errorCode; }
JsonValue errorCode = "cmek_context_unavailable"
class CmekKeyDisabledErrorDetails { errorCode; }
JsonValue errorCode = "cmek_key_disabled"
class CmekKeyNetworkBlockedErrorDetails { errorCode; }
JsonValue errorCode = "cmek_key_network_blocked"
class CmekKeyUnreachableErrorDetails { errorCode; }
JsonValue errorCode = "cmek_key_unreachable"
class ContractSpendLimitReachedErrorDetails { errorCode; }
JsonValue errorCode = "contract_spend_limit_reached"
class EnforcedSpendLimitReachedErrorDetails { errorCode; }
JsonValue errorCode = "enforced_spend_limit_reached"
class ErrorDetails: union
class ErrorObject: union
class ErrorResponse { type = "error"; error; requestId; }
JsonValue type = "error"
One of the following:
Optional<String> requestId
enum ErrorType
INVALID_REQUEST_ERROR("invalid_request_error")
AUTHENTICATION_ERROR("authentication_error")
BILLING_ERROR("billing_error")
PERMISSION_ERROR("permission_error")
NOT_FOUND_ERROR("not_found_error")
RATE_LIMIT_ERROR("rate_limit_error")
TIMEOUT_ERROR("timeout_error")
API_ERROR("api_error")
OVERLOADED_ERROR("overloaded_error")
MEMORY_PRECONDITION_FAILED_ERROR("memory_precondition_failed_error")
MEMORY_PATH_CONFLICT_ERROR("memory_path_conflict_error")
CONFLICT_ERROR("conflict_error")
class GatewayTimeoutError { type = "timeout_error"; message; }
JsonValue type = "timeout_error"

The broad category of the error.

String message

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

class InvalidRequestError { type = "invalid_request_error"; message; }
JsonValue type = "invalid_request_error"

The broad category of the error.

String message

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

class LinkedOrganizationBillingUnavailableErrorDetails { errorCode; }
JsonValue errorCode = "linked_organization_billing_unavailable"
class LinkedOrganizationSpendLimitReachedErrorDetails { errorCode; }
JsonValue errorCode = "linked_organization_spend_limit_reached"
class NotFoundError { type = "not_found_error"; message; }
JsonValue type = "not_found_error"

The broad category of the error.

String message

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

class OrganizationOnHoldErrorDetails { errorCode; appealUrl; }
JsonValue errorCode = "organization_on_hold"
Optional<String> appealUrl
class OrganizationTypeNotSupportedErrorDetails { errorCode; }
JsonValue errorCode = "organization_type_not_supported"
class OverloadedError { type = "overloaded_error"; message; }
JsonValue type = "overloaded_error"

The broad category of the error.

String message

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

class ParentOrganizationRequiredErrorDetails { errorCode; }
JsonValue errorCode = "parent_organization_required"
class PermissionError { type = "permission_error"; message; }
JsonValue type = "permission_error"

The broad category of the error.

String message

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

class RampLimitExceededErrorDetails { errorCode; }
JsonValue errorCode = "ramp_limit_exceeded"
class RateLimitError { type = "rate_limit_error"; message; }
JsonValue type = "rate_limit_error"

The broad category of the error.

String message

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

class RequestBodyEncodingInvalidErrorDetails { errorCode; }
JsonValue errorCode = "request_body_encoding_invalid"
class RequestBodyEncodingUnsupportedErrorDetails { errorCode; }
JsonValue errorCode = "request_body_encoding_unsupported"
class RequestBodyTooLargeAfterDecodingErrorDetails { errorCode; }
JsonValue errorCode = "request_body_too_large_after_decoding"
class SandboxEgressRestrictedErrorDetails { errorCode; }
JsonValue errorCode = "sandbox_egress_restricted"
class StorageNotReadyErrorDetails { errorCode; }
JsonValue errorCode = "storage_not_ready"
class WorkspaceHumanReviewDisabledErrorDetails { errorCode; }
JsonValue errorCode = "workspace_human_review_disabled"
Errors
class ClaudeCodeKeyCreatorNotMemberException extends BadRequestException { 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.

JsonValue errorCode = "claude_code_key_creator_not_member"
class ClaudeCodeVersionTooOldException extends BadRequestException { 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.

JsonValue errorCode = "claude_code_version_too_old"
class CmekKeyDisabledException extends BadRequestException { details; }⁠HTTP status 400

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

JsonValue errorCode = "cmek_key_disabled"
class CmekKeyNetworkBlockedException extends BadRequestException { 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.

JsonValue errorCode = "cmek_key_network_blocked"
class OrganizationOnHoldException extends BadRequestException { 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.

JsonValue errorCode = "organization_on_hold"
Optional<String> appealUrl
class OrganizationTypeNotSupportedException extends BadRequestException { details; }⁠HTTP status 400

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

JsonValue errorCode = "organization_type_not_supported"
class ParentOrganizationRequiredException extends BadRequestException { details; }⁠HTTP status 400

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

JsonValue errorCode = "parent_organization_required"
class RequestBodyEncodingInvalidException extends BadRequestException { details; }⁠HTTP status 400

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

JsonValue errorCode = "request_body_encoding_invalid"
class RequestBodyEncodingUnsupportedException extends BadRequestException { details; }⁠HTTP status 400

The request's Content-Encoding is not supported.

JsonValue errorCode = "request_body_encoding_unsupported"
class WorkspaceHumanReviewDisabledException extends BadRequestException { 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.

JsonValue errorCode = "workspace_human_review_disabled"
class LinkedOrganizationBillingUnavailableException extends PaymentRequiredException { 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.

JsonValue errorCode = "linked_organization_billing_unavailable"
class LinkedOrganizationSpendLimitReachedException extends PaymentRequiredException { 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.

JsonValue errorCode = "linked_organization_spend_limit_reached"
class SandboxEgressRestrictedException extends PermissionDeniedException { 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.

JsonValue errorCode = "sandbox_egress_restricted"
class RequestBodyTooLargeAfterDecodingException extends ContentTooLargeException { details; }⁠HTTP status 413

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

JsonValue errorCode = "request_body_too_large_after_decoding"
class ContractSpendLimitReachedException extends RateLimitException { details; }⁠HTTP status 429

The organization has reached the spend limit of its contract.

JsonValue errorCode = "contract_spend_limit_reached"
class EnforcedSpendLimitReachedException extends RateLimitException { details; }⁠HTTP status 429

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

JsonValue errorCode = "enforced_spend_limit_reached"
class RampLimitExceededException extends RateLimitException { 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.

JsonValue errorCode = "ramp_limit_exceeded"
class CmekContextUnavailableException extends ServiceUnavailableException { details; }⁠HTTP status 503

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

JsonValue errorCode = "cmek_context_unavailable"
class CmekKeyUnreachableException extends ServiceUnavailableException { 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.

JsonValue errorCode = "cmek_key_unreachable"
class StorageNotReadyException extends ServiceUnavailableException { details; }⁠HTTP status 503

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

JsonValue errorCode = "storage_not_ready"