LLitMediaAPI Docs

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.

i

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

POST /v1/images

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

FieldTypeRequiredDescription
modelstringRequiredStatic image model code, e.g. "seedream-4". The Models page lists every code with its allowed parameter values.
promptstringRequiredText description of the image to generate. Max length is per model (see Models page).
image_urlstringOptionalSingle 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_listarray<string>OptionalMultiple 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_numintOptionalNumber of images to generate, up to the model's max. Default 1.
ratiostringOptionalAspect ratio, e.g. "1:1", "16:9", "9:16". Allowed values and default vary by model.
qualitystringOptionalQuality tier (normalized to lowercase). Allowed values and default vary by model.
resolutionstringOptionalOutput resolution, only accepted on models that list one on the Models page.
output_formatstringOptionalDelivery format: "png" (default), "gif" (animated) or "svg". Only accepted on GPT Image 2.6 models; ignored elsewhere.
frame_countintOptionalFrames in the animated GIF (2–16). Applies only when output_format="gif" on GPT Image 2.6 models; ignored otherwise.
frame_duration_msintOptionalPer-frame duration in milliseconds (minimum 20). Applies only when output_format="gif" on GPT Image 2.6 models; ignored otherwise.
svgobjectOptionalSVG 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
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 — MULTIPLE REFERENCE IMAGES
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

RESPONSE
{
  "code": 200,
  "msg": "success",
  "data": {
    "task_id": "tsk_3b7e0c9d2f1a48e6b5c0d7f8a9e1b2c3"
  }
}
i

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

GET /v1/tasks/{task_id}

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.

On this page