Generate Videos
Create AI-generated videos from text prompts or source images.
Generate Videos
POST /api/v1/videos/generate
Generate AI videos from a text prompt or from a source image. Choose from multiple video models with different quality levels, durations, and audio support.
Request Body
| Field | Type | Default | Description |
|---|---|---|---|
prompt | string | — | Text description of the video to generate (required) |
size | string | landscape | landscape (16:9) or portrait (9:16) |
duration | integer | — | Duration in seconds, required. Must be one of the supported values for the chosen model (see table below) |
model | string | kling-3.0-pro | Video generation model |
has_audio | boolean | false | Generate with audio (only supported by some models) |
enhance_prompt | boolean | false | Let AI optimize your prompt for better results |
source_image | uuid | — | Media ID (UUID) of an uploaded image for image-to-video generation |
Models
| Model ID | Name | Sizes | Audio | Durations |
|---|---|---|---|---|
kling-3.0-pro | Kling 3.0 Pro | landscape, portrait | Yes | 5s, 10s |
veo-3.1 | Google Veo 3.1 | landscape, portrait | Yes | 4s, 8s |
runway-gen-4.5 | Runway Gen-4.5 | landscape, portrait | No | 5s, 10s |
Credit costs depend on the model, duration, and whether audio is enabled. The exact cost is returned in every API response via credits_used. See the pricing page for current rates.
Prompt Limits
| Model | Max Characters |
|---|---|
| Veo 3.1 | 3000 |
| Kling 3.0 Pro | 2500 |
| Runway Gen-4.5 | 1000 |
Example — Text-to-Video
curl -X POST https://powerpost.ai/api/v1/videos/generate \
-H "x-api-key: pp_live_sk_YOUR_KEY" \
-H "X-Workspace-Id: YOUR_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A golden retriever running through a field of wildflowers at sunset",
"size": "landscape",
"duration": 5,
"model": "kling-3.0-pro",
"has_audio": false
}'const res = await fetch('https://powerpost.ai/api/v1/videos/generate', {
method: 'POST',
headers: {
'x-api-key': 'pp_live_sk_YOUR_KEY',
'X-Workspace-Id': 'YOUR_WORKSPACE_ID',
'Content-Type': 'application/json',
},
body: JSON.stringify({
prompt: 'A golden retriever running through a field of wildflowers at sunset',
size: 'landscape',
duration: 5,
model: 'kling-3.0-pro',
has_audio: false,
}),
})
const data = await res.json()
console.log(data.video_generation_id)import requests
res = requests.post(
"https://powerpost.ai/api/v1/videos/generate",
headers={
"x-api-key": "pp_live_sk_YOUR_KEY",
"X-Workspace-Id": "YOUR_WORKSPACE_ID",
"Content-Type": "application/json",
},
json={
"prompt": "A golden retriever running through a field of wildflowers at sunset",
"size": "landscape",
"duration": 5,
"model": "kling-3.0-pro",
"has_audio": False,
},
)
data = res.json()
print(data["video_generation_id"])Response
{
"video_generation_id": "7a8b9c0d-e1f2-3456-abcd-ef7890123456",
"status": "processing",
"credits_used": 15,
"remaining_credits": 85,
"status_url": "/api/v1/videos/generations/7a8b9c0d-e1f2-3456-abcd-ef7890123456"
}Example — Image-to-Video
Upload an image first via Upload Media, then pass its media_id as source_image:
curl -X POST https://powerpost.ai/api/v1/videos/generate \
-H "x-api-key: pp_live_sk_YOUR_KEY" \
-H "X-Workspace-Id: YOUR_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"prompt": "The dog starts running and jumps over a fence",
"source_image": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
"size": "landscape",
"duration": 5,
"model": "kling-3.0-pro"
}'Get Video Generation Status
GET /api/v1/videos/generations/{id}
Poll this endpoint to check if your video is ready.
Response — Processing
{
"video_generation_id": "7a8b9c0d-...",
"status": "processing",
"prompt": "A golden retriever running...",
"size": "landscape",
"duration": 5,
"has_audio": false,
"model": "kling-3.0-pro",
"created_at": "2026-03-11T10:00:00Z"
}Response — Completed
{
"video_generation_id": "7a8b9c0d-...",
"status": "completed",
"prompt": "A golden retriever running...",
"size": "landscape",
"duration": 5,
"has_audio": false,
"model": "kling-3.0-pro",
"created_at": "2026-03-11T10:00:00Z",
"video": {
"media_id": "vid-001-abcd",
"url": "https://powerpost.ai/storage/videos/vid-001-abcd.mp4",
"thumbnail_url": "https://powerpost.ai/storage/thumbs/vid-001-abcd.jpg",
"width": 1920,
"height": 1080,
"duration": 5
}
}Response — Failed
{
"video_generation_id": "7a8b9c0d-...",
"status": "failed",
"prompt": "A golden retriever running...",
"size": "landscape",
"duration": 5,
"has_audio": false,
"model": "kling-3.0-pro",
"created_at": "2026-03-11T10:00:00Z",
"error": {
"code": "VIDEO_GENERATION_FAILED",
"message": "Video generation timed out"
}
}Video URLs are signed and valid for 7 days. Use media_id to reference the video permanently when
creating posts.
See Also
- Upload Media — Upload source images for image-to-video
- Generate Images — Generate images instead
- Posts & Publishing — Attach generated videos to posts