Image from Text
Generate images from text prompts using Gemini, Gemini Pro, or Midjourney. Optionally provide reference images to guide the output style or composition.
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. |
Models
Section titled “Models”| Model | generation_type | data.model |
|---|---|---|
| Standard image | image_from_text | "gemini_image" |
| Pro image | image_from_text | "gemini_pro_image" |
| Midjourney | image_from_text | "midjourney" |
Request body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
generation_type | string | Yes | "image_from_text". |
data.prompt | string | Yes | Text description of the image to generate. Supports {{variable_name}} syntax. |
data.model | string | No | "gemini_image", "gemini_pro_image", or "midjourney". |
data.aspect_ratio | string | No | "1:1", "9:16", "16:9", "4:3", or "3:4". |
data.number_of_images | integer | No | Number of images to generate. Default 1. |
data.content_resource_ids | array | No | Array of content resource IDs to use as reference images. |
data.prompt_var | string | No | Variable name to map the prompt value from a column. |
Response (201)
Section titled “Response (201)”{ "generation_id": 9010, "status": "pending"}Once complete, the generated images are available in output_resources. 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/3050/generate?agent_id=42" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{ "generation_type": "image_from_text", "data": { "prompt": "A futuristic cityscape at sunset with neon lights reflecting off glass buildings, cinematic style", "model": "gemini_pro_image", "aspect_ratio": "16:9", "number_of_images": 2 } }'Completed generation
Section titled “Completed generation”{ "id": 9010, "status": "completed", "user_job_type": "image_generation", "result": null, "failed_reason": null, "output_resources": [ { "id": 1600, "url": "https://cdn.gen.pro/outputs/img_001.png", "thumbnail_url": "https://cdn.gen.pro/thumbnails/img_001.jpg", "object_type": "image", "type": "output" }, { "id": 1601, "url": "https://cdn.gen.pro/outputs/img_002.png", "thumbnail_url": "https://cdn.gen.pro/thumbnails/img_002.jpg", "object_type": "image", "type": "output" } ], "execution_cost": 1.0}Cell configuration
Section titled “Cell configuration”| Field | Type | Description |
|---|---|---|
model | string | Default model: "gemini_image", "gemini_pro_image", or "midjourney". |
ratio | string | Default aspect ratio: "1:1", "9:16", or "16:9". |
autoGenerate | boolean | Auto-trigger generation when dependent variables change. |