Skip to content

Media & data

Video generation

Generate videos from text prompts, images or reference clips. Video generation is asynchronous: submit a request, then poll for the result. Supports text-to-video, image-to-video, reference-to-video and video-to-video models.

Submit

POSThttps://api.ppq.ai/v1/videos

Status

GEThttps://api.ppq.ai/v1/videos/:id

Submit a generation

Allowed values for duration, resolution and quality are model-specific. See Model-specific behaviour.

ParameterTypeRequiredDescription
model
string
Yes
The video model to use. See Available models.
prompt
string
Yes
Text description of the video to generate.
aspect_ratio
string
No
Aspect ratio, for example "16:9", "9:16" or "1:1". Default: "16:9".
duration
string
No
Duration in seconds, for example "5" or "10".
resolution
string
No
Output resolution, for example "720p" or "1080p". Priced at that resolution's rate.
quality
string
No
Quality tier.
image_url
string
No
Public image URL, for image-to-video models.
image_urls
array
No
Reference image URLs, for reference-to-video models such as wan-3.0-r2v, minimax-h3-r2v and happy-horse-1.1-r2v.
reference_video_urls
array
No
Public reference video URLs, for reference-to-video models.
reference_audio_urls
array
No
Reference audio URLs.
video_url
string
No
Public video URL, for video-to-video models such as kling-o3-standard-v2v and grok-imagine-video-v2v.

The submit request returns 202 with the generation id and an estimated_cost:

{
  "id": "gen_abc123",
  "model": "kling-2.5-turbo",
  "status": "pending",
  "created": 1709234567,
  "estimated_cost": 0.4025
}

Poll for the result

Send a GET to /v1/videos/:id every 5–10 seconds until status is "completed" or "failed". The endpoint returns 202 while the video is processing and 200 when it's done.

{
  "id": "gen_abc123",
  "model": "kling-2.5-turbo",
  "status": "completed",
  "created": 1709234567,
  "data": {
    "url": "https://api.ppq.ai/v1/media/gen_abc123/0?sig=...&exp=...",
    "content_type": "video/mp4"
  },
  "cost": 0.4025
}

Model-specific behaviour

Default resolution

If you send neither resolution nor a resolution value in quality, these models use a default resolution. Send resolution explicitly for a higher output.

ModelsDefault resolution
Wan 3.0, Wan 3.0 Prime, Seedance 2.0, Seedance 2.5, grok-imagine-video-t2v, grok-imagine-video-i2v
720p
MiniMax H3
768P

On these models, prefer resolution over quality. A quality value that is one of the model's resolutions (for example "1080p") is used as the resolution when resolution is not sent. Any other quality value has no effect.

Reference video and audio

wan-3.0-r2v, wan-3.0-prime-r2v and minimax-h3-r2v accept reference clips:

  • reference_video_urls: up to 5 clips, 1–15 seconds each, 15 seconds combined. Reference videos can be the only input; no image is required.
  • reference_audio_urls: up to 5 clips, 15 seconds combined.
  • In the prompt, refer to the reference videos as "Video 1", "Video 2", and so on.

Seedance 2.0 reference audio

seedance-2, seedance-2-fast, seedance-2-i2v and seedance-2-fast-i2v accept reference_audio_urls with their own rules. The model follows the voice, rhythm and mood of the clips.

  • Send up to 3 public https URLs, as a string or an array. Data URIs are not accepted.
  • Clips must be MP3 or WAV, 15 seconds combined.
  • At least one image is required (image_url or image_urls, up to 9). A request with audio and no image returns 400, even though the image-to-video input error also lists reference_audio_urls as an input.
  • With audio, every image is used as a reference, not as the first frame.
  • In the prompt, refer to the inputs as @Audio1, @Image1, and so on.
  • The price is the same as without audio.

Available models

The tables below list a selection of models. GET /v1/models?type=image,video returns every model with current pricing.

Text-to-video

ModelNameOptions
veo3
Google Veo 3 (Quality)
8 s
veo3-fast
Google Veo 3 (Fast)
8 s
veo3-lite
Google Veo 3.1 (Lite)
4, 6 or 8 s; 720p or 1080p
gemini-omni-1.1-flash
Google Gemini Omni 1.1 Flash
4, 6, 8 or 10 s; 360p, 720p or 1080p; 16:9 or 9:16; native audio
kling-2.5-turbo
Kling 2.5 Turbo
5 or 10 s
kling-3.0
Kling 3.0
5 or 10 s
seedance-2-5
ByteDance Seedance 2.5
4–30 s; native audio
seedance-2
ByteDance Seedance 2.0
4–15 s; native audio. Budget tier; seedance-2-fast is also available.
runway-gen4
Runway Gen-4
5 or 10 s; 720p or 1080p
runway-aleph
Runway Aleph
5 or 10 s

Image-to-video

These models take the input image in image_url.

ModelNameOptions
veo3-i2v
Google Veo 3 I2V
—
veo3-lite-i2v
Google Veo 3.1 Lite I2V
720p or 1080p
gemini-omni-1.1-flash-i2v
Google Gemini Omni 1.1 Flash I2V
One image; 4, 6, 8 or 10 s; 360p, 720p or 1080p; 16:9 or 9:16
seedance-2-5-i2v
Seedance 2.5 I2V
—
seedance-2-i2v
Seedance 2.0 I2V
Optional reference_audio_urls (see Seedance 2.0 reference audio). seedance-2-fast-i2v is also available.
kling-2.5-turbo-i2v
Kling 2.5 Turbo I2V
5 or 10 s

Code examples

import requests
import time

api_key = "YOUR_API_KEY"
headers = {
    "Content-Type": "application/json",
    "Authorization": f"Bearer {api_key}"
}

# Step 1: Submit video generation request
data = {
    "model": "kling-2.5-turbo",
    "prompt": "A golden retriever running through a meadow",
    "aspect_ratio": "16:9",
    "duration": "5"
}

response = requests.post(
    "https://api.ppq.ai/v1/videos",
    json=data,
    headers=headers
)
job = response.json()
generation_id = job["id"]
print(f"Job submitted: {generation_id}")

# Step 2: Poll for completion
while True:
    status_res = requests.get(
        f"https://api.ppq.ai/v1/videos/{generation_id}",
        headers=headers
    )
    status = status_res.json()

    if status["status"] == "completed":
        print(f"Video ready: {status['data']['url']}")
        break
    elif status["status"] == "failed":
        print(f"Error: {status.get('error')}")
        break

    print("Processing...")
    time.sleep(5)

Poll status

import requests

api_key = "YOUR_API_KEY"
generation_id = "gen_abc123"

response = requests.get(
    f"https://api.ppq.ai/v1/videos/{generation_id}",
    headers={"Authorization": f"Bearer {api_key}"}
)

result = response.json()
print(result)
# {"id": "gen_abc123", "model": "kling-2.5-turbo", "status": "completed",
#  "data": {"url": "https://api.ppq.ai/v1/media/gen_abc123/0?sig=...&exp=..."},
#  "cost": 0.4025}