modelId.
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer meigen_sk_YOUR_API_KEY |
| Content-Type | application/json |
Body Parameters
The text description of the image to generate.
The model to use for generation. If omitted, the platform default is used (may change over time). Get available models from the List Models endpoint.Image models:
gpt-image-2, gemini-3-pro-image-preview, nanobanana-2, seedream-5.0-lite, seedream-4.5, midjourney-v8.1, flux2-klein, z-image-turboVideo models: seedance-2-0, happyhorse-1.0, veo-3.1rhart-1.5(GPT image 1.5) was retired on 2026-04-22 — usegpt-image-2instead.midjourney-v7was replaced bymidjourney-v8.1on 2026-05-09 (legacymidjourney-v7requests still accepted for backward compatibility).
The aspect ratio for the generated output.
- Default
auto(recommended): a suitable ratio is picked for you. - Or pass an explicit value — must be one of the ratios returned in
supported_ratiosfrom the List Models endpoint. Common image ratios:1:1,3:4,4:3,16:9,9:16,21:9,5:4,4:5. - Seedance also accepts
adaptive, which matches the dimensions ofreferenceImagesorreferenceVideo. Only useadaptivewhen at least one of those is provided; behavior without a reference is undefined.
aspectRatio field.The output resolution. Availability depends on the model. If omitted, the selected model’s default is used.Available values depend on the model: image models support
1K / 2K / 3K / 4K; video models support 480p / 720p / 1080p. See Models for each model’s supported resolutions and defaults.GPT Image 2.0 only. Accepts
low / medium / high. Other models ignore this parameter.Array of image URLs to use as references. Must be publicly accessible HTTPS URLs.Maximum count is per-model — see
max_reference_images from List Models. Z Image Turbo accepts 0; Midjourney V8.1 / Happyhorse 1.0 accept 1; most others accept up to 5.Advanced parameters for Midjourney V8.1. Ignored for other models. (Field name preserved for backward compatibility.)
| Field | Type | Default | Range | Notes |
|---|---|---|---|---|
| stylize | number | 100 | 0–1000 | |
| chaos | number | 5 | 0–100 | |
| raw | boolean | false | — | |
| iw | number | 1 | 0–2 | |
| sref | string | — | URL or text | |
| sw | number | 100 | 0–1000 | |
| quality | string | 4 | 1 or 4 | Defaults to High (4× compute, no extra cost) |
For Midjourney V8.1 only. How to interpret the reference image.
content— use as subject matter referencestyle— extract visual style only
Video duration in seconds. Seedance 2.0: 4–15 (default 5). Happyhorse 1.0: 3–15 (default 5). Veo 3.1: 4, 6, or 8 (default 4) — only these three values are accepted.
Quality tier for models with multiple tiers. Currently supported by Seedance 2.0 and Veo 3.1:
fast (default) or pro. Pro renders at higher fidelity for a higher price — see Models for the full pricing matrix.For Seedance 2.0 only. Reference video URL for “video continuation” mode. Must be a publicly accessible HTTPS URL (typically a previous generation result URL from the
videoUrl field).When this field is present, billing uses the “with reference video” tier: 480p 8 credits/sec, 720p 14 credits/sec, 1080p 14 credits/sec, with the minimum-billable-seconds floor applied (see Models).For Seedance 2.0 + reference-video continuation only. Duration of the reference video itself (seconds). Used together with
duration to determine billable seconds (see the pricing table in Models). Required when referenceVideo is set — if omitted, it is treated as 0, which can lead to unexpectedly low charges and a misconfigured continuation.Response
Whether the request was accepted.
The unique ID of the generation request. Use this to poll for status.
Initial status, always
"processing".The number of credits deducted for this generation.
The model used for this generation.
Updated credit balances after deduction.
| Field | Type | Description |
|---|---|---|
| daily | number | Remaining daily free credits |
| purchased | number | Remaining purchased credits |
| unlimited | boolean | Whether user has unlimited credits |
Check Generation Status
Response (Processing)
Response (Image Completed)
Response (Video Completed)
aspectRatiois the final ratio applied to this generation (if you passedauto, this is the value that was actually used).mediaTypeisimageorvideo. For video generationsimageUrl/imageUrlsarenull, and vice versa.- Midjourney V8.1 returns 4 candidate images per generation.
imageUrlscontains all candidates;imageUrlalways points to the first one. Other image models return a single image.
Response (Failed)
Examples
Basic generation
OmitmodelId to use the default (gpt-image-2):
With reference image
Midjourney V8.1 with style reference
Seedance video (text-to-video)
Seedance video continuation (with reference video)
duration = 5 seconds.
Auto ratio selection
OmitaspectRatio or pass "auto" to let MeiGen pick a suitable ratio:
aspectRatio on the status endpoint.