Documentation
Video Generation
/v1/video/generations
Generate high-quality videos from text prompts using state-of-the-art models like Kling, Sora, and Veo. This endpoint provides a standardized interface for creating short video clips with customizable quality, aspect ratios, and duration.
Pro & Ultra Tiers Only
Please Use Resources Responsibly
Video generation models have significant computational costs that we pay directly to upstream providers. To ensure sustainable service for all users:
- Start with lighter models like Seedance Lite or Kling v2.1 for testing and iteration
- Use premium models (Veo, Sora 2 Pro) only when high quality output is truly necessary
- Optimize prompts before generating to minimize failed attempts
- Use shorter durations when possible to reduce resource consumption
Interactive Example
Request & Response Example
Authentication
Include your API key in the Authorization header.
Authorization: Bearer YOUR_API_KEYRequest Parameters
The API expects a JSON body with the following parameters.
model
stringprovider-2/kling-v2.1). See Available Models below.prompt
stringquality
string480p, 720p, 1080p. Note: 1080p is recommended for most models.duration
integer1 and 8. Note: Specific models have specific maximum limits (see Model Capabilities below).ratio
string1:1, 16:9, 9:16, 3:4, 4:3.Default: 9:16
Parameter Constraints & Validation
Duration: While the API accepts values up to 8 seconds, you must respect the specific limit of the requested model. Requesting 8s on a model capped at 5s will result in an error.
Quality: If a model does not support the requested quality (e.g., requesting 1080p on a model that only supports 720p), the API will return a 400 Bad Request.
Response Format
The API returns a JSON object containing the generated video data.
Important: Base64 Response
b64_json). The API does not currently store video files or return hosted URLs.created
integerdata
array of objectsb64_json
stringurl
string | nullrevised_prompt
string | nullAvailable Models & Capabilities
Different models have different performance characteristics and limitations. Refer to this table to choose the right parameters.
| Model ID | Provider | Max Duration | Supported Qualities | Recommendation |
|---|---|---|---|---|
provider-2/seedance-lite | Tencent | 5s | 1080p | ✓ Daily use |
provider-2/kling-v2.1 | Kuaishou | 5s | 720p, 1080p | ✓ Daily use |
provider-2/sora-2 | OpenAI | 4s | 720p, 1080p | Balanced |
provider-2/veo-fast | 8s | 720p, 1080p | Longer videos | |
provider-2/seedance-pro | Tencent | 5s | 1080p | Use sparingly |
provider-2/sora-2-pro | OpenAI | 5s | 720p, 1080p | Use sparingly |
provider-2/veo | 8s | 720p, 1080p | Use sparingly |
🏃 Longest Duration
Veo models support up to 8 seconds—the longest duration available.
💡 Recommended for Daily Use
Seedance Lite and Kling v2.1 offer great quality with efficient resource usage.
⭐ Premium Quality
Veo and Sora 2 Pro deliver the highest quality—use when truly needed.
Common Errors
| Status Code | Error Code | Description |
|---|---|---|
400 | invalid_request_error | Validation Error: Occurs if duration is not an integer, quality is missing, or parameters are out of allowed ranges. |
400 | n_exceeds_model_limit | The requested duration or quality exceeds what the specific model supports. |
401 | invalid_api_key | Your API key is missing or invalid. |
403 | permission_denied_error | The requested model is not available on your current subscription plan (Pro or Ultra required). |
429 | rate_limit_exceeded | You have exceeded your rate limits or daily quota. |
500 | provider_error | The upstream video generation service failed to produce the video. Please try again. |
Was this page helpful?