JsonCutDocs
V2 APIEndpointsGeneration

Generate an image, video, music or sound

Start an AI generation; the result lands in the project media. Credits are reserved now and settled when it ends (released when it fails). wait (seconds, up to 25) answers with the finished generation when it is done by then; otherwise 202 with its status: poll GET /projects/{id}/generations/{operationId}. Required API key scopes: `projects:read`, `media:write`.

POST
/api/v2/projects/{id}/generations

Authorization

apiKeyAuth

Path Parameters

id*string

Resource identifier

Query Parameters

wait?integer

Seconds to wait for the result

Range0 <= value <= 25

Request Body

application/json

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v2/projects/string/generations" \  -H "Content-Type: application/json" \  -d '{    "kind": "image",    "prompt": "A pumpkin field at golden hour, wide shot",    "aspectRatio": "3:2"  }'
{  "success": true,  "data": {    "id": "aiop_01J",    "projectId": "project_01J",    "kind": "image",    "status": "completed",    "model": "openai/gpt-image-2.6/sunburst",    "prompt": "A pumpkin field at golden hour",    "progress": 100,    "credits": 12,    "media": {      "id": "media_01J",      "name": "pumpkin-field.png",      "kind": "image",      "mimeType": "image/png",      "width": 1536,      "height": 1024    },    "createdAt": "2026-11-11T09:00:00.000Z",    "updatedAt": "2026-11-11T09:00:21.000Z",    "completedAt": "2026-11-11T09:00:21.000Z"  }}