# Input fields

Every model reads the same field names, so a request keeps its shape when you change model. Send only the fields the model lists in its `params` (`GET /v1/models/{id}`): any other field is refused with `400`, never silently dropped. The one exception: a field a model has stopped taking is ignored, and the answer says so in `warnings` (see below). Build on `params` only.

| Field | Type | Limits | What it is |
| - | - | - | - |
| `prompt` | string | the model's `params.prompt.max` characters (20,000 at most) | What to make. |
| `negative_prompt` | string | 5,000 characters | What to avoid. |
| `images` | array of files | The model's `max` (16 when it lists none; 30 on `seedance-2.5`) | Reference images. A first frame or main reference goes first. |
| `image_mode` | string | `first_frame` or `reference` | How images are read: as a first frame or as references. Left out, one image alone is the first frame and two or more are references. The model page always sends `reference`. |
| `end_image` | file | | The last frame, for models that take one. Sent with one image as the first frame. |
| `video` | file | | A reference or source clip. Its seconds are billed too, see [Billing](/docs/billing#reference-video). |
| `videos` | array of files | The model's `max`, counted with `video` (10 on `seedance-2.5`) | More reference clips, after video. Every clip's seconds are billed. On `seedance-2.5`: MP4 or MOV, 480p to 1080p, up to 100 MB, up to 30 s in total (each clip at least 2 s); a reference video bills at least 5/3 of the output's length. |
| `audio` | file | | A source sound (lip sync, speech to video). On `seedance-2.5`, a reference sound. On `vidlab-video-flash`, the voice reference for Talking Video (any playable audio or video file up to 200 MB, converted on our backend). Optional there: if you leave it out, the model speaks in its own voice. |
| `audios` | array of files | The model's `max`, counted with `audio` (10 on `seedance-2.5`) | More reference sounds, after audio. On `seedance-2.5`: MP3 or WAV, up to 15 MB, up to 30 s in total (each clip at least 2 s). On `vidlab-audio-1`: 1 to 3 recordings of the voice to speak in, named `@Audio1` to `@Audio3` in the prompt ([how](/docs/model-list#vidlab-audio-1)). |
| `duration` | number | The model's `min` and `max`, or its `values` | Seconds of output. For lip sync and similar models, see [Length from a file](#length-from-a-file). |
| `resolution` | string | The model's `values` | For example `720p` or `2k`. |
| `aspect_ratio` | string | The model's `values` | For example `9:16`, `1:1`, `16:9`. |
| `quality` | string | The model's `values` | For example `turbo` or `quality`. |
| `generate_audio` | boolean | | Ask for sound where the model makes it. Selects the `+audio` price. |
| `seed` | integer | | Repeatable results where the model supports it. |
| `n` | integer | 1 to the model's `max` (4 at most today) | How many images. |
| `text` | string | the model's `params.text.max` characters (20,000 at most) | Text to speak, for voice models that take it; your own lyrics, for music models. `vidlab-audio-1` takes the words in `prompt` instead. |
| `voice` | string | | A voice id or name, for voice models. |
| `accent` | string | 80 characters | Optional spoken accent hint. For example American, British, Canadian or Western, on `vidlab-video-flash`. |
| `extra` | object | 8 KB as JSON | Model-specific options. Only the keys a model allows are used. |

Every model's page has an API reference for each task it does: the endpoint, a request for that model in cURL, Python and JavaScript, and this table filled in with the model's own fields and limits.

Options differ by model. Read a model's `params` (`GET /v1/models/{id}`) or open it on the [models page](/models): `seedance-2.5`, for example, lists `resolution`, `duration` with its `min` and `max`, `aspect_ratio`, up to 30 `images`, 10 reference videos (`video` and `videos`) and 10 reference sounds (`audio` and `audios`).

A **file** is a public https link, a link from [Uploads](/docs/uploads), or a small base64 data URL. Values are matched without regard to letter case (`720P` reads as `720p`). A field that changes the price and is left out gets the model's first allowed value, so the quote and the run always agree.

## What a bad input answers

A request that breaks a model's `params` is refused before anything is held. The message names the field and says what is allowed.

| You sent | Answer |
| - | - |
| A field the model does not take | `400 invalid_input`: "`n` is not an option of this model. It takes: resolution, prompt, images, ..." |
| A name that is not an input field | `400 invalid_request`: "input: Unrecognized key: "colour"" |
| A value outside `values` | `400 invalid_input`: "`resolution` must be one of: 480p, 720p, 1080p." |
| A `duration` outside `min` and `max` | `400 invalid_input`: "`duration` must be between 4 and 30." |
| Too many images | `400 invalid_input`: "This model takes at most 16 images." |
| Too many reference clips | `400 invalid_input`: "This model takes at most 10 reference videos (`video` and `videos` together)." |
| A file that is not a link or data URL | `400 invalid_input`: "`images[0]` must be an https URL or a base64 data URL (data:image/png;base64,...)." |
| A missing required field | `400 invalid_input`: "`prompt` is required." |
| A combination with no price | `400 variant_unavailable`: "... Priced options: 480p, 720p, 1080p." |

## Warnings

When a model stops taking a field it used to list, a request that still sends it is not refused at once: the field is ignored before the price is worked out, nothing about it reaches the model, and the answer to the estimate, the quote and the submit carries a `warnings` list:

```json
"warnings": [
  { "code": "param_ignored", "param": "seed", "message": "`seed` is not an option of this model any more, so it was ignored. Leave it out of your requests." }
]
```

`value_lowered` means a number over what the model now makes was priced and run at its maximum. Treat any warning as a change to make in your code: the field is no longer in the model's `params`. A field a model never took is still refused with `400`.

## Length from a file

Some models take their length from an input: lip sync, speech to video, video upscales, video edits and motion control. Their catalogue entry lists `duration_must_cover` (for example `["video", "audio"]`). You still send `duration`, and the generation is priced on it. It must be at least as long as the file, in whole seconds rounded up.

- A file longer than `duration` fails the generation with `invalid_input`. The message says the `duration` to send. Nothing is charged.
- A file longer than the model's `max` fails with `invalid_input`, and the message says how long the model takes.
- A clip that measures 5.02 seconds counts as 5: up to a tenth of a second over is forgiven.

## Examples by kind

Each example is a request body for `POST /v1/generations`. Read the model's `params` first: options differ from model to model.

### Text to video

```bash cURL
curl -s -X POST https://vidlab.ai/v1/generations \
  -H "Authorization: Bearer $VIDLAB_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: docs-text-to-video-$(uuidgen)" \
  -d '{ "model": "seedance-2.5", "input": { "prompt": "A slow push-in on a perfume bottle on wet black stone", "resolution": "720p", "duration": 5, "aspect_ratio": "9:16" } }'
```

### Image to video, and first and last frame

`images` holds the first frame; `end_image` the last, on models that list it.

```bash cURL
curl -s -X POST https://vidlab.ai/v1/generations \
  -H "Authorization: Bearer $VIDLAB_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: docs-first-last-frame-$(uuidgen)" \
  -d '{ "model": "kling-3.0", "input": { "prompt": "She smiles and lifts the cup", "images": ["https://example.com/start.jpg"], "end_image": "https://example.com/end.jpg", "resolution": "720p", "duration": 5 } }'
```

### Many references (Seedance 2.5)

`seedance-2.5` has one way to make a video: a prompt, and any assets you want it to follow. Send up to 30 `images`, 10 reference clips (`videos`) and 10 reference sounds (`audios`) in one call, of any mix. Name them in the prompt by type and position, counted from 1: `@Image 1` is the first of `images`, `@Video 1` the first of `videos`, `@Audio 1` the first of `audios`. The model page sends every image as a reference (`"image_mode": "reference"`); send the same so one picture is not read as the first frame.

| Asset | How many | Files | Length |
| - | - | - | - |
| Images (`images`) | up to 30 | JPEG, PNG or WEBP (a WEBP is turned into PNG, losslessly), up to 20 MB | |
| Videos (`videos`) | up to 10 (with `video`) | MP4 or MOV, 480p to 1080p, up to 100 MB | up to 30 s in total, each at least 2 s |
| Audio (`audios`) | up to 10 (with `audio`) | MP3 or WAV, up to 15 MB | up to 30 s in total, each at least 2 s |

- The same limits are in the model's `params` (each list's `file`). A file outside them ends the generation as `invalid_input`, `input_too_large` or `input_too_long` before anything is charged, and the message names the file.
- A sound alone (no image or clip) is taken.
- **A reference video bills at least 5/3 of the output's length.** Billed seconds are the output's plus the clips' (any part of a second dropped), at the `+video_input` price, and never fewer than ⌈5/3 × output⌉: 5 s of output with clips of 3 and 4 s bills 12 s; 5 s with one 2 s clip bills 9 s. Until the clips are measured, the quote assumes each one as long as the output, and never more than 30 seconds in all; send `extra.video_seconds` (their total) for an exact quote. Images and sounds are free.
- Left out, or `adaptive`, `aspect_ratio` follows the first picture (else the first clip): the nearest of 21:9, 16:9, 4:3, 1:1, 3:4 and 9:16. With sounds only it is 16:9. Sound is on unless `generate_audio` is `false`.
- A first frame (one image with `"image_mode": "first_frame"`, and `end_image` for a last frame) still works, alone: mixed with more pictures, clips or sounds it is refused with `400 invalid_input` at once.
- The prompt can be up to 20,000 characters, and at most 40,000 bytes (so about 13,000 Chinese or Japanese characters).
- There is no `seed` (one sent is ignored, and the answer says so under `warnings`), no `negative_prompt`, no draft render and no edit or extend mode on this model.
- `extra` takes `video_seconds` (the clips' total, for the quote) and nothing else that matters: any key the model does not list in `params.extra.keys` is refused with `400 invalid_input`, never ignored.

```bash cURL
curl -s -X POST https://vidlab.ai/v1/generations \
  -H "Authorization: Bearer $VIDLAB_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: docs-seedance-references-$(uuidgen)" \
  -d '{ "model": "seedance-2.5", "input": { "prompt": "The woman in @Image 1 dances to @Audio 1, moving like the dancer in @Video 1, in the room from @Image 2", "images": ["https://example.com/woman.png", "https://example.com/room.png"], "videos": ["https://example.com/dance.mp4"], "audios": ["https://example.com/beat.mp3"], "resolution": "720p", "duration": 10, "aspect_ratio": "9:16", "extra": { "video_seconds": 6 } } }'
```

### Video with sound

`generate_audio: true` selects the `+audio` price on models that make sound.

```bash cURL
curl -s -X POST https://vidlab.ai/v1/generations \
  -H "Authorization: Bearer $VIDLAB_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: docs-video-with-sound-$(uuidgen)" \
  -d '{ "model": "kling-3.0", "input": { "prompt": "Rain on a window, a soft piano", "resolution": "720p", "duration": 5, "generate_audio": true } }'
```

### Reference video

`video` is a clip to follow. Where the model lists a `+video_input` price, it applies, and the clip's seconds are billed at that rate.

```bash cURL
curl -s -X POST https://vidlab.ai/v1/generations \
  -H "Authorization: Bearer $VIDLAB_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: docs-reference-video-$(uuidgen)" \
  -d '{ "model": "kling-4.0", "input": { "prompt": "Same camera move, a red sports car", "video": "https://example.com/reference.mp4", "resolution": "720p", "duration": 5 } }'
```

### Images: generate, several, edit

`n` is how many images; an edit sends the picture in `images`.

```bash cURL
curl -s -X POST https://vidlab.ai/v1/generations \
  -H "Authorization: Bearer $VIDLAB_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: docs-image-several-$(uuidgen)" \
  -d '{ "model": "gpt-image-2", "input": { "prompt": "A red sneaker on white", "resolution": "1k", "aspect_ratio": "1:1", "n": 2 } }'
```

```bash cURL
curl -s -X POST https://vidlab.ai/v1/generations \
  -H "Authorization: Bearer $VIDLAB_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: docs-image-edit-$(uuidgen)" \
  -d '{ "model": "gpt-image-2", "input": { "prompt": "Make the sneaker blue", "images": ["https://example.com/sneaker.jpg"], "resolution": "1k" } }'
```

### Voice-over

`prompt` holds the voice and the words: describe how it should sound, then write what to say. Priced per second of the audio made.

```bash cURL
curl -s -X POST https://vidlab.ai/v1/generations \
  -H "Authorization: Bearer $VIDLAB_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: docs-voice-over-$(uuidgen)" \
  -d '{ "model": "vidlab-audio-1", "input": { "prompt": "A warm, friendly woman in her thirties, calm morning voice, says: \"Fresh coffee, delivered before you wake up.\"" } }'
```

### Music

```bash cURL
curl -s -X POST https://vidlab.ai/v1/generations \
  -H "Authorization: Bearer $VIDLAB_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: docs-music-$(uuidgen)" \
  -d '{ "model": "suno-v6", "input": { "prompt": "A warm lo-fi beat with soft keys" } }'
```

