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.{
"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
codestringrequiredStable identifier from the table below.
messagestringrequiredHuman-readable explanation. Wording may change.
hintstringWhat to change to make the request succeed.
fieldstringThe offending input, e.g.
params.duration, for INVALID_INPUT.matchedstring[]Words that triggered a moderation block.
refundedbooleanOn 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
422before any credits move. - Failed generations are refunded. If a model fails, or its output is blocked after generation, the generation ends as
failedormoderatedand its credits are returned automatically witherror.refunded: true. - Repeated attempts to get around the filter can lead to key revocation.
422
MODERATION_SEXUAL_CONTENTSexual content blocked. Prompts describing nudity or sexual acts are never allowed. You are not charged.
422
MODERATION_MINOR_SAFETYMinor safety. Content sexualising or endangering minors is blocked and logged.
422
MODERATION_INPUT_FLAGGEDInput image blocked. An uploaded file was flagged as sexual content. You are not charged.
422
MODERATION_OUTPUT_FLAGGEDResult 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 thehint and matched words to the user and let them rephrase.All other codes#
401
UNAUTHORIZEDNot signed in. Missing or invalid session / API key.
403
FORBIDDENNot allowed. Your team role does not allow this action.
404
NOT_FOUNDNot found. The resource does not exist or you cannot see it.
400
INVALID_INPUTInvalid input. A field is missing or out of range. `field` tells you which.
429
RATE_LIMITEDToo many requests. Slow down and retry after a few seconds.
402
MEMBER_LIMIT_REACHEDSpending limit reached. Your personal credit limit in this workspace does not cover this generation.
402
INSUFFICIENT_CREDITSNot enough credits. Your team balance is lower than the cost of this generation.
404
MODEL_UNAVAILABLEModel unavailable. The model is disabled or does not exist.
404
TEMPLATE_UNAVAILABLETemplate unavailable. The template is disabled or does not exist.
413
UPLOAD_TOO_LARGEFile too large. Images up to 20 MB, videos up to 200 MB, audio up to 50 MB.
415
UPLOAD_UNSUPPORTED_TYPEUnsupported file. Use JPG, PNG, WEBP, MP4, MOV, WEBM, MP3 or WAV.
502
GENERATION_FAILEDGeneration failed. The model could not complete the job. Credits were refunded.
503
PROVIDER_BUSYCapacity reached. Models are at capacity. Retry shortly. Nothing was charged.
402
PLAN_REQUIREDUpgrade required. This model or template needs a paid plan.
402
SEAT_LIMITSeat limit. Your plan has no free seats. Upgrade to invite more members.
500
INTERNALSomething went wrong. Unexpected error. It has been logged.
Retrying#
- Safe to retry with backoff:
RATE_LIMITED(honourRetry-After),PROVIDER_BUSY,INTERNAL. - Fix the request first:
INVALID_INPUT,MODEL_UNAVAILABLE,TEMPLATE_UNAVAILABLE, upload errors and allMODERATION_*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.