Video length, resolution and format: the duration, resolution and ratio fields

All in One AIAI Video & Voice·· 10 views· 3 min read

In short: in a video request, duration is the length in seconds, resolution the resolution (for example 720p) and ratio the shape of the picture (for example 16:9). They are the fields of the example in our documentation, but each model has its own and accepts its own values. The length counts directly in the price, because videos are paid per second.

The three fields

Field What it is In the example
duration The length of the video, in seconds. 5
resolution The resolution of the video. 720p
ratio The ratio between the width and the height of the picture. 16:9

Seeing the values the model accepts

GET /v1/models/{id} brings, in input, each field of the model with the accepted values (options), the default (default) and the limits (min and max). It spends no credits:

curl "https://api.mozout.co.mz/v1/models/bytedance/seedance-2.0-mini/text-to-video" \
-H "Authorization: Bearer $MOZOUT_API_KEY"

In the terminal, aio model <id> shows the same. In an agent with the MCP server, the get_model tool shows them to the agent. On the Video tab of the Playground, the fields appear when you pick the model.

The request

The fields go inside input, in POST /v1/media/generations. A 5-second video in 720p:

{
"model": "bytedance/seedance-2.0-mini/text-to-video",
"input": {
"prompt": "A drone shot over a coastal city at sunset",
"duration": 5,
"resolution": "720p",
"ratio": "16:9"
}
}

A value the model does not accept gives 422 validation_failed, and details says which field. The rest of the request, from the status to the file, is in creating a video with AI.

How much the length weighs on the price

The price of a video model is in credits per second. Multiply it by the length: in the example in our documentation, bytedance/seedance-2.0-mini/text-to-video shows 18 credits per second, so 5 seconds would be 90 credits. Example prices change: see the current price on the Models tab. In the Playground, the Video tab shows the expected cost, with the seconds, before you generate. That amount is held and, at the end, you pay the real cost and get the difference back.

Choosing the values

1 Start short. A video of a few seconds shows whether the prompt works and costs less.
2 Choose the ratio of the place where the video will appear: landscape for a website or a wide screen. If the model accepts portrait ratios, use them for phone screens.
3 When you like the result, make the final version with the length and resolution you need.

Want to see the expected cost before you generate? Try it in the All in One AI Playground.

See All in One AI

SEE ALSO

Creating a video with AI: from a description or from a photo, through the API

What an AI video or voice costs: credits per second, per generation and how to estimate

Choosing a video model: the video type in the Models tab and the price per second

The fields an image model accepts: GET /v1/models/{id} and the size option

All in One AI

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from 396,00 MT/mo (3-year plan, with coupon)

See plans
Was this answer helpful? Your answer helps us improve this article.