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 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 as a bearer token.

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"
        }
      ]
    }'
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"])
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.
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.
audio video output none, always or optional. See 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.

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.

"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.

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

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.

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

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.

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

{ "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.

Quote and serve

The route that your upstream needs, and the file that it returns, are in Sell video.

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