Generate Video

Generate videos from text prompts or images using state-of-the-art AI models.

Endpoint

POST
/api/v1/jobs

Create 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 1025 credits at 720p or 440 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

ModelCreditsNotes
seedance-2.5-ref1025 for 5s reference + 5s output at 720pVideo references plus optional images. 480p/720p, output 4–30s. Billed on measured input plus output duration.
gemini-omni-flash413 / clipUp to 10s, 720p. Text/image to video, or edit an uploaded video with a prompt.
seedance-2.5100 / second at 720p (480p 80, 1080p 415); 5s 720p = 500Recommended. 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
veo3110Default. High quality text-to-video
kling-3.150 / second (5s = 100, 10s = 200)Cheap, fast b-roll and motion
seedance80 / second at 720p (fast 65, 480p standard 55 / fast 45, 1080p 245)Alias of seedance-2
seedance-280 / second at 720p (fast 65, 480p standard 55 / fast 45, 1080p 245); 5s 720p = 400Budget quality/value (~half the credits of 2.5); text, single image, and multiple reference images; native audio. 4-15s, defaults to 15s
grok-imagine150Creative and imaginative output

Input Parameters

Request Body

NameTypeDescription
workflowrequiredstring"generate_video"
input.promptrequiredstringText description of the video to generate
input.modelstringDefault: veo3Model to use
input.aspect_ratiostringDefault: 16:9Aspect ratio (e.g., '16:9', '9:16', '1:1')
input.image_urlstringImage URL for image-to-video generation
input.image_urlsstring[]Reference image URLs (max 9) for Seedance 2.5 / Seedance 2 reference-to-video; upload files first with /api/v1/upload
input.resolutionstringDefault: 720p'480p', '720p' or '1080p'. 1080p is supported on seedance-2.5 only
input.durationnumberTarget duration in seconds (seedance-2.5: 4-30, default 5; seedance-2: 4-15, default 15; kling-3.1: 5 or 10)
webhookUrlstringURL 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

Response (201 Created)json
{
  "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:

Image-to-Video Request Bodyjson
{
  "workflow": "generate_video",
  "input": {
    "prompt": "The character slowly turns and smiles",
    "image_url": "https://example.com/character.png",
    "model": "veo3"
  }
}

Image Requirements

The image URL must be publicly accessible. Supported formats: PNG, JPEG, WebP.