Video
Create video jobs from text or images, poll them and download the MP4.
How it works
Video generation takes from about half a minute to several minutes, so it always runs as a job:
POST /v1/videoscreates the job and returns202with itsidand quotedprice_usd.- Poll
GET /v1/videos/{id}untilstatusiscompleted. Other statuses:queued,in_progress,failed,cancelledandexpired. - Download the MP4 from
GET /v1/videos/{id}/content. Videos are kept for 7 days.
/v1 only, unlike the other routes.Create a video from text
curl https://api.greentokens.io/v1/videos \
-H "Authorization: Bearer $GREENTOKENS_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: waves-2026-09-27-001" \
-d '{
"model": "jimeng-seedance-2.0-mini",
"prompt": "Slow aerial shot of waves breaking on a black sand beach",
"mode": "text_to_video",
"resolution": "720p",
"duration_seconds": 5,
"ratio": "16:9"
}'
# 202 Accepted
# {"id": "video_…", "object": "video", "status": "queued", "price_usd": 0.27, …}| Field | Type | Description |
|---|---|---|
| model | string | A video model ID, e.g. jimeng-seedance-2.0-mini. |
| prompt | string | What happens in the video. |
| mode | string | text_to_video (default), image_to_video, first_last_frames or multimodal_reference. |
| resolution | string | e.g. 480p, 720p, 1080p, 4k. Each model supports its own set. |
| duration_seconds | integer | Length of the video. Each model has its own minimum and maximum. |
| ratio | string | Aspect ratio, e.g. 16:9, 9:16, 1:1, 4:3. |
| image | file | Source image for image_to_video. Send as multipart. |
Animate an image
Send the request as multipart/form-data with the source image in the image field and mode set to image_to_video. Polling and downloading work the same way.
curl https://api.greentokens.io/v1/videos \
-H "Authorization: Bearer $GREENTOKENS_API_KEY" \
-F model=jimeng-seedance-2.0-mini \
-F mode=image_to_video \
-F prompt="The camera slowly pushes in as steam rises from the cup" \
-F resolution=720p \
-F duration_seconds=5 \
-F ratio=16:9 \
-F image=@coffee.jpgWhat each model supports
Resolutions, aspect ratios, durations, modes and input limits differ by model. Read them from the public model list (no key needed), or compare prices on the models page.
curl https://api.greentokens.io/v1/videos/modelsEach model lists supported_resolutions, supported_aspect_ratios, min_duration_seconds, max_duration_seconds, generation_modes and multimodal_limits.
How video is billed
Video is priced per second of output, by model and resolution. The quoted maximum is held from your balance when the job is created and settled at the actual length when it finishes. A failed or cancelled job releases the hold.
List and cancel jobs
GET /v1/videos lists your jobs, newest first (?limit=, default 20; ?before= a job ID to page). DELETE /v1/videos/{id} cancels one.
# Your recent jobs, newest first
curl "https://api.greentokens.io/v1/videos?limit=20" -H "Authorization: Bearer $GREENTOKENS_API_KEY"
# One job
curl https://api.greentokens.io/v1/videos/video_… -H "Authorization: Bearer $GREENTOKENS_API_KEY"
# Cancel
curl -X DELETE https://api.greentokens.io/v1/videos/video_… -H "Authorization: Bearer $GREENTOKENS_API_KEY"Idempotency-Key when creating jobs so a retried request never creates (and charges for) a second video. The same key and body return the original job; a different body returns 409.