GreenTokens

Search

Search models, guides, docs and the FAQ.

API

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:

  1. POST /v1/videos creates the job and returns 202 with its id and quoted price_usd.
  2. Poll GET /v1/videos/{id} until status is completed. Other statuses: queued, in_progress, failed, cancelled and expired.
  3. Download the MP4 from GET /v1/videos/{id}/content. Videos are kept for 7 days.
Video routes are /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, …}
FieldTypeDescription
modelstringA video model ID, e.g. jimeng-seedance-2.0-mini.
promptstringWhat happens in the video.
modestringtext_to_video (default), image_to_video, first_last_frames or multimodal_reference.
resolutionstringe.g. 480p, 720p, 1080p, 4k. Each model supports its own set.
duration_secondsintegerLength of the video. Each model has its own minimum and maximum.
ratiostringAspect ratio, e.g. 16:9, 9:16, 1:1, 4:3.
imagefileSource 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.jpg

What 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
curl https://api.greentokens.io/v1/videos/models

Each 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.

curl
# 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"
Send an 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.