> ## Documentation Index
> Fetch the complete documentation index at: https://docs.havincy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate videos

> Text-to-video and image-to-video with Kling, Veo, Seedance and more.

## Text to video

```bash theme={null}
curl -X POST https://havincy.com/api/v1/generations \
  -H "Authorization: Bearer $HAVINCY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "modality": "video",
    "model_id": "fal-kling-v3-pro",
    "prompt": "A small robot walks along a beach at sunset, cinematic tracking shot",
    "aspect_ratio": "9:16",
    "duration": 5,
    "resolution": "1080p",
    "generate_audio": true
  }'
```

The response returns the asset with status `queued`. Video generation usually takes from 1 to several minutes: [poll the asset](/guides/async-and-polling) until it is `completed`.

## Image to video

Add one reference image to animate it (the model must accept references):

```json theme={null}
{
  "modality": "video",
  "model_id": "fal-kling-v3-pro",
  "prompt": "The character turns and smiles, slow camera push-in",
  "reference_image_urls": ["https://example.com/portrait.jpg"],
  "duration": 5
}
```

## Options

Valid values depend on the model. `GET /models?modality=video` returns for each model:

* `options.durations_seconds`
* `options.aspect_ratios`
* `options.resolutions`
* `options.generate_audio` (when the model can generate native sound)

The cost is given by `credits_per_output`.

<Tip>Need a viral effect from a photo rather than a free-form video? Use [Encore effects](/guides/encore-effects): one parameter, no prompt.</Tip>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.