Operations

Errors

Every error from the REST API and the MCP server has the same shape and a stable code. Branch on code, show message and hint to people.
422 Unprocessable Entity
{
  "error": {
    "code": "MODERATION_SEXUAL_CONTENT",
    "message": "Your prompt was blocked because it describes sexual content or nudity (nude). Sexual content isn't allowed on PixwellAI.",
    "hint": "Remove the highlighted words and describe clothing, setting and mood instead. You were not charged.",
    "matched": ["nude"]
  }
}

Error fields

codestringrequired
Stable identifier from the table below.
messagestringrequired
Human-readable explanation. Wording may change.
hintstring
What to change to make the request succeed.
fieldstring
The offending input, e.g. params.duration, for INVALID_INPUT.
matchedstring[]
Words that triggered a moderation block.
refundedboolean
On a generation's error: whether its credits were returned.

Content policy and moderation#

Sexual content is forbidden on PixwellAI: nudity, sexual acts and sexualised depictions, in any language and in any input (prompt, uploaded image or generated result). Anything sexualising or endangering minors is blocked and logged for review. These rules apply equally to the web app, the API and MCP, and there is no flag to disable them.

  • Blocked requests are never charged. A prompt or input that fails moderation is rejected with 422 before any credits move.
  • Failed generations are refunded. If a model fails, or its output is blocked after generation, the generation ends as failed or moderated and its credits are returned automatically with error.refunded: true.
  • Repeated attempts to get around the filter can lead to key revocation.
422MODERATION_SEXUAL_CONTENT
Sexual content blocked. Prompts describing nudity or sexual acts are never allowed. You are not charged.
422MODERATION_MINOR_SAFETY
Minor safety. Content sexualising or endangering minors is blocked and logged.
422MODERATION_INPUT_FLAGGED
Input image blocked. An uploaded file was flagged as sexual content. You are not charged.
422MODERATION_OUTPUT_FLAGGED
Result blocked. The result was flagged by our safety filter and removed. Credits were refunded.

Do not retry moderation errors unchanged

The same input will be blocked again. Show the hint and matched words to the user and let them rephrase.

All other codes#

401UNAUTHORIZED
Not signed in. Missing or invalid session / API key.
403FORBIDDEN
Not allowed. Your team role does not allow this action.
404NOT_FOUND
Not found. The resource does not exist or you cannot see it.
400INVALID_INPUT
Invalid input. A field is missing or out of range. `field` tells you which.
429RATE_LIMITED
Too many requests. Slow down and retry after a few seconds.
402MEMBER_LIMIT_REACHED
Spending limit reached. Your personal credit limit in this workspace does not cover this generation.
402INSUFFICIENT_CREDITS
Not enough credits. Your team balance is lower than the cost of this generation.
404MODEL_UNAVAILABLE
Model unavailable. The model is disabled or does not exist.
404TEMPLATE_UNAVAILABLE
Template unavailable. The template is disabled or does not exist.
413UPLOAD_TOO_LARGE
File too large. Images up to 20 MB, videos up to 200 MB, audio up to 50 MB.
415UPLOAD_UNSUPPORTED_TYPE
Unsupported file. Use JPG, PNG, WEBP, MP4, MOV, WEBM, MP3 or WAV.
502GENERATION_FAILED
Generation failed. The model could not complete the job. Credits were refunded.
503PROVIDER_BUSY
Capacity reached. Models are at capacity. Retry shortly. Nothing was charged.
402PLAN_REQUIRED
Upgrade required. This model or template needs a paid plan.
402SEAT_LIMIT
Seat limit. Your plan has no free seats. Upgrade to invite more members.
500INTERNAL
Something went wrong. Unexpected error. It has been logged.

Retrying#

  • Safe to retry with backoff: RATE_LIMITED (honour Retry-After), PROVIDER_BUSY, INTERNAL.
  • Fix the request first: INVALID_INPUT, MODEL_UNAVAILABLE, TEMPLATE_UNAVAILABLE, upload errors and all MODERATION_* codes.
  • Account action needed: INSUFFICIENT_CREDITS, MEMBER_LIMIT_REACHED, PLAN_REQUIRED, FORBIDDEN, UNAUTHORIZED. See Authentication.

POST /api/v1/generations is not idempotent: a retried request after a timeout can create a second generation. Before retrying, check GET /api/v1/generations?limit=5.