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
- Create a key at Settings → API Keys (
sk-...) - Configure the CLI:
pnpm ads login --host https://modkie.com --api-key sk-xxxxxxxxVideo 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.mp4Optional: --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 \
--jsonQuery a task
pnpm ads video query --task-id <uuid> --jsonList capabilities / schema
pnpm ads actions list
pnpm ads actions schema ai.video.generate_and_waitScenes
| scene | Description |
|---|---|
text-to-video | Generate from text prompt (default) |
image-to-video | Animate a reference image |
video-to-video | Transform an existing video |
ad-video | Marketing ad video scene |
Default model
When --provider and --model are omitted:
text-to-video:kie/bytedance/seedance-2-miniimage-to-video:kie/wan/2-7-image-to-video
Override with --provider and --model for other catalog models.
CLI flags vs API fields
| Flag | API field |
|---|---|
--prompt | prompt |
--scene | scene |
--provider | provider |
--model | model |
--image-input | imageInput (comma-separated) |
--video-input | videoInput (comma-separated) |
--timeout | timeoutMs |
--out | downloads 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
| Method | URL |
|---|---|
GET | https://modkie.com/api/actions |
GET | https://modkie.com/api/actions/ai.video.generate_and_wait/schema |
POST | https://modkie.com/api/actions/ai.video.generate_and_wait |
POST | https://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.queryfor long runs. - Workflow video nodes and stock-clip compose are separate capabilities (not covered here).