Errors

The API returns errors as JSON with the following shape:

{
  "error": {
    "code": "validation_failed",
    "message": "Human-readable description",
    "details": { ... }   // optional, structure varies by code
  }
}

Switch on error.code — it is stable across releases. The message string is human-readable only and may change.

400

CodeSummary
invalid_reasonReason text is required and must be at least 10 characters.

401 — Unauthorized

CodeSummary
unauthenticatedRequest lacks valid authentication.
invalid_api_keyThe presented Bearer token is not a valid, active API key.
session_auth_requiredEndpoint requires a user session; API keys are rejected here.

402 — Payment Required

CodeSummary
quota_exceededOrg has exhausted its render quota for the current billing period.

403 — Forbidden

CodeSummary
forbiddenCaller is authenticated but lacks permission for this action.
no_orgAuthenticated user has no organization membership.
feature_disabledFeature is not enabled for this org.

404 — Not Found

CodeSummary
not_foundResource does not exist, was deleted, or is not visible to this org.
org_not_foundThe target organization was not found.

409 — Conflict

CodeSummary
idempotency_conflictThe supplied `Idempotency-Key` was reused with a different request body.
slug_conflictCould not derive a unique slug after 100 attempts.
org_has_stripe_subscriptionCannot comp an org with an active Stripe subscription.
org_has_no_active_compCannot revoke — org has no active comp grant.

413 — Payload Too Large

CodeSummary
context_too_largeAI chat input exceeds the model's context budget.

422 — Unprocessable Entity

CodeSummary
validation_failedRequest body or params failed Zod validation.
user_block_invalid_configUser-block `config` does not match the schema for its `kind`.
parameter_path_invalidA parameter path on a user block must begin with `/`.
brand_kit_music_missingFormat references a brand-kit audio slot, but the brand kit has no uploaded music.
legacy_format_ops_lockedCannot patch `ops` or `openContentPaths` on a legacy-template format.
missing_required_variableA required parameter was not provided in variables.
invalid_variable_typeA provided variable's value doesn't match its parameter's declared type.
parameter_path_staleA parameter's path points at a cell field that no longer exists.
parameter_name_duplicateTwo parameters within the same block share a name.
unknown_variableRequest sent a variable name that is not declared on the format.
variable_ambiguousBare-name variable shortcut matches multiple bindings.
variables_and_overrides_exclusiveRequest body includes both 'variables' and 'contentOverrides'.
duplicate_instance_labelTwo user-block instances in the format share an instanceLabel.
user_block_op_immutableCannot mutate op.content on a user-block instance op post-drop.
unsupported_parameter_fieldField type is not supported for parameter binding.

429 — Too Many Requests

CodeSummary
rate_limit_exceededPer-user or per-org rate limit exceeded.
daily_limit_exceededAI chat daily message cap reached for this user.
retry_too_frequentThumbnail retry throttled — wait 60 seconds.
thumbnail_rate_limit_exceededPer-org thumbnail render rate limit exceeded.

500 — Internal Server Error

CodeSummary
tool_loop_limitAI chat tool-use loop exceeded the max iteration cap.
internal_errorUnhandled server error.

502 — Bad Gateway

CodeSummary
anthropic_api_errorUpstream Anthropic API call failed after retries.

The full interactive reference with per-endpoint error codes is in the API Reference.