Перейти к основному содержанию

Endpoints

MethodEndpointDescription
POST/api/v1/generateTask/vidu-q3Create a generation task
GET/api/v1/statusTask/vidu-q3Запрос статуса задачи

Authentication

All requests must include your API key in the request headers:
Authorization: Bearer YOUR_API_KEY

Request Body

{
  "request_type": "async",
  "callback_url": "https://...",
  "provider": "auto",
  "input": {
    "mode": "text-to-video",
    "prompt": "a cinematic shot of a futuristic city at sunrise",
    "resolution": "720p",
    "duration": 8,
    "style": "general",
    "aspect_ratio": "4:3",
    "movement": "auto",
    "sound": true,
    "bgm": true,
    "seed": 1234
  }
}

Parameters

request_type
string
по умолчанию:"async"
Execution mode: async (polling) or callback
callback_url
string
Callback URL. Required when request_type=callback. (conditional)
provider
string
по умолчанию:"auto"
Routing strategy: auto, value, official, or a specific provider channel
input
object
обязательно
Параметры входа модели
Mode Reference:
  • text-to-video - Generate a video from text only
  • image-to-video - Generate a video from 1 or 2 images
  • turbo-text-to-video - Turbo text-to-video mode
  • turbo-image-to-video - Turbo image-to-video mode with 1 or 2 images

Examples

Text-to-video (text-to-video)
curl -X POST "https://api.apixo.ai/api/v1/generateTask/vidu-q3" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "text-to-video",
      "prompt": "a cinematic flyover of a futuristic city at sunrise",
      "resolution": "720p",
      "duration": 8,
      "style": "general",
      "aspect_ratio": "16:9",
      "movement": "auto",
      "sound": true,
      "bgm": true
    }
  }'
Single-image animation (image-to-video, 1 image)
curl -X POST "https://api.apixo.ai/api/v1/generateTask/vidu-q3" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "callback",
    "callback_url": "https://your-server.com/callback",
    "input": {
      "mode": "image-to-video",
      "prompt": "make this image come alive with subtle motion",
      "resolution": "1080p",
      "duration": 4,
      "image_urls": [
        "https://example.com/start.jpg"
      ]
    }
  }'
First-and-last-frame generation (image-to-video, 2 images)
curl -X POST "https://api.apixo.ai/api/v1/generateTask/vidu-q3" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "image-to-video",
      "prompt": "transition from start to end smoothly",
      "resolution": "720p",
      "duration": 8,
      "image_urls": [
        "https://example.com/start.jpg",
        "https://example.com/end.jpg"
      ]
    }
  }'

Response

POST /api/v1/generateTask/vidu-q3

При успехе API возвращает taskId для последующего запроса статуса задачи. Успех:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678"
  }
}
Ошибка:
{
  "code": 400,
  "message": "Insufficient credits",
  "data": null
}

GET /api/v1/statusTask/vidu-q3

Используйте taskId для запроса статуса выполнения и итогового результата.
curl -X GET "https://api.apixo.ai/api/v1/statusTask/vidu-q3?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"
Успех:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://r2.apixo.ai/video.mp4\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965730929,
    "costTime": 120000
  }
}
Ошибка:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "failed",
    "failCode": "CONTENT_VIOLATION",
    "failMsg": "Content does not meet safety guidelines"
  }
}

Status Response Fields

taskId
string
Уникальный идентификатор задачи.
state
string
Текущее состояние задачи: pending, processing, success или failed.
resultJson
string
JSON-строка с массивом resultUrls. Присутствует только при success. Парсите через JSON.parse().
failCode
string
Код ошибки. Присутствует только при state=failed. См. Error Codes.
failMsg
string
Читаемое сообщение об ошибке. Присутствует только при state=failed.
createTime
integer
Timestamp создания задачи (Unix миллисекунды).
completeTime
integer
Timestamp завершения задачи (Unix миллисекунды).
costTime
integer
Длительность обработки в миллисекундах.

Error Codes

CodeDescription
400Invalid parameters or malformed request
401Missing or invalid API key
402Insufficient balance
429Превышен лимит запросов
Fail CodeDescription
CONTENT_VIOLATIONThe request violates safety guidelines
INVALID_IMAGE_URLThe provided image URL could not be fetched

Rate Limits

LimitValue
Request rate60 requests per minute
Concurrent tasks10
If you exceed the limit, the API returns a 429 error. Retry later.
Video generation takes longer than images — use callback mode for production workloads. Result URLs expire after 15 days; download important outputs promptly.

Tips

  • Image count by mode: For image-to-video and turbo-image-to-video, the number of image_urls determines the workflow. 1 image creates a single-image animation. 2 images create a first-and-last-frame transition, where the first image is the start frame and the second image is the end frame.
  • Billing: Charges are calculated per second, and billed seconds are equal to duration. For pricing by resolution, see Pricing.
  • Polling recommendation: After submitting a task, wait about 60-90 seconds before polling, then poll every 5 seconds. For higher concurrency, prefer callback mode.
  • Result URL lifetime: Output URLs may expire. Download and store results as soon as possible.