Skip to content

Errors

Pixapi uses HTTP status codes plus machine-readable error types.

Error shape

json
{
  "error": {
    "code": 400,
    "message": "xxx",
    "type": "invalid_request_error"
  }
}

Common errors

HTTP statusTypeMeaning
400invalid_request_errorMissing or invalid request field.
401unauthorizedMissing or invalid API key.
402insufficient_creditsThe account does not have enough credits.
404model_not_foundThe model id is unknown or unavailable.
422prompt_rejectedThe prompt or input violates model policy.
429rate_limitedToo many requests in a short period.
500internal_errorUnexpected server error.
503model_unavailableProvider is temporarily unavailable.

Retry guidance

Retry only transient errors:

  • 429 rate_limited
  • 500 internal_error
  • 503 model_unavailable

Use exponential backoff and avoid retrying 400, 401, 402, or 422 responses without changing the request, key, or account state.