Queues the generation of an AI image for the eBook. Asynchronous, returns a job_id.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
POST /aiworkflow/image
Queues the generation of one AI image for the eBook — typically a chapter illustration. The call is asynchronous: it returns 202 with a job_id, and the state is tracked with GET /aiworkflow/image/{job_id}.
Consumes AI credits. If the job ends in ERROR, the credit is refunded.
AuthorizationRequires the account API key in the
Authorizationheader, without theBearerprefix.
HTTP Method & Path
POST /aiworkflow/image
Base URL: https://api-v2.pandavideo.com.br
Authentication Requirements
| Item | Value |
|---|---|
| Security Scheme | API Key |
| Header | Authorization |
| Format | The raw key, without Bearer |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Authorization | header | string | Yes | Account API key |
Request Body
Content-Type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Description of the image to generate |
video_id | string (uuid) | Yes | Video the eBook belongs to |
lang | string | No | Language of the eBook the image goes into |
chapter | integer | No | Chapter the image illustrates |
reference_images | array of string | No | Up to 5 storage paths used as visual reference |
{
"prompt": "A cold night in an expensive chalet with a broken heater",
"video_id": "{video_id}",
"lang": "en",
"chapter": 1
}
reference_imagesaccepts at most 5 paths, and every one of them must be under your own user prefix. A path from another account is rejected.
Generation modelThe model is chosen by the service — there is no parameter to select it. This keeps the integration stable when the default model is updated.
Response
Success Response (202)
{ "job_id": "{job_id}", "status": "QUEUED" }| Field | Type | Content |
|---|---|---|
job_id | string | Job identifier — use it in GET /aiworkflow/image/{job_id} |
status | string | QUEUED at creation time |
202means queued, not ready. The image only exists once the job reachesSUCCESS.
Error Responses
400: invalid payload, more than 5 reference images, or a reference path outside your prefix.401: missing or invalid API key.402: not enough AI credits.500: internal error.
Alternative — upload your own image
To use an image you already have instead of generating one, see Upload an eBook PDF — the upload_abstract_image_url action returns a signed URL for the upload.
Example Usage
cURL
curl -X POST "https://api-v2.pandavideo.com.br/aiworkflow/image" \
-H "Authorization: {api_key}" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A cold night in an expensive chalet with a broken heater",
"video_id": "{video_id}",
"lang": "en",
"chapter": 1
}' 401Missing or invalid API key.
402Not enough AI credits.
