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

Endpoints

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

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": ["..."],
    "seed": 12345,
    "loras": [
      {"path": "...", "scale": 1.2}
    ]
  }
}

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
  • text-to-video-LoRA — Text-to-video with LoRA
  • image-to-video-LoRA — Image-to-video with LoRA

Example

Text-to-Video
curl -X POST "https://api.apixo.ai/api/v1/generateTask/ltx-2-19b" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "text-to-video",
      "prompt": "a futuristic city with flying cars at sunset",
      "resolution": "1080p",
      "duration": 10,
      "aspect_ratio": "16:9",
      "seed": 54248617
    }
  }'
Image-to-Video with LoRA
curl -X POST "https://api.apixo.ai/api/v1/generateTask/ltx-2-19b" \
  -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-LoRA",
      "prompt": "make it cinematic with slow pan and dramatic lighting",
      "resolution": "720p",
      "duration": 8,
      "image_urls": ["https://example.com/ref.jpg"],
      "loras": [
        {
          "path": "https://huggingface.co/username/model.safetensors?download=true",
          "scale": 1.2
        }
      ]
    }
  }'
Text-to-Video with Multiple LoRAs
curl -X POST "https://api.apixo.ai/api/v1/generateTask/ltx-2-19b" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "text-to-video-LoRA",
      "prompt": "anime style magical girl transformation sequence",
      "resolution": "720p",
      "duration": 12,
      "aspect_ratio": "9:16",
      "loras": [
        {"path": "https://huggingface.co/user1/anime_style.safetensors?download=true", "scale": 1.5},
        {"path": "https://huggingface.co/user2/magic_effects.safetensors?download=true", "scale": 0.8}
      ]
    }
  }'

Response

POST /api/v1/generateTask/ltx-2-19b

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

GET /api/v1/statusTask/ltx-2-19b

Запрос статуса выполнения задачи и результатов по taskId.
curl -X GET "https://api.apixo.ai/api/v1/statusTask/ltx-2-19b?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 изображения
INVALID_LORA_URLCannot download LoRA model

Rate Limits

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

Tips

  • Generation time:
    • 480p: ~40-60 seconds
    • 720p: ~60-90 seconds
    • 1080p: ~90-120 seconds
    • LoRA mode adds 10-20 seconds for loading
    • Submit task, wait 60 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.
  • LoRA fine-tuning:
    • Load custom LoRA models for specific styles or characters
    • LoRA URL must be publicly downloadable (HuggingFace, Civitai, etc.)
    • URL should include ?download=true or similar download parameters
    • Max 3 LoRA models simultaneously
    • scale parameter controls LoRA influence, recommended: 0.5-2.0
  • Resolution selection:
    • 480p: Fast generation, for previews
    • 720p: Balanced quality and speed
    • 1080p: Highest quality, for final output
  • Duration: Supports flexible 5-20 second duration, billed per second.
  • Seed reproduction: Same seed + prompt + parameters reproduces identical results.
  • Image formats: image_urls supports JPG, PNG, WebP, max 10MB per image.
  • LoRA compatibility: Use video-trained LoRAs; image LoRAs may not work well.

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