# Deployments: Video

A video deployment answers `/v1/videos`. It is priced for each second of video that the buyer asks for. The job returns when your agent accepts it, and the buyer polls for the file.

[Deployments](https://liquidinference.ai/docs/provider-models.md) has the fields that every kind shares, the listing statuses and the lifecycle. This page has what is special to this kind.

## Register a deployment

Copy the request, set your provider key and change the names. Every endpoint here takes the [provider key](https://liquidinference.ai/docs/provider.md) as a bearer token.

```bash
curl https://router.inference.ai.exchange/v1/provider/models \
  -H "Authorization: Bearer $LIQUID_PROVIDER_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "kind": "video_generation",
      "deployment_name": "kling-v3",
      "creator": "kuaishou",
      "precision": "bf16",
      "region": "us-east",
      "max_input_tokens": 4096,
      "input_modalities": [
        {
          "type": "text"
        },
        {
          "type": "image",
          "max_references": 2,
          "supported_frame_images": [
            "first_frame",
            "last_frame"
          ]
        }
      ],
      "output_modalities": [
        {
          "type": "text"
        },
        {
          "type": "video",
          "formats": [
            "video/mp4"
          ],
          "seconds": [
            5,
            10
          ],
          "resolutions": [
            "720p",
            "1080p"
          ],
          "aspect_ratios": [
            "16:9",
            "9:16",
            "1:1"
          ],
          "audio": "optional"
        }
      ]
    }'
```

```python
import os
import requests

response = requests.post(
    "https://router.inference.ai.exchange/v1/provider/models",
    headers={"Authorization": f"Bearer {os.environ['LIQUID_PROVIDER_KEY']}"},
    json={
        "kind": "video_generation",
        "deployment_name": "kling-v3",
        "creator": "kuaishou",
        "precision": "bf16",
        "region": "us-east",
        "max_input_tokens": 4096,
        "input_modalities": [
            {
                "type": "text"
            },
            {
                "type": "image",
                "max_references": 2,
                "supported_frame_images": [
                    "first_frame",
                    "last_frame"
                ]
            }
        ],
        "output_modalities": [
            {
                "type": "text"
            },
            {
                "type": "video",
                "formats": [
                    "video/mp4"
                ],
                "seconds": [
                    5,
                    10
                ],
                "resolutions": [
                    "720p",
                    "1080p"
                ],
                "aspect_ratios": [
                    "16:9",
                    "9:16",
                    "1:1"
                ],
                "audio": "optional"
            }
        ]
    },
)
response.raise_for_status()
print(response.json()["status"])
```

```typescript
const response = await fetch('https://router.inference.ai.exchange/v1/provider/models', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.LIQUID_PROVIDER_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    kind: 'video_generation',
    deployment_name: 'kling-v3',
    creator: 'kuaishou',
    precision: 'bf16',
    region: 'us-east',
    max_input_tokens: 4096,
    input_modalities: [
      {
        type: 'text',
      },
      {
        type: 'image',
        max_references: 2,
        supported_frame_images: ['first_frame', 'last_frame'],
      },
    ],
    output_modalities: [
      {
        type: 'text',
      },
      {
        type: 'video',
        formats: ['video/mp4'],
        seconds: [5, 10],
        resolutions: ['720p', '1080p'],
        aspect_ratios: ['16:9', '9:16', '1:1'],
        audio: 'optional',
      },
    ],
  }),
})
if (!response.ok) throw new Error(await response.text())
console.log((await response.json()).status)
```

The answer is `201` with the registration. A new registration is `UNLISTED`. `kind` cannot change: a new kind returns `409 kind_changed`.

## What you declare

| Field                                     | Where          | Meaning                                                                                                                                                                   |
| ----------------------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `formats`                                 | `video` output | Formats it makes, such as `video/mp4`.                                                                                                                                    |
| `seconds`                                 | `video` output | The lengths it renders, such as `[4, 8]`. A length that you did not list does not reach you.                                                                              |
| `sizes`                                   | `video` output | Pixel sizes, such as `1280x720`.                                                                                                                                          |
| `aspect_ratios`                           | `video` output | Shapes, for an upstream that gives no pixel sizes. See [Shapes without pixel sizes](#shapes-without-pixel-sizes).                                                         |
| `resolutions`                             | `video` output | Labels such as `720p`, in lower case.                                                                                                                                     |
| `resolution_seconds`, `reference_seconds` | `video` output | Lengths that depend on the resolution or on reference images. See [Lengths that depend on the resolution](#lengths-that-depend-on-the-resolution-or-on-reference-images). |
| `audio`                                   | `video` output | `none`, `always` or `optional`. See [Sound, resolution and price](#sound-resolution-and-price).                                                                           |
| `target_languages`                        | `video` output | Languages it dubs into, as lower-case ISO 639-1 codes such as `es`.                                                                                                       |
| `supported_frame_images`                  | `image` input  | `first_frame`, `last_frame`. See [Frame images](#frame-images).                                                                                                           |

A video request states its length before the job starts, from 1 to 30 seconds. List every length that the deployment renders in `seconds`, for example `[4, 5, 6, …, 30]`. A request for a length that you did not list does not reach you, and registration refuses a length above 30. A request with no `seconds` gets the shortest length that any offer lists, or 4 when none lists one.

## Frame images

A buyer can fix the first or last frame of a video. Declare each frame that your upstream reads in `supported_frame_images` on the `image` input. A deployment that declares no frame never gets an image that has one.

```json
"input_modalities": [
  { "type": "text" },
  { "type": "image", "max_references": 2, "supported_frame_images": ["first_frame", "last_frame"] }
]
```

## Shapes without pixel sizes

Some upstreams document a resolution, such as `720p`, and a shape, such as `16:9`, but not the pixel size. Do not guess the pixels. List the shapes in `aspect_ratios` and leave `sizes` empty.

```json
{
  "type": "video",
  "aspect_ratios": ["16:9", "9:16", "19.5:9"],
  "resolutions": ["720p", "1080p"],
  "seconds": [5, 10]
}
```

- Write each shape as `<width>:<height>`. Each side is a number with at most two decimals. Registration refuses `16x9` and `auto`. The exchange reads `19.5:9` as the shape `13:6`, so `39:18` is the same shape.
- A request for a shape reaches you only when you list that shape. A request for a `size` reaches you when its shape is one of yours.
- If you list `sizes`, the exchange matches on the sizes and ignores `aspect_ratios`.
- The dispatch holds `aspect_ratio` in the `video` object when no offer lists a pixel size that has the shape. Send it to your upstream.
- A start image must have the shape that the buyer asked for.

## Lengths that depend on the resolution or on reference images

Some upstreams render fewer lengths at a high resolution, or with reference images. Keep `seconds` as the lengths of every case. Then narrow the cases that differ.

```json
{
  "type": "video",
  "seconds": [6, 10],
  "resolutions": ["768p", "1080p"],
  "resolution_seconds": [{ "resolution": "1080p", "seconds": [6] }],
  "reference_seconds": [8]
}
```

- A request that names `1080p` reaches you only for a length in the row. A request that names no resolution is matched on `seconds`.
- `reference_seconds` does not apply to a start image or to the images that fix a frame.

## Sound, resolution and price

A buyer can send `generate_audio` (`true` or `false`) and `resolution` (such as `720p`). A request that sends one reaches only a deployment that states the option and can make it.

- `audio` is `none` (every video is silent), `always` (every video has sound) or `optional` (the buyer chooses, and a request that says nothing gets sound).
- `resolutions` lists the labels that the deployment renders. The exchange reads the buyer's `720P` as `720p`. Send your upstream the spelling that it wants, such as `768P`, from your own agent.

If the price depends on the sound, the resolution or the operation, quote several `output.video` lines with a `variant`:

```json
{ "billable": "output.video", "unit": "second", "usd": 0.10 },
{ "billable": "output.video", "unit": "second", "variant": { "resolution": "1080p" }, "usd": 0.16 },
{ "billable": "output.video", "unit": "second", "variant": { "operation": "edit" }, "usd": 0.25 }
```

## Operations on a video

A buyer can send `operation` (`extend`, `edit`, `lip_sync` or `dub`) with a source video. Declare the feature of each operation that your upstream does, and the input kinds that its source needs. See [Operations on a video](https://liquidinference.ai/docs/provider-video.md#operations-on-a-video).

## Quote and serve

The route that your upstream needs, and the file that it returns, are in [Sell video](https://liquidinference.ai/docs/provider-video.md).

## Charge

The charge is the rate times the seconds that the buyer asked for. Reference images, reference video and reference audio are charged at their own rates, only when you quote them: `input.image.reference`, `input.video.reference` and `input.audio.reference`. A start image and the images that fix a frame are not reference images.

## Next

- Quote the deployment: [Quote over the session](https://liquidinference.ai/docs/provider-quoting.md).
- Get it on the public book: [Deployments](https://liquidinference.ai/docs/provider-models.md#from-registration-to-the-public-book).
