Skip to content

Text

Generate text content — scripts, captions, descriptions, and more — using Gemini or OpenAI models. The prompt can include template variables that are substituted from your sheet’s global variables.

POST /v1/autocontentengine/{id}/cells/{cell_id}/generate?agent_id={agent_id}
ParameterTypeDescription
idintegerThe sheet ID.
cell_idintegerThe cell ID.
ParameterTypeDescription
agent_idintegerThe agent ID.

Use canonical generation_type: "text" for new integrations.


FieldTypeRequiredDescription
generation_typestringYes"text".
data.promptstringYesThe text prompt. Supports {{variable_name}} template syntax.
data.modelstringNogemini_2_0_flash, gemini_2_5_pro, gpt_4o, gpt_4o_mini, o3_mini, o4_mini, or claude_sonnet_4.
data.temperaturefloatNoControls randomness. Default 0.2. Range 0.0 - 1.0.
data.max_lengthintegerNoMaximum output length in tokens.
data.prompt_varstringNoVariable name to map the prompt value from a column.

{
"generation_id": 9000,
"status": "pending"
}

Once complete, the generation result contains the generated text in the result field. Poll with GET /v1/generations/{generation_id} to check status.


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",
"data": {
"prompt": "Write a 60-second video script about {{product_name}}. Keep it energetic and include a call to action.",
"model": "gemini_2_5_pro",
"temperature": 0.3,
"max_length": 500
}
}'
{
"id": 9000,
"status": "completed",
"user_job_type": "text",
"result": "Hey everyone! Let me tell you about...",
"failed_reason": null,
"output_resources": [],
"execution_cost": 0.5
}

Set these fields on the cell’s additional_attributes via PATCH /v1/autocontentengine/{id}/cells/{cell_id}:

FieldTypeDescription
textModestring"manual" (user-written text) or "ai" (AI-generated).
autoGeneratebooleanAuto-trigger generation when dependent variables change.

When textMode is "manual", the cell value contains the text directly. When "ai", generation uses the prompt and model from the generation data.