Generate videos

Submit a video task and get a task_id right away. MiniMax H3 and Seedance both produce sound, from text, first/last frames or reference media.

POSThttps://api.jiufeng.ai/v1/videos/generations
3 things to know first
  1. Asynchronous, like images: submitting returns a task_id; the video is in data.result.videos[0].url of the task result
  2. API default resolutions differ from the web app: MiniMax H3 defaults to 2K, Seedance to 720P — pass resolution explicitly for the cheaper tiers
  3. First/last frames use different fields: MiniMax H3 takes first_frame_image / last_frame_image, Seedance takes image_with_roles

Videos usually take tens of seconds to a few minutes: poll Query tasks every 5–30 s, or wait for a Webhook callback.

MiniMax H3

Every MiniMax H3 clip comes with stereo sound at 24 fps.

MiniMax H3's API default resolution is 2K (1.56 credits per second), while the Jiufeng web app defaults to 768P (0.75 credits per second). Send "resolution": "768P" explicitly if you want the cheaper tier.

Three ways to drive a video

The mode is decided by which media fields you send — there is no mode parameter.

ModeSendNotes
Text to videoprompt (+ size)size picks the aspect ratio; default 16:9
First / last framefirst_frame_image (+ last_frame_image)The aspect ratio follows the first frame; size is ignored. A last frame needs a first frame
Multimodal referenceimage_urls / video_urls / audio_urlsUse subjects, motion or sound from your media. Audio must come with at least one image or video

Request parameters

modelstringrequired
MiniMax-H3 — spell it exactly as shown
promptstringrequired
What happens in the clip, camera movement, sound
resolutionstringoptional
768P or 2K. Default 2K
durationintegeroptional
Output length in seconds, 5–15. Default 5
sizestringoptional
Text-to-video aspect ratio: 21:9, 16:9, 4:3, 1:1, 3:4, 9:16. Default 16:9; any other value is treated as 16:9 without an error
first_frame_imagestringoptional
URL of the first frame (image to video)
last_frame_imagestringoptional
URL of the last frame; requires first_frame_image
image_urlsstring[]optional
Reference images, up to 9. The first 5 are free; each extra image costs 1 credit
video_urlsstring[]optional
Reference videos, up to 3, 15 s in total. Their seconds are billed at the output rate
audio_urlsstring[]optional
Reference audio, up to 3, each 2–15 s. Free. Needs an image or video alongside
webhookstringoptional
Callback URL prefix (see Webhook)

All media must be publicly reachable https:// URLs.

Example cost (768P): 5 s × 0.75 = 3.75 credits (see the “H3 text” example).

Full example: submit and wait

import time
import requests
 
API = "https://api.jiufeng.ai/v1"
HEADERS = {"Authorization": "Bearer sk-YOUR_KEY"}
 
resp = requests.post(f"{API}/videos/generations", headers=HEADERS, json={
    "model": "MiniMax-H3",
    "prompt": "A perfume bottle slowly rotates on dark stone, rim light, product commercial",
    "resolution": "768P",
    "duration": 5,
    "size": "9:16",
})
resp.raise_for_status()
task_id = resp.json()["data"][0]["task_id"]
 
delay = 5
deadline = time.time() + 1200   # cap the wait
while time.time() < deadline:
    task = requests.get(f"{API}/tasks/{task_id}", headers=HEADERS).json()["data"]
    if task["status"] == "completed":
        print(task["result"]["videos"][0]["url"][0])   # download within 30 days
        break
    if task["status"] == "failed":
        raise RuntimeError(task["error"]["message"])
    time.sleep(delay)
    delay = min(delay * 2, 30)
else:
    raise TimeoutError(task_id)

Video usually takes from tens of seconds to a few minutes — poll every 5–30 s, or use a Webhook.

Seedance

Three Seedance models share this endpoint. Each clip comes with sound by default.

modelresolutionBest for
seedance-2.5480P, 720P, 1080PHighest quality; billed by the amount actually generated
seedance-2.0480P, 720P, 1080P, 4KStable quality, the only Seedance with 4K (slow: a 5 s 4K clip takes about 5–6 minutes)
seedance-2.0-fast480P, 720PFaster and cheapest

The doubao-seedance-* spellings (for example doubao-seedance-2.0) are also accepted and land on the same model and price. Prices: Pricing.

Seedance's API default resolution is 720P, while the Jiufeng web app defaults to 480P. Send "resolution": "480P" explicitly if you want the cheaper tier.

Seedance request parameters

modelstringrequired
seedance-2.5, seedance-2.0 or seedance-2.0-fast
promptstringrequired
What happens in the clip, camera movement, sound
resolutionstringoptional
See the table above. Default 720P. 1080P on seedance-2.0-fast is rejected with 400; 4K is not supported on seedance-2.5 — don't send it
durationintegeroptional
Output length in seconds, 4–15. Default 5
sizestringoptional
Aspect ratio: 16:9, 4:3, 1:1, 3:4, 9:16, 21:9 or adaptive. With a first / last frame, leave it out or send adaptive (seedance-2.5 rejects other values with 400)
image_with_rolesobject[]optional
Images with a role: [{"url": "…", "role": "first_frame"}]. role is first_frame, last_frame or reference_image. First and last frames must be sent here
image_urlsstring[]optional
Reference images. Always treated as references, never as a first frame. Up to 9 images in total, counting image_with_roles
video_urlsstring[]optional
Reference videos, up to 3, each 2–15 s and 15 s in total (seedance-2.5: up to 30 s each and in total). Their length is billed too (see Pricing)
audio_urlsstring[]optional
Reference audio, up to 3, each 2–15 s and 15 s in total (seedance-2.5: up to 30 s each and in total). Longer media is rejected with 400
generate_audiobooleanoptional
Generate sound with the clip. Default true
webhookstringoptional
Callback URL prefix (see Webhook)

Don’t mix first / last frames with reference media: together with reference images (image_urls) it is not supported; together with reference videos or audio, the frames are no longer used as frames and are treated as reference_image. All media must be publicly reachable https:// URLs.

Example cost (seedance-2.0-fast, 480P): 5 s × 0.491 = 2.455 credits (see the “Seedance text” example).

Response fields

Submitting returns a task_id. Once done, Query tasks puts the video URL at data.result.videos[0].url[0]; expires_at is when it expires (result files are kept for 30 days) and credits_cost is what was charged. Query result once complete (GET /v1/tasks/{task_id}):

{
  "code": 200,
  "data": {
    "id": "task_01M6N0VX3H2Q8DZ4RZ0J5P7K1C",
    "status": "completed",
    "progress": 100,
    "cost": 0.375,
    "credits_cost": 3.75,
    "result": {
      "videos": [
        { "url": ["https://…/xxx.mp4"], "expires_at": 1785163216 }
      ]
    }
  }
}

Common errors

HTTPWhenWhat to do
400Invalid parameters (e.g. 1080P on seedance-2.0-fast, reference media too long); or model misspelled / not enabled for your key (model_not_available)Update the request as the error message says; GET /v1/models lists usable models
401Missing key (missing_api_key) or invalid keyCheck Authorization: Bearer sk-…
402Insufficient credits, key quota exhausted, or key expiredTop up, raise the cap, or create a new key
429Rate limitedBack off per the Retry-After header and retry

Full list: Errors.

Generate videos · Jiufeng Open API