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:

Engineengine valueNotes
Seedreamseedream (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
GeminigeminiThe prompt and reference images are sent to a third-party model service outside mainland China
GPTgptThe prompt and reference images are sent to a third-party model service outside mainland China

Create Task

Basic Information

ItemValue
MethodPOST
Path/task/image_generate
Content-Typeapplication/json
AuthAuthorization header (pass the API Key directly)

Request Body

FieldTypeRequiredDefaultDescription
promptstringYes—Description of the image, 1–2000 characters after trimming. Put anything you want to avoid here too, e.g. "no text"
aspect_ratiostringNo1:1One 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
nintegerNo1Number of images, 1–4
enginestringNoseedreamseedream / gemini / gpt; determines style and price
reference_file_idsstring[]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

ItemValue
MethodGET
Path/task/image_generate/{task_id}
AuthAuthorization 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.

FieldTypeDescription
pic_file_id_liststring[]Image file IDs
pic_file_download_url_liststring[]Image download paths
pic_size_listobject[]Actual size of each image, {"width", "height"}
enginestringEngine used
aspect_ratiostringAspect 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

Ratioseedreamgeminigpt
1:11536 × 15361024 × 10241280 × 1280
16:92048 × 11521376 × 7681536 × 864
9:161152 × 2048768 × 1376864 × 1536
4:31728 × 12961200 × 8961536 × 1152
3:41296 × 1728896 × 12001152 × 1536
3:21872 × 12481264 × 8481536 × 1024
2:31248 × 1872848 × 12641024 × 1536
  • Format: PNG or JPEG, as returned by the model, without re-encoding.
  • pic_size_list has 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 gemini and gpt engines 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 n images 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

CodeHTTP StatusDescriptionResolution
6013400Missing promptPass the prompt field
6016400Invalid 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 chargedFix the request per Request Body
6004404Reference image file not foundCheck the file IDs in reference_file_ids
6014400A reference image is not png / jpg / jpeg / webpUse 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
6502401Authentication failedCheck the Authorization header
6202402Insufficient balanceTop up in the dashboard