GGateYourWay API
SDKs and clients RU Create key
Video API

Video generation

Asynchronous API for Text-to-Video and Image-to-Video generation powered by Kling AI, WanX, MiniMax, Grok, and Seedance. Submit tasks, poll for completion, and download MP4.

01

Models & capabilities

Supported models, resolutions, durations, audio support, and pricing.

Model & VendorModeDurationResolution & FormatAudio / SoundReferencesPricing
kling-3.0Kling AIText-to-Video
Image-to-Video
3–15 s720p, 1080p16:9, 9:16 (до 1080p)Native AI audio
settings.audio: "native"
Up to 2 imagesfirst_frame, last_frame$0.14 / s
kling-3.0-omniKling AIT2V, Multi-ref, I2V3–15 s720p, 1080p16:9, 9:16 (до 1080p)Native AI audio
settings.audio: "native"
Up to 4 imagesfirst/last + 3 refs$0.145 / s
wan3.0-t2vAlibaba (WanX)Text-to-Video2–30 s480p, 720p, 1080p16:9, 9:16Silent—$0.038 / s
wan3.0-i2vAlibaba (WanX)Image-to-Video2–30 s480p, 720p, 1080p16:9, 9:16Silent1 imagefirst_frame (start)$0.038 / s
wan3.0-prime-t2vAlibaba (WanX Prime)Prime Text-to-Video2–30 s480p, 720p, 1080p16:9, 9:16Silent—$0.044 / s
wan3.0-prime-i2vAlibaba (WanX Prime)Prime Image-to-Video2–30 s480p, 720p, 1080p16:9, 9:16Silent1 imagefirst_frame (start)$0.044 / s
minimax_h3MiniMax (Hailuo H3)Мультимодальный T2V/I2V4–15 s(default 5)480p, 768p, 1080p16:9, 9:16, 1:1, 3:4, 4:3, 21:9Audio ref
type: "audio"
Up to 9 img, 3 vid, 3 audio$0.024 / s
grok-imagine-video-1.5xAI (Grok)Text-to-Video, I2V6–15 s(default 6)480p, 720p16:9, 9:16, 1:1SilentUp to 7 imagesfirst/last + refs$0.180 / gen
seedance2.5-01-720ByteDance (Seedance)Длинное видео (Text/Multi-ref)30 s(fixed)720p16:9, 9:16, 1:1, 3:4, 4:3, 21:9SilentUp to 9 images$0.480 / gen
02

Task lifecycle

Video generation is performed asynchronously in three steps.

  1. Task Submission (POST /v1/videos): validates parameters, calculates cost, and reserves the balance. Returns a JSON payload with id (e.g. task_01jvideo_example), status queued, poll_url, and content_url.
  2. Status Polling (GET /v1/videos/{task_id}): the client polls every 10–15 seconds. Status transitions: queued → in_progress → completed or failed. Once completed, funds are settled. If the task fails, the balance hold is released automatically with zero charge.
  3. Video Streaming & Download (GET /v1/videos/{task_id}/content): streams the completed MP4 video with full HTTP Range support (status 206 Partial Content) for streaming video players.
03

Sound & audio settings

How to configure native AI sound synthesis or pass audio reference tracks.

  • Kling AI (kling-3.0, kling-3.0-omni): supports native AI sound synthesis (engine sounds, ocean waves, footsteps, ambient noise) synchronized with visual motion. To generate video with sound, include:
    "settings": {"audio": "native"}.
    By default, video is silent ("settings": {"audio": "off"}). Multi-shot camera cuts are also supported: "settings": {"multi_shot": true}.
  • MiniMax Hailuo H3 (minimax_h3): supports audio reference conditioning. Provide a soundtrack or voice track in references with type: "audio":
    "references": [{"type": "audio", "url": "https://example.com/track.mp3"}]
    (Up to 3 audio files, 2–15 seconds duration, up to 15 MB).
  • Alibaba WanX, ByteDance Seedance, xAI Grok: generate silent MP4 video tracks. When audio is required, choose Kling 3.0 with native audio or post-process with an audio layer.
04

Request parameters

JSON body fields for POST /v1/videos.

ParameterTypeDescription
modelstringRequired. Video model ID from the catalog.
promptstringText description of the scene, subjects, and camera movements (required for Text-to-Video).
secondsintegerVideo duration in seconds. Kling: 3–15; WanX: 2–30; MiniMax: 4–15 (default 5); Grok: 6–15 (default 6); Seedance: 30 (fixed).
size / resolutionstringVideo resolution: 480p, 720p, 768p, 1080p, or exact dimensions (1280x720, 1920x1080).
aspect_ratio / ratiostringAspect ratio: 16:9 (landscape), 9:16 (portrait/Reels/Shorts), 1:1, 3:4, 4:3, 21:9.
settingsobjectKling AI settings: audio ("native" for AI sound, or "off") and multi_shot (boolean).
referencesarrayArray of reference objects with type ("image", "audio"), role ("first_frame", "last_frame", "reference"), and url.
prompt_extendbooleanFor WanX models: automatic prompt expansion by upstream LLM (default false).
05

Examples

Ready-to-use examples for cURL and Python.

bash
curl https://api.gateyourway.com/v1/videos \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer gyw-sk-YOUR_KEY" \
  -d '{
    "model": "kling-3.0",
    "prompt": "A cinematic aerial shot of ocean waves crashing on dark rocks at sunset with seagulls flying",
    "seconds": 5,
    "size": "1920x1080",
    "settings": {
      "audio": "native",
      "multi_shot": false
    }
  }'

json
{
  "id": "task_01jvideo_example",
  "status": "queued",
  "model": "kling-3.0",
  "seconds": 5,
  "poll_url": "/v1/videos/task_01jvideo_example",
  "content_url": "/v1/videos/task_01jvideo_example/content"
}
bash
curl https://api.gateyourway.com/v1/videos \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer gyw-sk-YOUR_KEY" \
  -d '{
    "model": "wan3.0-i2v",
    "prompt": "The camera slowly zooms in as gentle wind blows through cherry blossom petals",
    "seconds": 5,
    "size": "720p",
    "ratio": "16:9",
    "prompt_extend": false,
    "references": [
      {
        "type": "image",
        "role": "first_frame",
        "url": "https://example.com/start_frame.jpg"
      }
    ]
  }'
bash
curl https://api.gateyourway.com/v1/videos \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer gyw-sk-YOUR_KEY" \
  -d '{
    "model": "minimax_h3",
    "prompt": "A cyberpunk street market in neo-Tokyo with rain reflections and neon signs",
    "seconds": 6,
    "size": "768p",
    "aspect_ratio": "16:9",
    "references": [
      {
        "type": "audio",
        "url": "https://example.com/synthwave_bgm.mp3"
      }
    ]
  }'
bash
# 1. Проверка статуса (поллинг раз в 10-15 секунд):
curl https://api.gateyourway.com/v1/videos/task_01jvideo_example \
  -H "Authorization: Bearer gyw-sk-YOUR_KEY"

# Ответ при готовности:
# {
#   "id": "task_01jvideo_example",
#   "status": "completed",
#   "content_url": "/v1/videos/task_01jvideo_example/content"
# }

# 2. Скачивание готового MP4:
curl -L https://api.gateyourway.com/v1/videos/task_01jvideo_example/content \
  -H "Authorization: Bearer gyw-sk-YOUR_KEY" \
  --output video.mp4
python
import os
from pathlib import Path
import time
import requests

api_base = "https://api.gateyourway.com/v1"
user_key = os.getenv("GATEYOURWAY_API_KEY", "gyw-sk-YOUR_KEY")
req_headers = {
    "Authorization": f"Bearer {user_key}",
    "Content-Type": "application/json",
}

# 1. Запуск генерации видео с родным звуком (Kling 3.0)
payload = {
    "model": "kling-3.0",
    "prompt": "A vintage sports car driving fast along a scenic coastal highway at sunset",
    "seconds": 5,
    "size": "1920x1080",
    "settings": {
        "audio": "native",
        "multi_shot": False,
    },
}

resp = requests.post(f"{api_base}/videos", json=payload, headers=req_headers)
resp.raise_for_status()
task = resp.json()
task_id = str(task["id"])
print(f"Task created: {task_id}, status: {task.get('status')}")

# 2. Опрос статуса задачи
while True:
    time.sleep(10)
    poll_resp = requests.get(f"{api_base}/videos/{task_id}", headers=req_headers)
    poll_resp.raise_for_status()
    data = poll_resp.json()
    status = data.get("status")
    print(f"Current status: {status}")
    if status == "completed":
        break
    elif status == "failed":
        raise RuntimeError(f"Generation failed: {data.get('error')}")

# 3. Скачивание готового MP4 файла
print("Downloading MP4 video...")
video_resp = requests.get(f"{api_base}/videos/{task_id}/content", headers=req_headers)
video_resp.raise_for_status()
Path("video.mp4").write_bytes(video_resp.content)
print("Saved to video.mp4 successfully!")