Videos
Video generation with synchronous and asynchronous modes.
Generate videos from text prompts or images. Video generation can take several minutes, so the SDK supports both synchronous and asynchronous modes.
Basic Usage
Async Mode (Recommended)
Video generation can take several minutes. To avoid 502 timeouts from your proxy or CDN, use async mode.
Video generation in Python may be asynchronous by default. Check video_url to see if the video is ready, or use the async client:
Model Presets (JavaScript)
The JavaScript SDK exports VIDEO_MODEL_PRESETS for common provider model IDs:
Image-to-Video
Pass an imageUrl to animate an existing image:
VideoResult Properties
| Property | Python | JavaScript | Type | Description |
|---|---|---|---|---|
| ID | result.id | result.id | string | Request ID |
| Video URL | result.video_url | result.videoUrl | string | None | Generated video URL |
| Model | result.model | result.model | string | Model identifier |
| Provider | result.provider | result.provider | string | Provider name |
| Cost | result.cost | result.cost | float / number | Cost in USD |
| Cache hit | result.cache_hit | result.cacheHit | bool / boolean | Served from cache? |
| Latency | result.latency_ms | result.latencyMs | int | None / number | Latency in ms |
| Created at | result.created_at | result.createdAt | datetime / string | Timestamp |
Async Request Status
After starting an async generation, poll the request status: