Back to Eliza

Video Generation

packages/cloud-frontend/content/api/video.mdx

2.0.13.6 KB
Original Source

import { Callout, Tabs } from "@/docs/components";

Video Generation

<div className="status-badge status-stable">Stable</div>

Generate AI-powered videos from text descriptions using the configured video model catalog.

Generate Video

<div className="api-endpoint"> <span className="method-badge method-badge-post">POST</span> <span className="path">/api/v1/generate-video</span> </div>

Create videos from text prompts.

Request

<Tabs items={['cURL', 'JavaScript', 'Python']}> <Tabs.Tab>

bash
curl -X POST "https://elizacloud.ai/api/v1/generate-video" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A butterfly flying through a colorful garden",
    "model": "fal-ai/veo3"
  }'

</Tabs.Tab> <Tabs.Tab>

javascript
const response = await fetch('https://elizacloud.ai/api/v1/generate-video', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    prompt: 'A butterfly flying through a colorful garden',
    model: 'fal-ai/veo3',
  }),
});

const data = await response.json();
console.log(data.video.url);

</Tabs.Tab> <Tabs.Tab>

python
import requests

response = requests.post(
    'https://elizacloud.ai/api/v1/generate-video',
    headers={
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json',
    },
    json={
        'prompt': 'A butterfly flying through a colorful garden',
        'model': 'fal-ai/veo3',
    }
)

data = response.json()
print(data['video']['url'])

</Tabs.Tab> </Tabs>

Parameters

ParameterTypeRequiredDescription
promptstringDescription of the video to generate
modelstringModel to use. Check the API Explorer for the current default.

Response

json
{
  "success": true,
  "video": {
    "url": "https://your-storage.vercel-storage.com/videos/abc123.mp4"
  },
  "model": "fal-ai/veo3"
}

Available Models

Model availability changes with provider catalogs and deployment configuration. Use /api/v1/models, the API Explorer, or the generated OpenAPI reference for the current video model list.

<Callout type="info"> Video pricing is model-specific and refreshed from fal provider pages. Default request costs vary materially by model; inspect the API Explorer or pricing summary endpoint for current ranges. </Callout>

Prompt Tips

Camera Movements

Include camera direction in prompts:

  • camera pan left/right
  • zoom in/out
  • dolly forward/backward
  • tracking shot
  • aerial view

Scene Description

Be specific about the scene:

json
{
  "prompt": "A golden retriever running through autumn leaves in a park, slow motion, cinematic lighting, tracking shot following the dog"
}
<Callout type="info"> Video generation typically takes 30-180 seconds depending on model and complexity. </Callout>

Error Handling

CodeErrorSolution
400Invalid promptCheck prompt is non-empty string
400Invalid modelUse a supported model from the list above
402Insufficient creditsAdd credits to your account
429Rate limitedWait and retry with exponential backoff
500Generation failedRetry, or try a different model