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

Endpoints

MethodEndpointDescription
POST/api/v1/generateTask/veo-3-1Создание задачи генерации
GET/api/v1/statusTask/veo-3-1Запрос статуса задачи

Authentication

Все запросы требуют API Key в заголовке:
Authorization: Bearer YOUR_API_KEY

Request Body

{
  "request_type": "async",
  "callback_url": "https://...",
  "provider": "auto",
  "input": {
    "mode": "quality",
    "prompt": "...",
    "generationType": "TEXT_2_VIDEO",
    "aspect_ratio": "16:9",
    "image_urls": ["..."],
    "watermark": "",
    "seed": 1234
  }
}

Parameters

request_type
string
по умолчанию:"async"
async (polling) или callback (webhook)
callback_url
string
Callback URL, обязателен при request_type=callback (условно)
provider
string
по умолчанию:"auto"
Стратегия маршрутизации: auto, value или official
input
object
обязательно
Параметры входа модели
Generation Types:
  • TEXT_2_VIDEO — Pure text-to-video
  • FIRST_AND_LAST_FRAMES_2_VIDEO — First/last frame to video, requires image_urls (max 2)
  • REFERENCE_2_VIDEO — Reference image to video, requires fast mode, image_urls (max 3), aspect_ratio must be 16:9
Mode Options:
  • quality — High quality mode
  • fast — Fast generation mode

Example

Text-to-Video (TEXT_2_VIDEO)
curl -X POST "https://api.apixo.ai/api/v1/generateTask/veo-3-1" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "quality",
      "prompt": "a cinematic flyover of a futuristic city at sunrise",
      "generationType": "TEXT_2_VIDEO",
      "aspect_ratio": "16:9"
    }
  }'
First/Last Frame to Video (FIRST_AND_LAST_FRAMES_2_VIDEO)
curl -X POST "https://api.apixo.ai/api/v1/generateTask/veo-3-1" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "callback",
    "callback_url": "https://your-server.com/callback",
    "input": {
      "mode": "quality",
      "prompt": "a calm ocean turning into a storm",
      "generationType": "FIRST_AND_LAST_FRAMES_2_VIDEO",
      "image_urls": [
        "https://example.com/frame_start.jpg",
        "https://example.com/frame_end.jpg"
      ],
      "aspect_ratio": "9:16"
    }
  }'
Reference Image to Video (REFERENCE_2_VIDEO)
curl -X POST "https://api.apixo.ai/api/v1/generateTask/veo-3-1" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "fast",
      "prompt": "turn this sequence into a dynamic action shot",
      "generationType": "REFERENCE_2_VIDEO",
      "image_urls": [
        "https://example.com/ref1.jpg",
        "https://example.com/ref2.jpg"
      ],
      "aspect_ratio": "16:9"
    }
  }'

Response

POST /api/v1/generateTask/veo-3-1

При успехе возвращает taskId для последующих запросов статуса. Success:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678"
  }
}
Error:
{
  "code": 400,
  "message": "Insufficient credits",
  "data": null
}

GET /api/v1/statusTask/veo-3-1

Запрос статуса выполнения задачи и результатов по taskId.
curl -X GET "https://api.apixo.ai/api/v1/statusTask/veo-3-1?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"
Success:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://r2.apixo.ai/video.mp4\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965730929,
    "costTime": 120000
  }
}
Failed:
{
  "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
400Неверные параметры или ошибка запроса
401Недействительный или отсутствующий API Key
429Превышен лимит запросов
Fail CodeDescription
CONTENT_VIOLATIONКонтент нарушает правила безопасности
INVALID_IMAGE_URLНе удаётся получить доступ к URL изображения

Rate Limits

LimitValue
Requests10000 / minute
Concurrent tasks1000
При превышении возвращается ошибка 429. Подождите и повторите.

Tips

  • Generation time: Average ~2 minutes. Submit task, wait 90 seconds, then poll every 5 seconds.
  • Callback mode: Video generation takes time, strongly recommend using callback mode.
  • Video expiration: Result URLs are valid for 15 days. Download promptly.
  • Content moderation: Prompts must comply with content safety guidelines.
  • REFERENCE_2_VIDEO constraints: This type only supports fast mode and aspect_ratio must be 16:9.
  • Image formats: image_urls supports JPG, PNG, WebP, max 10MB per image.

Video generation takes longer than images — use callback mode for production workloads. Result URLs expire after 15 days; download important outputs promptly.