CLI & API

Video Generation

Generate AI videos via CLI or HTTP API.

Generate short AI videos through the site API — no web UI required. This covers direct AI video generation (text-to-video, image-to-video, etc.), not workflow-based video pipelines.

Configuration details: CLI & API Guide.

Prerequisites

  1. Create a key at Settings → API Keys (sk-...)
  2. Configure the CLI:
pnpm ads login --host https://modkie.com --api-key sk-xxxxxxxx

Video generation consumes more credits than images. Ensure your account has sufficient balance.

Commands

Generate and wait

pnpm ads video generate \
  --prompt "cinematic product shot, soft lighting, slow camera push" \
  --scene text-to-video \
  --out ./output/video.mp4

Optional: --timeout 600000 (milliseconds, default 600000).

Image-to-video

pnpm ads video generate \
  --prompt "gentle camera motion, natural lighting" \
  --scene image-to-video \
  --image-input "https://example.com/reference.jpg" \
  --out ./output/motion.mp4 \
  --json

Query a task

pnpm ads video query --task-id <uuid> --json

List capabilities / schema

pnpm ads actions list
pnpm ads actions schema ai.video.generate_and_wait

Scenes

sceneDescription
text-to-videoGenerate from text prompt (default)
image-to-videoAnimate a reference image
video-to-videoTransform an existing video
ad-videoMarketing ad video scene

Default model

When --provider and --model are omitted:

  • text-to-video: kie / bytedance/seedance-2-mini
  • image-to-video: kie / wan/2-7-image-to-video

Override with --provider and --model for other catalog models.

CLI flags vs API fields

FlagAPI field
--promptprompt
--scenescene
--providerprovider
--modelmodel
--image-inputimageInput (comma-separated)
--video-inputvideoInput (comma-separated)
--timeouttimeoutMs
--outdownloads first videoUrl locally

API-only fields: options, workspaceId.

--json output example

{
  "taskId": "...",
  "status": "success",
  "videoUrl": "https://...",
  "localPath": "./output/video.mp4",
  "url": "https://...",
  "provider": "kie",
  "model": "bytedance/seedance-2-mini"
}

HTTP examples

Generate (blocking):

curl -H "Authorization: Bearer sk-xxx" \
  -H "Content-Type: application/json" \
  -X POST https://modkie.com/api/actions/ai.video.generate_and_wait \
  -d '{"prompt":"ocean waves at sunset","scene":"text-to-video","timeoutMs":600000}'

Async create + poll:

curl -H "Authorization: Bearer sk-xxx" \
  -H "Content-Type: application/json" \
  -X POST https://modkie.com/api/actions/ai.video.generate \
  -d '{"prompt":"ocean waves at sunset","scene":"text-to-video"}'

curl -H "Authorization: Bearer sk-xxx" \
  -H "Content-Type: application/json" \
  -X POST https://modkie.com/api/actions/ai.video.query \
  -d '{"taskId":"<uuid>"}'

API endpoints

MethodURL
GEThttps://modkie.com/api/actions
GEThttps://modkie.com/api/actions/ai.video.generate_and_wait/schema
POSThttps://modkie.com/api/actions/ai.video.generate_and_wait
POSThttps://modkie.com/api/actions/ai.video.query

Auth: Authorization: Bearer sk-xxx or X-Api-Key: sk-xxx

Notes

  • Video tasks often take 2–10 minutes. Use async ai.video.generate + ai.video.query for long runs.
  • Workflow video nodes and stock-clip compose are separate capabilities (not covered here).