POST /v2/generate · /v2/extend · /v2/upload-cover/generateAll modelsRejected requests return 422 or 500 and are refunded immediately
The create endpoints now report validation rejections synchronously and refund the credits, instead of returning 200 with a task that never completes.
What changed
- 422 means a request parameter was rejected during validation; the message names the field to fix (for example title or extensionStartTime).
- 500 means a temporary failure; retry later.
- Both responses include data.task_id, data.refunded and workId, and the task is marked FAILED.
- Tasks that fail after being accepted, including extensions, are marked FAILED with a fail_message and their credits are refunded automatically.
- Previously such requests returned 200 and the task stayed IN_PROGRESS indefinitely.
Integration impact
Handle 422 by fixing the listed parameter and 500 by retrying later. Both responses include data.refunded.