Errors

Error response format and common HTTP status codes.


Error response shape

All error responses follow a consistent JSON structure with a human-readable message and a machine-readable code.

{
  "error": {
    "message": "Human-readable error message",
    "code": "machine_readable_code"
  }
}

HTTP status codes

HTTP statusCodeMeaning
400validation_errorInvalid request body or parameters.
400bad_requestRequest was syntactically valid but cannot be processed.
400unknown_projectX-Wonda-Project names a project that does not exist in the active personal or org scope.
401unauthorizedMissing or invalid API key.
402payment_requiredPayment required.
402insufficient_creditsNot enough credits to complete the request.
403forbiddenThe account cannot access the resource or action.
403feature_disabledA feature flag or account gate is disabled for this account.
404not_foundResource not found or API not enabled for the account.
409conflictRequest conflicts with the current state of the resource.
409project_existsA project with that normalized name already exists in the active scope.
410goneEndpoint or operation has been retired. The response message may include a migration hint.
429rate_limit_exceededToo many requests.
429throttledA safety or action gate blocked the request and may include retry metadata such as deferUntil.
500internal_server_errorInternal server error.

The code field is always present in error responses. A 400 from request validation uses validation_error; other generic 400 errors use bad_request. A 402 uses insufficient_credits when the error message mentions insufficient credits, and payment_required otherwise.

Example

{
  "error": {
    "message": "'model' is required",
    "code": "validation_error"
  }
}