Official SDK for emaki (emaki.ai), the Japanese-language AI video generator for Seedance 2.5 and Seedance 2.0. Generate Seedance 2.5 and Seedance 2.0 clips, and images, from R with the API key of your emaki account.
library(emaki)
clip <- emaki_generate_video("a paper lantern drifting down a night river, slow dolly-in")
clip # URL of the finished MP4
Each generate call submits the run, waits for it and returns the URL of the finished file. Every run costs credits on your emaki account, the same price as on the website.
install.packages("emaki", repos = c("https://hanshs474.r-universe.dev", "https://cloud.r-project.org"))
Imports curl and jsonlite.
Sign up on emaki.ai, create a key at emaki.ai/settings/apikeys, then pass it or export it:
export EMAKI_API_KEY=sk-...
A key runs on your account exactly like the site does: same models, same credits, and every run shows up in your library on emaki.ai.
The default model is seedance_2_5 (5 seconds, 480p, 16:9, with sound). Parameters go in as a named list and are passed through as-is:
# Seedance 2.5: 8 seconds, 720p, vertical
emaki_generate_video("a street drummer in the rain, handheld",
parameters = list(duration = 8, resolution = "720p", aspect_ratio = "9:16"))
# Seedance 2.0
emaki_generate_video("a koi pond seen from above, petals falling", model = "seedance_2",
parameters = list(duration = 5))
| model | what it is | main parameters |
|---|---|---|
seedance_2_5 |
Seedance 2.5, the default |
duration 4 to 30 · resolution 480p / 720p / 1080p · aspect_ratio 16:9, 4:3, 1:1, 3:4, 9:16, 21:9, adaptive · generate_audio · image · last_frame_image
|
seedance_2 |
Seedance 2.0 |
duration 4 to 15 · resolution 480p / 720p / 1080p · aspect_ratio · generate_audio · image
|
seedance_2_fast |
Seedance 2.0 Fast |
duration 4 to 15 · resolution 480p / 720p · aspect_ratio · image
|
seedance_2_mini |
Seedance 2.0 Mini, the cheapest video model | same as Fast |
minimax_h3 |
MiniMax H3 |
duration 5 to 15 · aspect_ratio · image
|
veo_3_1 |
Veo 3.1 |
resolution 720p / 1080p / 4k · aspectRatio 16:9 / 9:16 · image
|
Pass image, a public https URL, and it becomes the first frame; the prompt then describes the motion. This is the same image to video flow as on the site:
emaki_generate_video("the camera slowly orbits the statue",
parameters = list(image = "https://example.com/statue.jpg"))
On Seedance 2.5, last_frame_image pins the closing frame as well.
The default image model is nano_banana_2_lite, the cheapest run on the site:
url <- emaki_generate_image("a ramen stall in the rain, neon reflections")
emaki_generate_image("a ukiyo-e style wave over a modern city", model = "nano_banana_2",
parameters = list(aspect_ratio = "16:9"))
Image models: nano_banana_2_lite, nano_banana_2 (resolution 1K / 2K / 4K), seedream_5_lite (quality basic / high / ultra), gpt_image_2 (resolution 1K / 2K / 4K). All take aspect_ratio.
id <- emaki_submit("a fox trotting through fresh snow")
emaki_status(id)$status # generating | completed | failed; $videoUrl when completed
emaki_credits() # free to call
emaki_generate_video() and emaki_generate_image() take timeout_seconds (default 900) and poll_seconds (default 5).
Failures signal a condition you can catch by class (all inherit emaki_error):
emaki_auth: no key, or the key is wrong or deleted (HTTP 401)emaki_quota: not enough credits left for this run (HTTP 402)emaki_plan: this model unlocks after the account has bought credits (HTTP 403)emaki_busy: another generation on this account is still in progress (HTTP 409)emaki_rejected: the content filter refused the prompt, or the account is cooling down after a refusal; reword rather than retryemaki_validation: a parameter is missing or out of range; the message says whichemaki_failed: the run was accepted and then failed; the failure code says whyemaki_timeout: the wait ran out; the run may still finish in your emaki libraryAnything else (a network failure, a 5xx) comes back as emaki_other with the service's message.
Clips you make here can be sharpened afterwards with the AI video upscaler on the site.
日本語での使い方は シーダンス へ。
MIT licensed. Made by emaki.