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

Endpoints

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

Authentication

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

Request Body

{
  "request_type": "async",
  "callback_url": "https://...",
  "provider": "auto",
  "input": {
    "mode": "text-to-video",
    "prompt": "...",
    "resolution": "1080p",
    "duration": 10,
    "aspect_ratio": "16:9",
    "image_urls": ["..."],
    "negative_prompt": "...",
    "seed": 12345,
    "enable_prompt_expansion": true
  }
}

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
обязательно
Параметры входа модели
Mode Options:
  • text-to-video — Generate video from text
  • image-to-video — Generate video from image

Example

Text-to-Video
curl -X POST "https://api.apixo.ai/api/v1/generateTask/wan-2-5" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "provider": "value",
    "input": {
      "mode": "text-to-video",
      "prompt": "a serene mountain landscape with moving clouds and gentle breeze",
      "resolution": "1080p",
      "duration": 10,
      "aspect_ratio": "16:9",
      "negative_prompt": "low quality, blurry",
      "enable_prompt_expansion": true
    }
  }'
Image-to-Video
curl -X POST "https://api.apixo.ai/api/v1/generateTask/wan-2-5" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "callback",
    "callback_url": "https://your-server.com/callback",
    "provider": "official",
    "input": {
      "mode": "image-to-video",
      "prompt": "make this picture into a smooth cinematic shot with camera slowly zooming in",
      "resolution": "720p",
      "duration": 5,
      "image_urls": ["https://example.com/ref.jpg"],
      "enable_prompt_expansion": false,
      "seed": 42
    }
  }'

Response

POST /api/v1/generateTask/wan-2-5

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

GET /api/v1/statusTask/wan-2-5

Запрос статуса выполнения задачи и результатов по taskId.
curl -X GET "https://api.apixo.ai/api/v1/statusTask/wan-2-5?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": 1767965652317,
    "costTime": 41388
  }
}
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:
    • 720p resolution: ~50-70 seconds
    • 1080p resolution: ~70-90 seconds
    • Submit task, wait 50 seconds, then poll every 5 seconds
  • Callback mode: Recommend using callback mode to avoid frequent polling.
  • Video expiration: Result URLs are valid for 15 days. Download promptly.
  • Content moderation: Prompts must comply with content safety guidelines.
  • High resolution support:
    • 720p: Fast generation, for previews and social media
    • 1080p: HD output, for professional publishing and high-quality content
  • Prompt expansion:
    • enable_prompt_expansion: true (default): System auto-optimizes and expands prompt with more details
    • enable_prompt_expansion: false: Strictly uses original prompt, for precise control
    • Short prompts benefit from expansion; detailed prompts can disable it
  • Aspect ratio selection:
    • 16:9: Landscape (default), for traditional video platforms
    • 9:16: Portrait, for short video platforms and mobile viewing
    • 1:1: Square, for social media
  • Negative prompt:
    • Use negative_prompt to avoid blur, low quality, jitter, and other unwanted effects
    • Example: “low quality, blurry, shaky, distorted”
    • Helps improve video stability and clarity
  • Seed reproduction:
    • Same seed + prompt + parameters reproduces identical results
    • Ideal for consistent batch generation or iterative refinement
  • Image-to-video:
    • Reference image becomes video start frame
    • Describe desired animation effects and camera movement in prompt
    • Ideal for bringing still images to life, character animation, scene expansion
  • Prompt tips:
    • Describe specific scenes and actions (e.g., “clouds drifting over mountains”, “slow dolly in”)
    • Describe dynamic elements (e.g., “swaying leaves”, “flowing water”, “flying birds”)
    • Describe camera movement (e.g., “slow push in”, “orbiting shot”, “wide to close”)
    • Be specific; concrete descriptions work better than abstract ones
  • Duration selection:
    • 5 seconds: Quick previews, short clips, loop animations
    • 10 seconds: More narrative space, complete scene showcases
  • Image formats: image_urls supports JPG, PNG, WebP, max 10MB per image.
  • Best practices:
    • Use clear, specific prompts
    • Enable prompt expansion for richer details
    • Use negative prompt to avoid common issues
    • 720p for quick iteration, 1080p for final output

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