---
title: Shared
url: https://platform.claude.com/docs/en/api/go/$shared
---

# Shared

## Domain types

### API Error Object

- `type APIErrorObject`

  - `Type APIError`

    The broad category of the error.

    default: api_error

  - `Message string`

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

    default: Internal server error

### Authentication Error

- `type AuthenticationError`

  - `Type AuthenticationError`

    The broad category of the error.

    default: authentication_error

  - `Message string`

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

    default: Authentication error

### Billing Error

- `type BillingError`

  - `Type BillingError`

    The broad category of the error.

    default: billing_error

  - `Message string`

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

    default: Billing error

### Claude Code Key Creator Not Member Error Details

- `type ClaudeCodeKeyCreatorNotMemberErrorDetails`

  - `ErrorCode ClaudeCodeKeyCreatorNotMemberErrorCode`

### Claude Code Version Too Old Error Details

- `type ClaudeCodeVersionTooOldErrorDetails`

  - `ErrorCode ClaudeCodeVersionTooOldErrorCode`

### CMEK Context Unavailable Error Details

- `type CMEKContextUnavailableErrorDetails`

  - `ErrorCode CMEKContextUnavailableErrorCode`

### CMEK Key Disabled Error Details

- `type CMEKKeyDisabledErrorDetails`

  - `ErrorCode CMEKKeyDisabledErrorCode`

### CMEK Key Network Blocked Error Details

- `type CMEKKeyNetworkBlockedErrorDetails`

  - `ErrorCode CMEKKeyNetworkBlockedErrorCode`

### CMEK Key Unreachable Error Details

- `type CMEKKeyUnreachableErrorDetails`

  - `ErrorCode CMEKKeyUnreachableErrorCode`

### Enforced Spend Limit Reached Error Details

- `type EnforcedSpendLimitReachedErrorDetails`

  - `ErrorCode EnforcedSpendLimitReachedErrorCode`

### Error Details

- `type ErrorDetailsUnion interface{…}`

  - `type AvailableToolsLimitExceededErrorDetails`

    The tools available after a message exceed a limit on their number or their size.

    - `ErrorCode AvailableToolsLimitExceededErrorCode`

  - `type ClaudeCodeKeyCreatorNotMemberErrorDetails`

    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 ClaudeCodeKeyCreatorNotMemberErrorCode`

  - `type ClaudeCodeVersionTooOldErrorDetails`

    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 ClaudeCodeVersionTooOldErrorCode`

  - `type CMEKKeyDisabledErrorDetails`

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

    - `ErrorCode CMEKKeyDisabledErrorCode`

  - `type CMEKKeyNetworkBlockedErrorDetails`

    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 CMEKKeyNetworkBlockedErrorCode`

  - `type CompactionBlockAmbiguousErrorDetails`

    `messages` holds more than one `compaction` block with content. Send only the block the conversation returned last.

    - `ErrorCode CompactionBlockAmbiguousErrorCode`

  - `type CompactionBlockMisplacedErrorDetails`

    The `compaction` block is not the first block of the conversation, or is in a `system` message.

    - `ErrorCode CompactionBlockMisplacedErrorCode`

  - `type CompactionContentMismatchErrorDetails`

    The `compaction` block's `content` differs from the text its `signature` recorded.

    - `ErrorCode CompactionContentMismatchErrorCode`

  - `type CompactionIncompleteTurnErrorDetails`

    The compaction request ends on an `assistant` turn that is not finished.

    - `ErrorCode CompactionIncompleteTurnErrorCode`

  - `type CompactionNothingToSummarizeErrorDetails`

    `messages` holds no `user` or `assistant` content to summarize or adopt.

    - `ErrorCode CompactionNothingToSummarizeErrorCode`

  - `type CompactionSignatureInvalidErrorDetails`

    The `compaction` block's `signature` does not verify.

    - `ErrorCode CompactionSignatureInvalidErrorCode`

  - `type CompactionTooManyToolReferencesErrorDetails`

    The conversation references more distinct tools than a `compaction` block can record.

    - `ErrorCode CompactionTooManyToolReferencesErrorCode`

  - `type CompactionToolChangesMismatchErrorDetails`

    The `compaction` block's `tool_changes` differs from what was returned with the block.

    - `ErrorCode CompactionToolChangesMismatchErrorCode`

  - `type OrganizationOnHoldErrorDetails`

    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 OrganizationOnHoldErrorCode`

    - `AppealURL string Optional`

  - `type RequestBodyEncodingInvalidErrorDetails`

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

    - `ErrorCode RequestBodyEncodingInvalidErrorCode`

  - `type RequestBodyEncodingUnsupportedErrorDetails`

    The request's `Content-Encoding` is not supported.

    - `ErrorCode RequestBodyEncodingUnsupportedErrorCode`

  - `type ThreadAlreadyContinuedErrorDetails`

    The response that `previous_message_id` names has already been continued, and each response can be continued only once. Continue from the Thread's most recent response `id`.

    - `ErrorCode ThreadAlreadyContinuedErrorCode`

  - `type ThreadContinueInFlightErrorDetails`

    Another request is still continuing from the same `previous_message_id`. Wait for it to complete and continue from its response `id`, or replay the full conversation with `thread: {"type": "create"}`.

    - `ErrorCode ThreadContinueInFlightErrorCode`

  - `type ThreadFingerprintMismatchErrorDetails`

    A field that must stay the same across a Thread's turns differs from the value stored with the Thread; the message names each such field. Send the stored values, or replay the full conversation with `thread: {"type": "create"}` to change them.

    - `ErrorCode ThreadFingerprintMismatchErrorCode`

  - `type ThreadUnsupportedRequestErrorDetails`

    The request combines `thread` with a request field or an organization setting that Threads do not support; `unsupported`, when present, names it. Send the full conversation without `thread`, or change that field.

    - `ErrorCode ThreadUnsupportedRequestErrorCode`

    - `Unsupported []ThreadUnsupportedFeatureName Optional`

      Each entry names a request field or an organization setting that Threads do not support. On a value you do not recognize, send the full conversation without `thread`.

      - `const ThreadUnsupportedFeatureNameCacheControl ThreadUnsupportedFeatureName = "cache_control"`

      - `const ThreadUnsupportedFeatureNameContextManagement ThreadUnsupportedFeatureName = "context_management"`

      - `const ThreadUnsupportedFeatureNameFallbacks ThreadUnsupportedFeatureName = "fallbacks"`

      - `const ThreadUnsupportedFeatureNameHipaa ThreadUnsupportedFeatureName = "hipaa"`

      - `const ThreadUnsupportedFeatureNameInferenceHooks ThreadUnsupportedFeatureName = "inference_hooks"`

      - `const ThreadUnsupportedFeatureNameThinking ThreadUnsupportedFeatureName = "thinking"`

  - `type ToolNameConflictErrorDetails`

    A tool made available in `messages` takes a name that an available tool of another kind, or of another MCP server, already holds.

    - `ErrorCode ToolNameConflictErrorCode`

  - `type ToolReferenceUnresolvedErrorDetails`

    A tool change or MCP tool listing references a tool or MCP server that is not defined at that position in the conversation.

    - `ErrorCode ToolReferenceUnresolvedErrorCode`

  - `type ThreadNotFoundErrorDetails`

    No usable Thread state was found for `previous_message_id`. Replay the full conversation with `thread: {"type": "create"}` to start a new Thread.

    - `ErrorCode ThreadNotFoundErrorCode`

  - `type SkillReadBlockedUndecryptableErrorDetails`

    A custom skill the request names is stored under an encryption key state the workspace cannot currently decrypt.

    - `ErrorCode SkillReadBlockedUndecryptableErrorCode`

  - `type RequestBodyTooLargeAfterDecodingErrorDetails`

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

    - `ErrorCode RequestBodyTooLargeAfterDecodingErrorCode`

  - `type EnforcedSpendLimitReachedErrorDetails`

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

    - `ErrorCode EnforcedSpendLimitReachedErrorCode`

  - `type RampLimitExceededErrorDetails`

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

    - `ErrorCode RampLimitExceededErrorCode`

  - `type CMEKKeyUnreachableErrorDetails`

    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 CMEKKeyUnreachableErrorCode`

  - `type CompactionUnavailableErrorDetails`

    The compaction could not be completed for a transient server reason. Retry the request.

    - `ErrorCode CompactionUnavailableErrorCode`

  - `type StorageQuotaExceededErrorDetails`

    The organization's file storage quota is exhausted. Delete files to free up space, then retry the upload.

    - `ErrorCode StorageQuotaExceededErrorCode`

  - `type FileNotDownloadableErrorDetails`

    The file has `downloadable: false`. Only files generated by a tool, such as the code execution tool, can be downloaded.

    - `ErrorCode FileNotDownloadableErrorCode`

  - `type FileExpiredErrorDetails`

    The file's `expires_at` has passed, so its content is no longer available.

    - `ErrorCode FileExpiredErrorCode`

  - `type CMEKContextUnavailableErrorDetails`

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

    - `ErrorCode CMEKContextUnavailableErrorCode`

  - `type OrgAPIKeyLimitExceededErrorDetails`

    The organization has reached its limit of active API keys.

    - `ErrorCode OrgAPIKeyLimitExceededErrorCode`

  - `type WorkspaceAPIKeyLimitExceededErrorDetails`

    The workspace has reached its limit of active API keys.

    - `ErrorCode WorkspaceAPIKeyLimitExceededErrorCode`

  - `type SandboxEgressRestrictedErrorDetails`

    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.

    - `ErrorCode SandboxEgressRestrictedErrorCode`

  - `type UserProfileNotFoundErrorDetails`

    The request depends on a user profile that does not exist in the organization or is no longer active. The request either names this user profile by ID, or names a resource, such as an External Key, that is bound to it.

    - `ErrorCode UserProfileNotFoundErrorCode`

  - `type ExternalKeyInWorkspacePolicyErrorDetails`

    The External Key can't be deleted or reconfigured while the organization's Workspace Policy lists it as an allowed key.

    - `ErrorCode ExternalKeyInWorkspacePolicyErrorCode`

  - `type AlreadyMemberErrorDetails`

    The email address already belongs to a user in the organization. The message names the user.

    - `ErrorCode AlreadyMemberErrorCode`

  - `type CannotInviteEmailsWithUnverifiedDomainsErrorDetails`

    The email address's domain is not one of the verified domains of the organization's parent organization.

    - `ErrorCode CannotInviteEmailsWithUnverifiedDomainsErrorCode`

  - `type EmailDomainNotAllowedErrorDetails`

    The organization restricts invites to an allowed list of email domains, and the list is empty or does not include the email address's domain.

    - `ErrorCode EmailDomainNotAllowedErrorCode`

  - `type InviteAlreadyExistsErrorDetails`

    A pending invite already exists for the email address. The message names the invite.

    - `ErrorCode InviteAlreadyExistsErrorCode`

  - `type OrgMemberLimitExceededErrorDetails`

    The organization has reached the member limit that Anthropic set for it. Pending invites count toward the limit.

    - `ErrorCode OrgMemberLimitExceededErrorCode`

  - `type RBACGroupGrantsOwnerAccessErrorDetails`

    A role attached to an RBAC Group in the request grants owner access, so this API does not add members to that group (directly or through an invite), remove its members, or delete it. Make the change in the organization's admin settings in Claude.

    - `ErrorCode RBACGroupGrantsOwnerAccessErrorCode`

  - `type RBACGroupOwnerAccessUnconfirmedErrorDetails`

    The API could not finish checking whether an RBAC Group in the request grants owner access, so it made no change. Retrying the same request will not help. Make the change in the organization's admin settings in Claude.

    - `ErrorCode RBACGroupOwnerAccessUnconfirmedErrorCode`

  - `type CannotRemoveLastMemberErrorDetails`

    The user is the organization's only member. Add another member before removing this one.

    - `ErrorCode CannotRemoveLastMemberErrorCode`

  - `type ConcurrentMembershipChangeErrorDetails`

    Another change to the organization's members is in progress. Retry the request once it completes.

    - `ErrorCode ConcurrentMembershipChangeErrorCode`

  - `type ExternalKeyValidationFailedErrorDetails`

    The External Key failed Anthropic's validation, so the request was refused. The message gives the reason, if there is one.

    - `ErrorCode ExternalKeyValidationFailedErrorCode`

  - `type ExternalKeyValidationTimedOutErrorDetails`

    Anthropic's validation of the External Key did not finish in time, so the request was refused. Wait a moment, then send the request again.

    - `ErrorCode ExternalKeyValidationTimedOutErrorCode`

  - `type KeyProfileMismatchErrorDetails`

    The External Key is bound to a user profile, and the Workspace does not have that user profile. A Workspace can use only a key bound to its own user profile or a key that isn't bound to one.

    - `ErrorCode KeyProfileMismatchErrorCode`

  - `type WorkspacePolicyViolationErrorDetails`

    The request breaks the organization's Workspace Policy. The message says which rule it broke; an organization admin can see and change the policy in the Console.

    - `ErrorCode WorkspacePolicyViolationErrorCode`

    - `Field WorkspacePolicyField`

      The request field the broken rule applies to.

  - `type ExternalKeyChangedErrorDetails`

    The external key changed while the request was validating it. Send the request again.

    - `ErrorCode ExternalKeyChangedErrorCode`

  - `type WorkspaceMemberLimitExceededErrorDetails`

    The workspace has reached the member limit that Anthropic set for it.

    - `ErrorCode WorkspaceMemberLimitExceededErrorCode`

  - `type OrganizationTypeNotSupportedErrorDetails`

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

    - `ErrorCode OrganizationTypeNotSupportedErrorCode`

  - `type ParentOrganizationRequiredErrorDetails`

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

    - `ErrorCode ParentOrganizationRequiredErrorCode`

  - `type RBACRoleNotFoundErrorDetails`

    No RBAC Role with this ID was found.

    - `ErrorCode RBACRoleNotFoundErrorCode`

  - `type BetaEnvironmentCreateDisabledErrorDetails`

    Anthropic has turned off creating environments for this organization. Existing environments still work.

    - `ErrorCode BetaEnvironmentCreateDisabledErrorCode`

  - `type BetaEnvironmentArchivedErrorDetails`

    The environment is archived, so it cannot be updated.

    - `ErrorCode BetaEnvironmentArchivedErrorCode`

  - `type BetaInvalidConfigTypeChangeErrorDetails`

    `config.type` differs from the environment's stored type, which cannot change after creation.

    - `ErrorCode BetaInvalidConfigTypeChangeErrorCode`

  - `type BetaEnvironmentUpdateDisabledErrorDetails`

    Anthropic has turned off updating environments for this organization. Existing environments still work as they are.

    - `ErrorCode BetaEnvironmentUpdateDisabledErrorCode`

  - `type BetaHeartbeatPreconditionFailedErrorDetails`

    `expected_last_heartbeat` does not match the stored heartbeat, so another worker may hold the lease.

    - `CurrentState BetaWorkLeaseState`

      The lease as the server holds it.

      - `LastHeartbeat string`

        RFC 3339 timestamp of the stored heartbeat, or null if there has been none

      - `LeaseExtended bool`

        Always false: a refused heartbeat does not extend the lease

      - `State BetaWorkLeaseStateState`

        Current state of the work item

        - `const BetaWorkLeaseStateStateQueued BetaWorkLeaseStateState = "queued"`

        - `const BetaWorkLeaseStateStateStarting BetaWorkLeaseStateState = "starting"`

        - `const BetaWorkLeaseStateStateActive BetaWorkLeaseStateState = "active"`

        - `const BetaWorkLeaseStateStateStopping BetaWorkLeaseStateState = "stopping"`

        - `const BetaWorkLeaseStateStateStopped BetaWorkLeaseStateState = "stopped"`

      - `TTLSeconds int64`

        TTL of the lease

    - `ErrorCode BetaHeartbeatPreconditionFailedErrorCode`

  - `type BetaInvalidMetadataErrorDetails`

    `metadata` has too many keys, a key or value that is too long, or a reserved key. The message names each problem.

    - `ErrorCode BetaInvalidMetadataErrorCode`

  - `type BetaCannotSignOutPrimaryOwnerErrorDetails`

    The member is the organization's primary owner, whom no API key or token can sign out.

    - `ErrorCode BetaCannotSignOutPrimaryOwnerErrorCode`

  - `type BetaCannotSignOutSelfErrorDetails`

    The member is the user the API key or token belongs to.

    - `ErrorCode BetaCannotSignOutSelfErrorCode`

  - `type BetaOrganizationNotEnrolledInBetaErrorDetails`

    The beta that the endpoint requires is not enabled for the organization. The message names the beta value.

    - `ErrorCode BetaOrganizationNotEnrolledInBetaErrorCode`

  - `type BetaCannotSignOutManagedMemberErrorDetails`

    The member has the `managed` role, and this API key or token cannot sign them out. The error message says which keys and tokens can.

    - `ErrorCode BetaCannotSignOutManagedMemberErrorCode`

  - `type BetaCannotSignOutMembershipAdminErrorDetails`

    The member is a membership admin, and the person the API key or token belongs to is not allowed to sign out membership admins.

    - `ErrorCode BetaCannotSignOutMembershipAdminErrorCode`

  - `type BetaCannotSignOutOwnerErrorDetails`

    The member is an owner or has owner permissions, and this API key or token cannot sign them out. In a Claude Enterprise organization, an API key with the `write:members` scope can.

    - `ErrorCode BetaCannotSignOutOwnerErrorCode`

  - `type BetaCannotSignOutPrivilegedMemberErrorDetails`

    This OAuth token cannot sign out a membership admin or a member whose roles grant owner, user management, or identity and access management.

    - `ErrorCode BetaCannotSignOutPrivilegedMemberErrorCode`

  - `type BetaSpendLimitsAdminAPIWritesNotEnabledErrorDetails`

    The organization cannot retrieve, set or delete spend limits with an Admin API credential.

    - `ErrorCode BetaSpendLimitsAdminAPIWritesNotEnabledErrorCode`

  - `type BetaUnsupportedCharsetErrorDetails`

    The request's `Content-Type` header names a charset other than UTF-8, ISO-8859-1 or US-ASCII. Send the request with no charset, or with one of these.

    - `ErrorCode BetaUnsupportedCharsetErrorCode`

  - `type BetaPluginNameTakenErrorDetails`

    The marketplace already holds this name. `plugin_id` is the Plugin that holds it, and can be absent.

    - `ErrorCode BetaPluginNameTakenErrorCode`

    - `PluginID string Optional`

  - `type BetaSkillNameTakenErrorDetails`

    One of the Plugin's skills has the name of an organization skill. `skill_name` is that name.

    - `ErrorCode BetaSkillNameTakenErrorCode`

    - `SkillName string`

  - `type BetaRegistrationPendingErrorDetails`

    The Plugin version was stored but is not yet usable in claude.ai. `plugin_id` and `plugin_version_id` identify what was stored.

    - `ErrorCode BetaRegistrationPendingErrorCode`

    - `PluginID string`

    - `PluginVersionID string`

  - `type BetaScanFailedErrorDetails`

    The version in `plugin_version_id` did not pass its content scan, so it cannot be served.

    - `ErrorCode BetaScanFailedErrorCode`

    - `PluginVersionID string`

  - `type BetaScanPendingErrorDetails`

    The content scan of the version in `plugin_version_id` is still running. Retry once the scan finishes.

    - `ErrorCode BetaScanPendingErrorCode`

    - `PluginVersionID string`

  - `type BetaSlackChannelSetUpSettingsRefusedErrorDetails`

    The request set the channel up, and `settings` was then refused. The channel stays set up with every setting unset.

    - `ErrorCode BetaSlackChannelSetUpSettingsRefusedErrorCode`

      A stable code that names the cause.

    - `SlackChannelID string`

      The identifier of the channel the request set up, starting with `slch_`.

  - `type BetaAPIKeyScopeMissingErrorDetails`

    The API key lacks the scope the request needs: `read:claude_tag` for a read, `write:claude_tag` for a change.

    - `ErrorCode BetaAPIKeyScopeMissingErrorCode`

  - `type BetaClaudeTagWritesNotEnabledErrorDetails`

    Changes through the Claude Tag API are not enabled for the organization.

    - `ErrorCode BetaClaudeTagWritesNotEnabledErrorCode`

  - `type BetaComplianceConfigurationRestrictedErrorDetails`

    The organization's compliance configuration does not let Claude Tag store anything new.

    - `ErrorCode BetaComplianceConfigurationRestrictedErrorCode`

  - `type BetaOrganizationLevelScopedAPIKeyRequiredErrorDetails`

    The credential is not a scoped API key that is bound at the organization level.

    - `ErrorCode BetaOrganizationLevelScopedAPIKeyRequiredErrorCode`

  - `type BetaEnvironmentNotFoundErrorDetails`

    `settings.environment_id` names no Environment within the organization's reach.

    - `ErrorCode BetaEnvironmentNotFoundErrorCode`

  - `type BetaSlackChannelSetUpEnvironmentNotFoundErrorDetails`

    `settings.environment_id` names no Environment within the organization's reach, and the request had set the channel up by then. The channel stays set up with every setting unset.

    - `ErrorCode BetaSlackChannelSetUpEnvironmentNotFoundErrorCode`

    - `SlackChannelID string`

      The identifier of the channel the request set up, starting with `slch_`.

  - `type BetaSlackChannelSetUpSettingsConflictErrorDetails`

    The request set the channel up, and something else then changed the channel or removed it. Nothing of `settings` was stored.

    - `ErrorCode BetaSlackChannelSetUpSettingsConflictErrorCode`

      A stable code that names the cause.

    - `SlackChannelID string`

      The identifier of the channel the request set up, starting with `slch_`.

### Error Object

- `type ErrorObjectUnion interface{…}`

  - `type InvalidRequestError`

    - `Type InvalidRequestError`

      The broad category of the error.

      default: invalid_request_error

    - `Message string`

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

      default: Invalid request

  - `type AuthenticationError`

    - `Type AuthenticationError`

      The broad category of the error.

      default: authentication_error

    - `Message string`

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

      default: Authentication error

  - `type BillingError`

    - `Type BillingError`

      The broad category of the error.

      default: billing_error

    - `Message string`

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

      default: Billing error

  - `type PermissionError`

    - `Type PermissionError`

      The broad category of the error.

      default: permission_error

    - `Message string`

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

      default: Permission denied

  - `type NotFoundError`

    - `Type NotFoundError`

      The broad category of the error.

      default: not_found_error

    - `Message string`

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

      default: Not found

  - `type RateLimitError`

    - `Type RateLimitError`

      The broad category of the error.

      default: rate_limit_error

    - `Message string`

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

      default: Rate limited

  - `type GatewayTimeoutError`

    - `Type TimeoutError`

      The broad category of the error.

      default: timeout_error

    - `Message string`

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

      default: Request timeout

  - `type APIErrorObject`

    - `Type APIError`

      The broad category of the error.

      default: api_error

    - `Message string`

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

      default: Internal server error

  - `type OverloadedError`

    - `Type OverloadedError`

      The broad category of the error.

      default: overloaded_error

    - `Message string`

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

      default: Overloaded

### Error Response

- `type ErrorResponse`

  - `Type Error`

    default: error

  - `Error ErrorObjectUnion`

    - `type InvalidRequestError`

      - `Type InvalidRequestError`

        The broad category of the error.

        default: invalid_request_error

      - `Message string`

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

        default: Invalid request

    - `type AuthenticationError`

      - `Type AuthenticationError`

        The broad category of the error.

        default: authentication_error

      - `Message string`

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

        default: Authentication error

    - `type BillingError`

      - `Type BillingError`

        The broad category of the error.

        default: billing_error

      - `Message string`

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

        default: Billing error

    - `type PermissionError`

      - `Type PermissionError`

        The broad category of the error.

        default: permission_error

      - `Message string`

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

        default: Permission denied

    - `type NotFoundError`

      - `Type NotFoundError`

        The broad category of the error.

        default: not_found_error

      - `Message string`

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

        default: Not found

    - `type RateLimitError`

      - `Type RateLimitError`

        The broad category of the error.

        default: rate_limit_error

      - `Message string`

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

        default: Rate limited

    - `type GatewayTimeoutError`

      - `Type TimeoutError`

        The broad category of the error.

        default: timeout_error

      - `Message string`

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

        default: Request timeout

    - `type APIErrorObject`

      - `Type APIError`

        The broad category of the error.

        default: api_error

      - `Message string`

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

        default: Internal server error

    - `type OverloadedError`

      - `Type OverloadedError`

        The broad category of the error.

        default: overloaded_error

      - `Message string`

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

        default: Overloaded

  - `RequestID string`

### Error Type

- `type ErrorType string`

  - `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"`

### Gateway Timeout Error

- `type GatewayTimeoutError`

  - `Type TimeoutError`

    The broad category of the error.

    default: timeout_error

  - `Message string`

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

    default: Request timeout

### Invalid Request Error

- `type InvalidRequestError`

  - `Type InvalidRequestError`

    The broad category of the error.

    default: invalid_request_error

  - `Message string`

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

    default: Invalid request

### Not Found Error

- `type NotFoundError`

  - `Type NotFoundError`

    The broad category of the error.

    default: not_found_error

  - `Message string`

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

    default: Not found

### Organization On Hold Error Details

- `type OrganizationOnHoldErrorDetails`

  - `ErrorCode OrganizationOnHoldErrorCode`

  - `AppealURL string Optional`

### Organization Type Not Supported Error Details

- `type OrganizationTypeNotSupportedErrorDetails`

  - `ErrorCode OrganizationTypeNotSupportedErrorCode`

### Overloaded Error

- `type OverloadedError`

  - `Type OverloadedError`

    The broad category of the error.

    default: overloaded_error

  - `Message string`

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

    default: Overloaded

### Parent Organization Required Error Details

- `type ParentOrganizationRequiredErrorDetails`

  - `ErrorCode ParentOrganizationRequiredErrorCode`

### Permission Error

- `type PermissionError`

  - `Type PermissionError`

    The broad category of the error.

    default: permission_error

  - `Message string`

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

    default: Permission denied

### Ramp Limit Exceeded Error Details

- `type RampLimitExceededErrorDetails`

  - `ErrorCode RampLimitExceededErrorCode`

### Rate Limit Error

- `type RateLimitError`

  - `Type RateLimitError`

    The broad category of the error.

    default: rate_limit_error

  - `Message string`

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

    default: Rate limited

### Request Body Encoding Invalid Error Details

- `type RequestBodyEncodingInvalidErrorDetails`

  - `ErrorCode RequestBodyEncodingInvalidErrorCode`

### Request Body Encoding Unsupported Error Details

- `type RequestBodyEncodingUnsupportedErrorDetails`

  - `ErrorCode RequestBodyEncodingUnsupportedErrorCode`

### Request Body Too Large After Decoding Error Details

- `type RequestBodyTooLargeAfterDecodingErrorDetails`

  - `ErrorCode RequestBodyTooLargeAfterDecodingErrorCode`

### Sandbox Egress Restricted Error Details

- `type SandboxEgressRestrictedErrorDetails`

  - `ErrorCode SandboxEgressRestrictedErrorCode`

## Errors

### ErrorCodeClaudeCodeKeyCreatorNotMember

HTTP status 400, error code `claude_code_key_creator_not_member`

- `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.

### ErrorCodeClaudeCodeVersionTooOld

HTTP status 400, error code `claude_code_version_too_old`

- `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.

### ErrorCodeCMEKKeyDisabled

HTTP status 400, error code `cmek_key_disabled`

- `const ErrorCodeCMEKKeyDisabled ErrorCode = "cmek_key_disabled"`

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

### ErrorCodeCMEKKeyNetworkBlocked

HTTP status 400, error code `cmek_key_network_blocked`

- `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.

### ErrorCodeOrganizationOnHold

HTTP status 400, error code `organization_on_hold`

- `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.

### ErrorCodeOrganizationTypeNotSupported

HTTP status 400, error code `organization_type_not_supported`

- `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.

### ErrorCodeParentOrganizationRequired

HTTP status 400, error code `parent_organization_required`

- `const ErrorCodeParentOrganizationRequired ErrorCode = "parent_organization_required"`

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

### ErrorCodeRequestBodyEncodingInvalid

HTTP status 400, error code `request_body_encoding_invalid`

- `const ErrorCodeRequestBodyEncodingInvalid ErrorCode = "request_body_encoding_invalid"`

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

### ErrorCodeRequestBodyEncodingUnsupported

HTTP status 400, error code `request_body_encoding_unsupported`

- `const ErrorCodeRequestBodyEncodingUnsupported ErrorCode = "request_body_encoding_unsupported"`

  The request's `Content-Encoding` is not supported.

### ErrorCodeSandboxEgressRestricted

HTTP status 403, error code `sandbox_egress_restricted`

- `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.

### ErrorCodeRequestBodyTooLargeAfterDecoding

HTTP status 413, error code `request_body_too_large_after_decoding`

- `const ErrorCodeRequestBodyTooLargeAfterDecoding ErrorCode = "request_body_too_large_after_decoding"`

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

### ErrorCodeEnforcedSpendLimitReached

HTTP status 429, error code `enforced_spend_limit_reached`

- `const ErrorCodeEnforcedSpendLimitReached ErrorCode = "enforced_spend_limit_reached"`

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

### ErrorCodeRampLimitExceeded

HTTP status 429, error code `ramp_limit_exceeded`

- `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.

### ErrorCodeCMEKContextUnavailable

HTTP status 503, error code `cmek_context_unavailable`

- `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.

### ErrorCodeCMEKKeyUnreachable

HTTP status 503, error code `cmek_key_unreachable`

- `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.
