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.
Endpoint
Section titled “Endpoint”POST /v1/autocontentengine/{id}/cells/{cell_id}/generate?agent_id={agent_id}Path parameters
Section titled “Path parameters”| Parameter | Type | Description |
|---|---|---|
id | integer | The sheet ID. |
cell_id | integer | The cell ID. |
Query parameters
Section titled “Query parameters”| Parameter | Type | Description |
|---|---|---|
agent_id | integer | The agent ID. |
Generation Type
Section titled “Generation Type”Use canonical generation_type: "text" for new integrations.
Request body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
generation_type | string | Yes | "text". |
data.prompt | string | Yes | The text prompt. Supports {{variable_name}} template syntax. |
data.model | string | No | gemini_2_0_flash, gemini_2_5_pro, gpt_4o, gpt_4o_mini, o3_mini, o4_mini, or claude_sonnet_4. |
data.temperature | float | No | Controls randomness. Default 0.2. Range 0.0 - 1.0. |
data.max_length | integer | No | Maximum output length in tokens. |
data.prompt_var | string | No | Variable name to map the prompt value from a column. |
Response (201)
Section titled “Response (201)”{ "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.
Example
Section titled “Example”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 } }'Completed generation
Section titled “Completed generation”{ "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}Cell configuration
Section titled “Cell configuration”Set these fields on the cell’s additional_attributes via PATCH /v1/autocontentengine/{id}/cells/{cell_id}:
| Field | Type | Description |
|---|---|---|
textMode | string | "manual" (user-written text) or "ai" (AI-generated). |
autoGenerate | boolean | Auto-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.