# Veo 3.1 API

> Google's flagship video model: short, finished shots with dialogue, ambience and effects generated together with the picture, up to 4K.

Veo 3.1 by Google, called with one Frameport API key: from $0.235 per second of video, charged only when the clip succeeds.

- Model id: `veo-3-1`
- Type: video
- Maker: Google
- Tasks: Text to video, Image to video, First + last frame
- Endpoint: `POST https://frameport.ai/v1/videos/generations`
- Page: https://frameport.ai/models/veo-3-1
- Every model, as JSON: https://frameport.ai/models.json

## Pricing

| Resolution | Silent, per second | With sound, per second |
| --- | --- | --- |
| 720p | $0.235 | $0.465 |
| 1080p (default) | $0.235 | $0.465 |
| 4K | $0.465 | $0.695 |

- Charged once, and only when the clip succeeds. A failed job costs $0.00: its hold is released in full.
- The exact price is known before the run: the API returns it as `reserved_usd` when it accepts the job.
- Billed on the seconds you ask for; sound off bills the silent rate.

## Options

| Option | Value |
| --- | --- |
| Tasks | Text to video, Image to video, First + last frame |
| Resolutions | 720p, 1080p, 4K |
| Durations | 4 s, 6 s, 8 s |
| Aspect ratios | 16:9, 9:16 |
| Audio | On or off, priced apart |
| Input pictures | First frame, or first + last frame |
| Seed | Supported |
| Negative prompt | Supported |
| Prompt | Up to 2,400 characters |
| Output | A video file, signed link valid about an hour |
| Billing unit | Per second of video |
| Model id | `veo-3-1` |

## Veo 3.1 API parameters

`POST https://frameport.ai/v1/videos/generations` with a JSON body and your key as a Bearer token:

| Field | Values | Notes |
| --- | --- | --- |
| `model` (required) | "veo-3-1" | Required. |
| `prompt` (required) | text, up to 2,400 characters | Required: the subject, the action, the camera and the sound. |
| `duration` | 4, 6 or 8 seconds | 4 when left out. A value off the grid is refused before anything is held. |
| `resolution` | 720p, 1080p and 4K | 1080p when left out. A second costs 720p $0.465, 1080p $0.465, 4K $0.695. |
| `aspect_ratio` | 16:9, 9:16 | 16:9 when left out. |
| `audio` | true or false | true when left out. Sound costs more per second; false bills the silent rate. |
| `reference_images` | 1 picture | The first frame: an https URL or a base64 data URI. |
| `end_image` | 1 picture | The last frame; needs a first frame in reference_images. |
| `seed` | 0 to 2147483647 | The same seed and request give a similar take again. |
| `negative_prompt` | text, up to 1,000 characters | What to keep out of the clip. |

## Veo 3.1 request bodies, one per mode

### Text to video · $1.86

```json
{
  "model": "veo-3-1",
  "prompt": "A lighthouse keeper climbs the spiral stairs at dusk, slow push-in, wind howling, footsteps on iron",
  "duration": 4,
  "resolution": "1080p",
  "aspect_ratio": "16:9",
  "audio": true
}
```

### Image to video · $1.86

```json
{
  "model": "veo-3-1",
  "prompt": "The scene in the picture comes to life: slow push-in, leaves moving in the wind",
  "duration": 4,
  "resolution": "1080p",
  "aspect_ratio": "16:9",
  "audio": true,
  "reference_images": [
    "https://example.com/first-frame.jpg"
  ]
}
```

### First + last frame · $1.86

```json
{
  "model": "veo-3-1",
  "prompt": "The sketch fills with colour until it becomes the finished painting",
  "duration": 4,
  "resolution": "1080p",
  "aspect_ratio": "16:9",
  "audio": true,
  "reference_images": [
    "https://example.com/sketch.jpg"
  ],
  "end_image": "https://example.com/painting.jpg"
}
```

## Submit, poll, download

### cURL

```bash
# 1. Submit: the price is held on your balance (reserved_usd)
curl https://frameport.ai/v1/videos/generations \
  -H "Authorization: Bearer $FRAMEPORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "veo-3-1",
    "prompt": "A lighthouse keeper climbs the spiral stairs at dusk, slow push-in, wind howling, footsteps on iron",
    "duration": 4,
    "resolution": "1080p",
    "aspect_ratio": "16:9",
    "audio": true
  }'

# 2. Poll with the id it returns, until "succeeded" or "failed"
curl https://frameport.ai/v1/videos/generations/$GENERATION_ID \
  -H "Authorization: Bearer $FRAMEPORT_API_KEY"

# 3. Download outputs[0].url once it has succeeded (a signed link, no key needed)
curl -L "$OUTPUT_URL" -o out.mp4
```

### Python

```python
import os, time
import requests

API = "https://frameport.ai/v1"
headers = {"Authorization": f"Bearer {os.environ['FRAMEPORT_API_KEY']}"}

# 1. Submit: the price is held on your balance (reserved_usd)
gen = requests.post(f"{API}/videos/generations", headers=headers, json={
    "model": "veo-3-1",
    "prompt": "A lighthouse keeper climbs the spiral stairs at dusk, slow push-in, wind howling, footsteps on iron",
    "duration": 4,
    "resolution": "1080p",
    "aspect_ratio": "16:9",
    "audio": True,
}).json()
if gen.get("error"):
    raise SystemExit(gen["error"]["message"])

# 2. Poll until it succeeds or fails
while gen["status"] in ("queued", "running"):
    time.sleep(3)
    gen = requests.get(f"{API}/videos/generations/{gen['id']}", headers=headers).json()

# A failed generation costs nothing: the hold is released
if gen["status"] == "failed":
    raise SystemExit(gen["error"]["message"])

# 3. Download the file (a signed link, no key needed)
file = requests.get(gen["outputs"][0]["url"])
open("out.mp4", "wb").write(file.content)
print("saved out.mp4", gen["cost_usd"])
```

### JavaScript

```js
import { writeFile } from 'node:fs/promises'

const API = 'https://frameport.ai/v1'
const headers = {
  'Authorization': `Bearer ${process.env.FRAMEPORT_API_KEY}`,
  'Content-Type': 'application/json',
}

// 1. Submit: the price is held on your balance (reserved_usd)
let gen = await fetch(`${API}/videos/generations`, {
  method: 'POST',
  headers,
  body: JSON.stringify({
    model: 'veo-3-1',
    prompt: 'A lighthouse keeper climbs the spiral stairs at dusk, slow push-in, wind howling, footsteps on iron',
    duration: 4,
    resolution: '1080p',
    aspect_ratio: '16:9',
    audio: true,
  }),
}).then(res => res.json())
if (gen.error) throw new Error(gen.error.message)

// 2. Poll until it succeeds or fails
while (gen.status === 'queued' || gen.status === 'running') {
  await new Promise(resolve => setTimeout(resolve, 3000))
  gen = await fetch(`${API}/videos/generations/${gen.id}`, { headers }).then(res => res.json())
}
// A failed generation costs nothing: the hold is released
if (gen.status === 'failed') throw new Error(gen.error.message)

// 3. Download the file (a signed link, no key needed)
const file = await fetch(gen.outputs[0].url)
await writeFile('out.mp4', Buffer.from(await file.arrayBuffer()))
console.log('saved out.mp4', gen.cost_usd)
```

## What Veo 3.1 is good at

- Clips meant to be watched with the sound on: room tone, footsteps and a line of dialogue arrive with the picture.
- Strong prompt adherence and believable physics.
- Output up to 4K.
- A first and a last frame, a seed and a negative prompt.

### When another model fits better

- [Hailuo 3](https://frameport.ai/models/hailuo-3.md) (`hailuo-3`): Longer clips: up to 15 seconds, from $0.15 / s.
- [Veo 3.1 Fast](https://frameport.ai/models/veo-3-1-fast.md) (`veo-3-1-fast`): Cheaper drafts: from $0.093 / s.

## How to prompt Veo 3.1

1. Write the sound as precisely as the picture: "rain on a tin roof, a kettle starting to whistle" beats "ambient sounds".
2. Keep dialogue short, in quotes and attributed: one or two lines fill a clip.
3. Think in shots, not scenes: one beat per clip.
4. Put what must not appear in negative_prompt rather than negating inside the prompt.

Sample prompt: “A lighthouse keeper climbs the spiral stairs at dusk, slow push-in, wind howling, footsteps on iron”

## Veo 3.1 and the other Google video models

| Model | Model id | From, a second | Up to | Longest | Pictures | Sound |
| --- | --- | --- | --- | --- | --- | --- |
| [Veo 3.1 Lite](https://frameport.ai/models/veo-3-1-lite.md) | `veo-3-1-lite` | $0.036 | 1080p | 8 s | First frame, or first + last frame | On or off, priced apart |
| [Veo 3.1 Fast](https://frameport.ai/models/veo-3-1-fast.md) | `veo-3-1-fast` | $0.093 | 4K | 8 s | First frame, or first + last frame | On or off, priced apart |
| Veo 3.1 | `veo-3-1` | $0.235 | 4K | 8 s | First frame, or first + last frame | On or off, priced apart |

## About the Veo 3.1 API

### How much does the Veo 3.1 API cost?

Veo 3.1 is billed per second of video: $0.465 at 720p, $0.465 at 1080p and $0.695 at 4K with sound (less without). A 4-second clip at 1080p costs $1.86. You are charged once, only when the clip succeeds.

### How do I call Veo 3.1 from code?

Send POST /v1/videos/generations with "model": "veo-3-1" and a prompt, your API key as a Bearer token. The answer is a generation with an id: poll GET /v1/videos/generations/{id} until its status is succeeded, then download outputs[0].url.

### What happens if a Veo 3.1 generation fails?

Nothing is charged. The price is held on your balance when the job starts and released in full if it fails: cost_usd stays at 0.

### How long can a Veo 3.1 clip be?

4, 6 or 8 seconds. Set duration in seconds: a length off the grid is refused before anything is held.

### Can Veo 3.1 start from an image?

Yes: send the picture as the first item of reference_images and it becomes the first frame. Add end_image and the clip lands on that last frame.

### Do I need a subscription?

No. You top up a prepaid balance in dollars, from $10, and it never expires. Every model runs on the same balance and the same API key.

## Compare with similar models

- [Hailuo 3](https://frameport.ai/models/hailuo-3.md) (`hailuo-3`): MiniMax, from $0.15 per second of video
- [Runway Gen-4.5](https://frameport.ai/models/runway-gen-4-5.md) (`runway-gen-4-5`): Runway, from $0.14 per second of video
- [Seedance 2.5](https://frameport.ai/models/seedance-2-5.md) (`seedance-2-5`): ByteDance, from $0.12 per second of video
- [Veo 3.1 Fast](https://frameport.ai/models/veo-3-1-fast.md) (`veo-3-1-fast`): Google, from $0.093 per second of video
- [Grok Imagine](https://frameport.ai/models/grok-imagine.md) (`grok-imagine`): xAI, from $0.093 per second of video
- [Seedance 2.0](https://frameport.ai/models/seedance-2-0.md) (`seedance-2-0`): ByteDance, from $0.08 per second of video
