Image Generation
Create images from a text prompt, or edit a reference image with image-to-image. Like video tasks, image generation is asynchronous — poll the image status endpoint for results.
Each image consumes credits (base credits per image × quality × output-count multipliers, see Pricing & Credits) and requires a valid Authorization: Bearer <API_KEY> header.
Create image task
Submits a text-to-image, image-to-image, or multiple-reference-image task. Requires a valid Authorization: Bearer <API_KEY> header. Omit both image fields for text-to-image; pass image_url for a single reference image, or image_url_list for multiple reference images (model must support Reference, see the Models page).
Body parameters
| Field | Type | Required | Description |
|---|---|---|---|
| model | string | Required | Static image model code, e.g. "seedream-4". The Models page lists every code with its allowed parameter values. |
| prompt | string | Required | Text description of the image to generate. Max length is per model (see Models page). |
| image_url | string | Optional | Single reference image URL (image-to-image). In multiple-reference mode it is merged into image_url_list. Omit both image fields for text-to-image. |
| image_url_list | array<string> | Optional | Multiple reference image URLs (a JSON array, or a comma-separated string). Only for models that support Reference (see Models page); the total count (including image_url) must stay within the model's maximum. |
| image_num | int | Optional | Number of images to generate, up to the model's max. Default 1. |
| ratio | string | Optional | Aspect ratio, e.g. "1:1", "16:9", "9:16". Allowed values and default vary by model. |
| quality | string | Optional | Quality tier (normalized to lowercase). Allowed values and default vary by model. |
| resolution | string | Optional | Output resolution, only accepted on models that list one on the Models page. |
| output_format | string | Optional | Delivery format: "png" (default), "gif" (animated) or "svg". Only accepted on GPT Image 2.6 models; ignored elsewhere. |
| frame_count | int | Optional | Frames in the animated GIF (2–16). Applies only when output_format="gif" on GPT Image 2.6 models; ignored otherwise. |
| frame_duration_ms | int | Optional | Per-frame duration in milliseconds (minimum 20). Applies only when output_format="gif" on GPT Image 2.6 models; ignored otherwise. |
| svg | object | Optional | SVG output settings, applies only when output_format="svg" on GPT Image 2.6 models. Fields: model (SVG authoring model, default "SVG_AUTHOR_MODEL") and reasoning.effort ("low" / "medium" / "high", default "high"). Omit to use the defaults. |
curl -X POST "https://litvideo-api.litmedia.ai/v1/images" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer lvsk-xxxxxxxxxxxxxxxx" \
-d '{
"model": "seedream-4",
"prompt": "A watercolor fox wearing a scarf, storybook style",
"image_num": 2,
"ratio": "1:1"
}'
curl -X POST "https://litvideo-api.litmedia.ai/v1/images" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer lvsk-xxxxxxxxxxxxxxxx" \
-d '{
"model": "gpt-image-2",
"prompt": "Combine these three characters into one group photo",
"image_url_list": [
"https://example.com/char-1.png",
"https://example.com/char-2.png",
"https://example.com/char-3.png"
],
"ratio": "1:1"
}'
Response
{
"code": 200,
"msg": "success",
"data": {
"task_id": "tsk_3b7e0c9d2f1a48e6b5c0d7f8a9e1b2c3"
}
}
The model code and every parameter value are validated against the Models catalog before the task is created. Unknown codes, oversized prompts or out-of-range values fail the request with an error envelope (code 1046).
Image status
Polls a task created by /v1/images through the unified status endpoint. The payload carries task_id, type = image, image_url / image_urls, status, status_text and cost_credit.
See Task Status for the shared polling pattern and status lifecycle.