AICodeDog
Endpoint · Video

Video Generation

Video generation runs as async tasks: create a task, poll status, fetch the mp4 URL on completion. One endpoint + one poll covers the whole flow.

Endpoint

http
POST https://api.aicodedog.com/v1/videos/generations # create GET https://api.aicodedog.com/v1/videos/generations/{id} # poll

Popular models: veo3-1-lite (Google), wan2-7 (Alibaba), douban-seedance-1-lite (ByteDance), vidu-q1-lite (Shengshu), skyreels-v4-fast (Kunlun).

Create a task

curl
curl https://api.aicodedog.com/v1/videos/generations \ -H "Authorization: Bearer $AICODEDOG_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "wan2-7", "prompt": "A close-up of an orange cat yawning in sunlight, 8 seconds", "duration": 8, "aspect_ratio": "16:9", "resolution": "720p" }'

The response returns a task ID:

json
{ "id": "vidgen_abc123", "status": "queued", "model": "wan2-7", "created": 1747291200 }

Poll status

curl
curl https://api.aicodedog.com/v1/videos/generations/vidgen_abc123 \ -H "Authorization: Bearer $AICODEDOG_KEY"

States:

  • queued → in queue
  • processing → generating (about 80% of total time)
  • succeeded → done, video_url populated
  • failed → failed, error field has the reason
json
{ "id": "vidgen_abc123", "status": "succeeded", "video_url": "https://cdn.aicodedog.com/video/abc123.mp4", "thumbnail_url": "https://cdn.aicodedog.com/video/abc123.jpg", "duration": 8, "completed": 1747291320 }
Recommended polling cadence
Every 5s for the first 30s, then every 10s. Most tasks finish in 30s–120s; anything beyond 5 minutes is almost certainly failed — cancel and retry.

Image-to-video

Capable models (e.g. wan2-7-e2v, vidu1) accept image_url as the first/reference frame:

json
{ "model": "wan2-7-e2v", "image_url": "https://example.com/keyframe.jpg", "prompt": "Slow zoom out, background light softens", "duration": 6 }

Parameters

  • model (required) — model slug.
  • prompt (required) — text description.
  • duration — length in seconds, common values 4 / 6 / 8 / 12 / 15.
  • aspect_ratio — 16:9 / 9:16 / 1:1 / 4:3.
  • resolution — 540p / 720p / 1080p.
  • image_url — first/reference frame for image-to-video.
  • seed — reproducibility seed (best-effort).
  • negative_prompt — negative prompt.
Billing happens on completion
Creating a task is free. Once the task reaches succeeded, we charge by duration + model from your balance. failed tasks are never billed.