Skip to content

Generations

Generations are AI jobs that produce content for cells and layers. Trigger a generation, poll for completion, and retrieve the output — scripts, voiceovers, images, video clips, and more.

{
"id": 9000,
"status": "completed",
"user_job_type": "text_generation",
"result": "Here is the generated script text...",
"failed_reason": null,
"output_resources": [
{
"id": 1500,
"url": "https://cdn.gen.pro/outputs/abc123.mp4",
"thumbnail_url": "https://cdn.gen.pro/thumbnails/abc123.jpg",
"object_type": "video",
"type": "output"
}
],
"execution_cost": 2.5
}
StatusDescription
pendingJob queued, waiting to be picked up.
processingAI model is actively generating content.
completedGeneration finished successfully. Check result and output_resources.
failedGeneration failed. Check failed_reason.
stoppedManually cancelled. Credits have been refunded.

Triggers an AI generation on a cell.

POST /v1/autocontentengine/{id}/cells/{cell_id}/generate?agent_id={agent_id}
ParameterTypeDescription
idintegerThe sheet ID.
cell_idintegerThe cell ID.
FieldTypeRequiredDescription
generation_typestringYesThe type of content to generate.
dataobjectYesGeneration parameters (model-specific).
{
"generation_id": 9000,
"status": "pending"
}
Terminal window
curl -X POST "https://api.gen.pro/v1/autocontentengine/101/cells/3000/generate?agent_id=42" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{"generation_type": "text_generation", "data": {}}'
const response = await fetch(
"https://api.gen.pro/v1/autocontentengine/101/cells/3000/generate?agent_id=42",
{
method: "POST",
headers: {
"X-API-Key": "your-api-key",
"Content-Type": "application/json",
},
body: JSON.stringify({
generation_type: "text_generation",
data: {},
}),
}
);
const { generation_id, status } = await response.json();

Triggers an AI generation on a specific layer within a cell.

POST /v1/autocontentengine/{id}/cells/{cell_id}/layers/{layer_id}/generate?agent_id={agent_id}
ParameterTypeDescription
idintegerThe sheet ID.
cell_idintegerThe cell ID.
layer_idintegerThe layer ID.

Same as Generate on cell.

{
"generation_id": 9001,
"status": "pending"
}
Terminal window
curl -X POST "https://api.gen.pro/v1/autocontentengine/101/cells/3000/layers/4000/generate?agent_id=42" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{"generation_type": "audio_generation", "data": {}}'

Polls the current status of a generation.

GET /v1/generations/{id}
ParameterTypeDescription
idintegerThe generation ID.

Returns the full generation object (see schema above).

Terminal window
curl "https://api.gen.pro/v1/generations/9000" \
-H "X-API-Key: your-api-key"
// Poll until complete
async function waitForGeneration(generationId: string, apiKey: string) {
while (true) {
const res = await fetch(
`https://api.gen.pro/v1/generations/${generationId}`,
{ headers: { "X-API-Key": apiKey } }
);
const gen = await res.json();
if (gen.status === "completed" || gen.status === "failed" || gen.status === "stopped") {
return gen;
}
await new Promise((r) => setTimeout(r, 3000)); // poll every 3s
}
}

Cancels a running generation. Credits are refunded.

POST /v1/generations/{id}/stop
ParameterTypeDescription
idintegerThe generation ID.

Returns the updated generation with status: "stopped".

Terminal window
curl -X POST "https://api.gen.pro/v1/generations/9000/stop" \
-H "X-API-Key: your-api-key"

Resumes a previously stopped generation. Credits are re-charged.

POST /v1/generations/{id}/continue
ParameterTypeDescription
idintegerThe generation ID.

Returns the updated generation with status: "pending".

Terminal window
curl -X POST "https://api.gen.pro/v1/generations/9000/continue" \
-H "X-API-Key: your-api-key"
StatusError codeDescription
404not_foundGeneration not found.
422validation_errorGeneration cannot be stopped/continued in its current state.