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.
Video generation requires at least one credit purchase on the account. Signup credits are not enough. See Purchase required.
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, 15s |
veo-3.1 | Google Veo 3.1 | landscape, portrait | Yes | 4s, 6s, 8s |
veo-3.1-fast | Google Veo 3.1 Fast | landscape, portrait | Yes | 4s, 6s, 8s |
veo-3.1-lite | Google Veo 3.1 Lite | landscape, portrait | Yes | 4s, 6s, 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 |
| Veo 3.1 Fast | 3000 |
| Veo 3.1 Lite | 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
}'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"
}Errors
| Code | Description |
|---|---|
| 400 | Invalid request body, an unsupported model/size/duration combination, or source_image not found |
| 401 | Invalid API key |
| 402 | Insufficient credits (INSUFFICIENT_CREDITS) |
| 402 | Purchase required (MEDIA_REQUIRES_PURCHASE) |
| 403 | API key is missing the videos:generate scope |
| 429 | Rate limit exceeded |
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.
Errors
| Code | Description |
|---|---|
| 401 | Invalid API key |
| 403 | API key is missing the videos:read scope |
| 404 | Video generation not found |
| 429 | Rate limit exceeded |
See Also
- Upload Media — Upload source images for image-to-video
- Generate Images — Generate images instead
- Posts — Attach generated videos to posts
- Publish and schedule — Go live