Api

Video Generation API

Create asynchronous video generation tasks with POST /api/v1/videos.

Create a video task

POST /api/v1/videos creates an asynchronous video-generation task and consumes credits when accepted.

POST https://vidrush-ai.com/api/v1/videos
Authorization: Bearer sk-your-api-key
Content-Type: application/json

Request body

FieldRequiredTypeDescription
modelYesstringA current model ID from GET /api/v1/models
promptYesstringNon-empty video instruction
modeNostringtext-to-video, image-to-video, video-to-video, frames-to-video, or reference-to-video; must be supported by the model
image_urlsNostring[]Public HTTP(S) image URLs; required by modes that need image input
video_urlsNostring[]Public HTTP(S) video URLs; required by video-to-video and Motion Control
optionsNoobjectModel-specific generation controls

If mode is omitted, it defaults to text-to-video, except a non-empty image_urls array infers image-to-video. Specify mode: "video-to-video" explicitly when using video_urls.

options

FieldTypeDescription
durationstringA supported duration such as 8s
resolutionstringA supported resolution such as 720p, 1080p, or 4k
aspect_ratiostringA supported ratio such as 16:9, 9:16, or Auto
audiobooleantrue only when the model/mode exposes an audio toggle
source_video_duration_secondsnumberPositive source-video duration required when video_urls is used with a per-second-priced model

Only send values advertised for the selected model and mode. The model reference lists the configured values; GET /api/v1/models is the live machine-readable source.

Example

curl -X POST https://vidrush-ai.com/api/v1/videos \
  -H "Authorization: Bearer $VIDRUSH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sora-2",
    "mode": "text-to-video",
    "prompt": "A paper kite crossing a bright summer sky",
    "options": {
      "duration": "8s",
      "resolution": "720p",
      "aspect_ratio": "16:9",
      "audio": true
    }
  }'

Successful response

{
  "code": 0,
  "message": "ok",
  "data": {
    "id": "task_123",
    "status": "pending",
    "costCredits": 20
  }
}

The task record is sanitized before it is returned. Use data.id with GET /api/v1/tasks/{taskId}, polling every 5 seconds until a terminal status.

Legacy /api/ai/* endpoints

The legacy POST /api/ai/generate and POST /api/ai/query endpoints remain available for existing integrations. They retain their legacy request shapes and response behavior. New integrations should use the v1 resource endpoints documented here: POST /api/v1/videos and GET /api/v1/tasks/{taskId}.