WeGenDocs
Generation API

Errors

Interpret failures without duplicating work or increasing spend.

Read as Markdown ↗

Error envelope

Most API failures use the following shape. Some errors omit code; inspect the HTTP status and safe message as well.

{
  "error": {
    "code": "PRICE_CHANGED",
    "message": "The current price exceeds your requested Gem limit."
  }
}
HTTPCodeWhat to do
401INVALID_API_KEYCheck secret format, expiration, and revocation.
403INSUFFICIENT_SCOPEUse a key with the required scope.
403ACCOUNT_BLOCKED / ACCOUNT_UNAVAILABLEResolve account access or finish account setup.
402API_KEY_LIMITCheck cap and outstanding reservations; do not raise the cap automatically.
402LLM_QUOTA_EXHAUSTEDCheck the account's LLM allowance and paid-Gem settings.
409PRICE_CHANGEDReduce request cost or obtain approval for a higher ceiling.
409IDEMPOTENCY_CONFLICTRestore the original body for this identity; use a new identity only for a distinct authorized request.
409REQUEST_UNCERTAINKeep the original key, body, and identity. Check/replay with backoff; never blindly dispatch a new request.
409REQUEST_FAILEDThe original claim was released. A new authorized generation needs a new identity.
409REFERENCES_PROCESSINGKeep the same identity and check reference readiness.
409ANALYSIS_FAILEDAnalysis could not be parsed; measured usage may already be billed.
404NOT_FOUNDCheck the route/task ID and ownership.
413optional INVALID_REQUESTReduce payload size.
422INVALID_REQUEST / INVALID_REFERENCE / MODEL_UNAVAILABLECheck fields, references, and discovered models.
503WORKFLOW_UNAVAILABLE / PROVIDER_UNAVAILABLE / TEMPORARILY_UNAVAILABLEPreserve the original request identity and apply backoff.

Other canonical generation/policy errors can be returned. Do not bypass account restrictions or moderation by rewriting requests or switching keys. Provider failures can leave uncertain reservations; a 5xx is not permission to resubmit with a new identity.

For support, retain safe IDs, status, code, and timestamps. Exclude bearer keys and signed media URLs from logs. For SSE, inspect in-stream errors and require [DONE] before reporting a complete text result.

On this page