API credit fields and examples use integer ledger units: 50 units = 1 customer credit. Divide API amounts by 50 for display. See current customer pricing; historical examples are not price quotes.
Generate Video
Generate videos from text prompts or images using state-of-the-art AI models.
Endpoint
/api/v1/jobsCreate a generate_video job
Seedance Video References
Use seedance-2.5-ref for a reference video plus optional images. PiAPI automatically reviews the reference assets before generation begins. Rejected assets fail the job and receive the usual refund. Upload the video to Vydra first. Each MP4 must be 2–15 seconds and at most 50 MB; combined video duration is capped at 30 seconds. Use video_url or video_urls (up to 10), with image_url or image_urls (up to 30). Camel-case videoUrl and imageUrl also work.
{
"workflow": "generate_video",
"input": {
"model": "seedance-2.5-ref",
"prompt": "Recreate @Video1 from directly overhead using @Image1 for appearance.",
"video_url": "VYDRA_UPLOADED_MP4_URL",
"image_url": "HTTPS_REFERENCE_IMAGE_URL",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}
}A five-second reference plus five-second output costs 1450 credits at 720p or 650 at 480p. Input duration is measured, rounded up, and billed at half the output rate; preview quotes assume the maximum reference length. Output duration must be an integer from 4 to 30. Use an explicit aspect ratio. Poll the returned job ID as usual. Test camera-angle results before publishing templates.
Supported Models
| Model | Credits | Notes |
|---|---|---|
| seedance-2.5-ref | 1450 for 5s reference + 5s output at 720p | Video references plus optional images. 480p/720p, output 4–30s. Billed on measured input plus output duration. |
| gemini-omni-flash | 600 / clip | Up to 10s, 720p. Text/image to video, or edit an uploaded video with a prompt. |
seedance-2.5 | 115 / second at 720p (480p 55, 1080p 575); 5s 720p = 600 | Recommended. Flagship quality/value: up to 30s single-shot, native audio, reference-to-video (max 9 images). 4-30s, defaults to 5s. Alias: seedance-2-5 |
veo3 | 110 | Default. High quality text-to-video |
kling-3.1 | 50 / second (5s = 100, 10s = 200) | Cheap, fast b-roll and motion |
seedance | 80 / second at 720p (fast 65, 480p standard 35 / fast 30, 1080p 200) | Alias of seedance-2 |
seedance-2 | 80 / second at 720p (fast 65, 480p standard 35 / fast 30, 1080p 200); 5s 720p = 400 | Budget quality/value (~half the credits of 2.5); text, single image, and multiple reference images; native audio. 4-15s, defaults to 15s |
grok-imagine | 150 | Creative and imaginative output |
Input Parameters
Request Body
| Name | Type | Description |
|---|---|---|
workflowrequired | string | "generate_video" |
input.promptrequired | string | Text description of the video to generate |
input.model | stringDefault: veo3 | Model to use |
input.aspect_ratio | stringDefault: 16:9 | Aspect ratio (e.g., '16:9', '9:16', '1:1') |
input.image_url | string | Image URL for image-to-video generation |
input.image_urls | string[] | Reference image URLs (max 9) for Seedance 2.5 / Seedance 2 reference-to-video; upload files first with /api/v1/upload |
input.resolution | stringDefault: 720p | '480p', '720p' or '1080p'. 1080p is supported on seedance-2.5 only |
input.duration | number | Target duration in seconds (seedance-2.5: 4-30, default 5; seedance-2: 4-15, default 15; kling-3.1: 5 or 10) |
webhookUrl | string | URL to receive completion notification |
Example Request
Create Video Job
curl -X POST https://vydra.ai/api/v1/jobs \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workflow": "generate_video",
"input": {
"prompt": "A golden retriever running on a beach at sunset, cinematic 4K",
"model": "veo3",
"aspect_ratio": "16:9"
}
}'Seedance Reference Images
// 1. Upload one or more reference images
const formData = new FormData();
formData.append('file', imageFile);
const uploadRes = await fetch('https://vydra.ai/api/v1/upload', {
method: 'POST',
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
body: formData
});
const { url } = await uploadRes.json();
// 2. Create a Seedance 2.5 generate_video job
const jobRes = await fetch('https://vydra.ai/api/v1/jobs', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
workflow: 'generate_video',
input: {
prompt: '15-second vertical product video with smooth camera motion',
model: 'seedance-2.5',
image_urls: [url],
aspect_ratio: '9:16',
duration: 15
}
})
});
const job = await jobRes.json();Example Response
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "running",
"workflow": "generate_video",
"creditsCharged": 110,
"createdAt": "2026-01-26T12:00:00.000Z",
"_links": {
"self": "https://vydra.ai/api/v1/jobs/550e8400-e29b-41d4-a716-446655440000",
"status": "https://vydra.ai/api/v1/jobs/550e8400-e29b-41d4-a716-446655440000"
}
}Image-to-Video
Provide an image_url to animate a static image:
{
"workflow": "generate_video",
"input": {
"prompt": "The character slowly turns and smiles",
"image_url": "https://example.com/character.png",
"model": "veo3"
}
}