Image Generation
Generate images from a text description. Each request produces 1–4 images, with a choice of aspect ratio and engine, and optionally 0–4 reference images to keep a character, style, or composition consistent.
The three engines differ in style and price:
| Engine | engine value | Notes |
|---|---|---|
| Seedream | seedream (default) | The prompt and reference images are processed by a model service in mainland China. If the primary channel is temporarily unavailable, the same model is served through a channel outside mainland China |
| Gemini | gemini | The prompt and reference images are sent to a third-party model service outside mainland China |
| GPT | gpt | The prompt and reference images are sent to a third-party model service outside mainland China |
Create Task
Basic Information
| Item | Value |
|---|---|
| Method | POST |
| Path | /task/image_generate |
| Content-Type | application/json |
| Auth | Authorization header (pass the API Key directly) |
Request Body
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | Yes | — | Description of the image, 1–2000 characters after trimming. Put anything you want to avoid here too, e.g. "no text" |
aspect_ratio | string | No | 1:1 | One of 1:1 / 16:9 / 9:16 / 4:3 / 3:4 / 3:2 / 2:3. The server picks the exact size per engine; see Output Sizes |
n | integer | No | 1 | Number of images, 1–4 |
engine | string | No | seedream | seedream / gemini / gpt; determines style and price |
reference_file_ids | string[] | No | [] | Reference images: 0–4 file IDs of uploaded images (png / jpg / jpeg / webp), used to keep a character, style, or composition consistent |
Request Example
curl -X POST https://api.ai-mcn.tv:10000/task/image_generate \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "A quiet lake at dawn, soft mist, no text", "aspect_ratio": "16:9", "n": 2}'
With a reference image, using the Gemini engine:
curl -X POST https://api.ai-mcn.tv:10000/task/image_generate \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "Same character as the reference, full body, standing in a bamboo forest, no text", "aspect_ratio": "3:4", "engine": "gemini", "reference_file_ids": ["537489015178246"]}'
Success Example
{
"code": 200,
"msg": "success",
"data": {
"task_id": "537489015178247",
"task_type": "image_generate",
"status": "queued"
}
}
task_type depends on the engine: image_generate for seedream, image_generate_gemini for gemini,
and image_generate_gpt for gpt.
Query Task Result
Basic Information
| Item | Value |
|---|---|
| Method | GET |
| Path | /task/image_generate/{task_id} |
| Auth | Authorization header (pass the API Key directly) |
Tasks for all three engines are queried through this one endpoint.
Output Result (output_result)
The three lists are in the same order and have one entry per image actually produced.
| Field | Type | Description |
|---|---|---|
pic_file_id_list | string[] | Image file IDs |
pic_file_download_url_list | string[] | Image download paths |
pic_size_list | object[] | Actual size of each image, {"width", "height"} |
engine | string | Engine used |
aspect_ratio | string | Aspect ratio used |
Success Example
{
"code": 200,
"msg": "success",
"data": {
"task_id": "537489015178247",
"status": "completed",
"progress": 100,
"output_result": {
"pic_file_id_list": ["537489015178248", "537489015178249"],
"pic_file_download_url_list": ["/download/a1/1.jpg", "/download/a1/2.jpg"],
"pic_size_list": [{"width": 2048, "height": 1152}, {"width": 2048, "height": 1152}],
"engine": "seedream",
"aspect_ratio": "16:9"
},
"create_time": "2026-11-11T08:00:00Z",
"update_time": "2026-11-11T08:01:20Z"
}
}
Output Sizes
| Ratio | seedream | gemini | gpt |
|---|---|---|---|
| 1:1 | 1536 × 1536 | 1024 × 1024 | 1280 × 1280 |
| 16:9 | 2048 × 1152 | 1376 × 768 | 1536 × 864 |
| 9:16 | 1152 × 2048 | 768 × 1376 | 864 × 1536 |
| 4:3 | 1728 × 1296 | 1200 × 896 | 1536 × 1152 |
| 3:4 | 1296 × 1728 | 896 × 1200 | 1152 × 1536 |
| 3:2 | 1872 × 1248 | 1264 × 848 | 1536 × 1024 |
| 2:3 | 1248 × 1872 | 848 × 1264 | 1024 × 1536 |
- Format: PNG or JPEG, as returned by the model, without re-encoding.
pic_size_listhas the exact size; it can occasionally differ from the table by a few pixels.
Reference Images
- Every image in the request uses all reference images. Before sending, each reference image is rotated upright, transparent areas are filled with white, and the long side is scaled down to at most 2048. The image you uploaded is not modified.
- The closer the references are to the character or style you want, the more consistent the results. Several angles of the same character work better than images of different characters.
- The
geminiandgptengines send reference images to a third-party model service outside mainland China.
Pricing
- Charged per image; each engine has its own unit price. See Pricing.
- Credits for
nimages are reserved when the task is created. If fewer images are produced, you are charged only for the images produced and the rest is refunded. - If no image is produced (including when the prompt or a reference image doesn't pass the model service's content review), the task fails and all reserved credits are refunded.
Processing Time
About 1 minute per image for seedream, 10–20 seconds for gemini, and 20–30 seconds for gpt
(excluding queue time). For multiple images, seedream and gpt generate them in parallel and gemini
generates them one after another. Tasks run asynchronously; poll status with the query endpoint.
AI-Generated Content Label
Result images carry an implicit AI-generated content label in their file metadata (the picture itself is unchanged); see AI-Generated Content Labeling. When you publish them, add a visible "AI-generated" label as the platform requires.
Error Codes
| Code | HTTP Status | Description | Resolution |
|---|---|---|---|
6013 | 400 | Missing prompt | Pass the prompt field |
6016 | 400 | Invalid value: prompt empty or longer than 2000 characters; aspect_ratio, n, or engine out of range; reference_file_ids not an array or more than 4 items. No task is created and nothing is charged | Fix the request per Request Body |
6004 | 404 | Reference image file not found | Check the file IDs in reference_file_ids |
6014 | 400 | A reference image is not png / jpg / jpeg / webp | Use a supported image format |
6064 | — | The prompt or a reference image didn't pass the model service's content review (during execution: the task fails and all credits are refunded; see error_code in the task result) | Revise the prompt or change the reference image, then resubmit |
6017 / 6021 | — | A reference image can't be recognized or its data is incomplete (during execution: the task fails and credits are refunded) | Re-export the reference image and resubmit |
6502 | 401 | Authentication failed | Check the Authorization header |
6202 | 402 | Insufficient balance | Top up in the dashboard |