Video Generation API

Create and query asynchronous video generation tasks.

Overview

VibeVideo uses an asynchronous task model:

  1. Create a task via POST /api/ai/generate
  2. Poll task status via POST /api/ai/query

Authentication

For third-party integrations, use an API key:

  • Header: Authorization: Bearer <YOUR_API_KEY>
  • Create/manage API keys in: Dashboard → Settings → API Keys

Create a Video Task

POST /api/ai/generate

Headers

Authorization: Bearer <YOUR_API_KEY>
Content-Type: application/json

Body

{
  "mediaType": "video",
  "scene": "text-to-video",
  "model": "sora-2-pro-text-to-video",
  "prompt": "A dog playing in a park",
  "options": {
    "mode": "text-to-video",
    "duration": 10,
    "aspect_ratio": "landscape",
    "quality": "standard",
    "generate_audio": false
  }
}

Response (success)

{
  "code": 0,
  "message": "ok",
  "data": {
    "id": "YOUR_TASK_ID",
    "mediaType": "video",
    "scene": "text-to-video",
    "model": "sora-2-pro-text-to-video",
    "status": "pending",
    "taskId": "PROVIDER_TASK_ID",
    "costCredits": 75
  }
}

Note: taskInfo and taskResult are stored as JSON strings in the task record.

Query Task Status

POST /api/ai/query

Body

{
  "taskId": "YOUR_TASK_ID"
}

Response

The returned data is the same task record, with updated status, taskInfo, and taskResult.

Status Values

  • pending
  • processing
  • success
  • failed
  • canceled