Skip to main content
POST
/
v1
/
videos
/
generations
curl --request POST \
  --url https://toapis.com/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "kling-v3",
    "prompt": "A golden cat running on a sunlit meadow, slow motion, cinematic quality",
    "mode": "std",
    "duration": 5,
    "aspect_ratio": "16:9"
  }'
{
  "id": "<string>",
  "object": "<string>",
  "model": "<string>",
  "status": "<string>",
  "created_at": 123
}

Documentation Index

Fetch the complete documentation index at: https://docs.toapis.com/llms.txt

Use this file to discover all available pages before exploring further.

  • Async task API, returns a task ID after submission
  • Supports text-to-video, image-to-video, and first-last frame generation
  • mode=std maps to 720P, mode=pro maps to 1080P
  • audio=true generates an audio video and is billed as Sound
  • Text-to-video supports 15 seconds; image-to-video supports up to 10 seconds
Use publicly accessible image URLs. Do not pass base64 image data in image_urls; upload local images with the Upload Image API first.

Authorization

Authorization
string
required
All endpoints require Bearer Token authentication.
Authorization: Bearer YOUR_API_KEY

Request Parameters

model
string
required
Video generation model name, fixed as kling-v3.
prompt
string
required
Text prompt. Describe the subject, action, scene, camera movement, and style.Example: "A golden cat running on a sunlit meadow, slow motion, cinematic quality"
mode
string
default:"std"
Generation mode. This also determines the billing resolution.
  • std - standard mode, 720P
  • pro - professional mode, 1080P
duration
integer
default:"5"
Video duration in seconds.Options: 5, 10, 15
15 seconds is text-to-video only; image-to-video with image_urls supports up to 10 seconds.
aspect_ratio
string
default:"16:9"
Video aspect ratio.Common values: 16:9, 9:16, 1:1
image_urls
string[]
Image URL array for image-to-video.
  • 1 image: first-frame image-to-video
  • 2 images: first-last frame video, first image as first frame and second image as last frame
Up to 2 images.
audio
boolean
default:"false"
Whether to generate an audio video.
  • false - regular video
  • true - audio video, billed as Sound
metadata
object
Extended parameters.

Billing Mapping

Request ParametersBilling Spec
mode=std, audio=false720P
mode=pro, audio=false1080P
mode=std, audio=true720P+Sound
mode=pro, audio=true1080P+Sound

Response

id
string
Task ID for querying task status.
object
string
Object type, usually generation.task.
model
string
Model used for the request.
status
string
Task status: queued, in_progress, completed, or failed.
created_at
integer
Task creation timestamp.

Examples

Text-to-Video

{
  "model": "kling-v3",
  "prompt": "A golden cat running on a sunlit meadow, slow motion, cinematic quality",
  "mode": "std",
  "duration": 5,
  "aspect_ratio": "16:9"
}

1080P Video

{
  "model": "kling-v3",
  "prompt": "A rainy Tokyo street at night, neon lights reflected on wet pavement, cinematic camera",
  "mode": "pro",
  "duration": 10,
  "aspect_ratio": "16:9"
}

Image-to-Video

{
  "model": "kling-v3",
  "prompt": "The person in the frame slowly turns and smiles",
  "image_urls": ["https://example.com/portrait.jpg"],
  "mode": "std",
  "duration": 5
}

First-Last Frame

{
  "model": "kling-v3",
  "prompt": "The city naturally transitions from day to night",
  "image_urls": [
    "https://example.com/day.jpg",
    "https://example.com/night.jpg"
  ],
  "mode": "pro",
  "duration": 5
}

Audio Video

{
  "model": "kling-v3",
  "prompt": "A singer performing on stage, crowd cheering, flashing lights",
  "mode": "std",
  "duration": 5,
  "audio": true
}
Video generation is asynchronous. Use the Get Video Task Status endpoint to query progress and results.
curl --request POST \
  --url https://toapis.com/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "kling-v3",
    "prompt": "A golden cat running on a sunlit meadow, slow motion, cinematic quality",
    "mode": "std",
    "duration": 5,
    "aspect_ratio": "16:9"
  }'