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

All in One AI·· 56 views· 3 min read

In short: videos are made through the API, with the same request as images: POST /v1/media/generations, a video model and, in input, the description and the options, such as the length. You can also bring a photo to life, with a model that accepts a starting image. The Playground in Meu MozOut is for trying out chat and images; video is done through the API, the aio command or the MCP server. See the AI video and voice page.

Two ways to start

Starting from How it works Example use
A description The model creates the video from the text of the request alone. An aerial shot of a city at sunset, for the top of your website.
A photo The model animates the image you give it, sent as a public address (URL). Adding movement to a photo of your shop front, for social media.

The request

The request is the same for images, video and voice: only the model and the input fields change. A 5-second video in 720p, in 16:9 format:

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

The answer is 202, with the generation id. Then call GET /v1/media/generations/{id} every 5 or 10 seconds, until the status is no longer processing. A video usually takes longer than an image. The complete Python example is in creating images through the API: for a video, only the request changes.

Each model's fields

Length, resolution and format are common fields, but each model has its own. See the models on the «Models» tab, «Video» filter, and one model's fields with GET /v1/models/{id}, which shows the accepted values and the default for each one.

Bringing a photo to life

1 Put the photo at a public address, for example in your website's image folder: https://www.asuaempresa.co.mz/img/front.jpg.
2 On the «Models» tab, pick a video model that accepts a starting image. Each model's category tells you what it does.
3 Send the request with a description of the movement and the photo's address in the field the model asks for.
4 Check the status until it is completed and download the video.

Without writing code

In the terminal, the aio command sends the request, waits and downloads the file: aio generate video "waves crashing on the rocks" --model <id>. In a coding agent set up with the MCP server, just ask, for example: «Make a 5-second 720p video of a drone flying over a city at sunset.»

File links are not permanent. When the video is ready, download it and keep your own copy.
Start with the shortest video the model accepts: videos are paid per second. See what an AI video costs. To test your program without spending, use a sandbox_ key. See how to test in the Sandbox at no cost.

Want to see what you can do with video and voice in All in One AI? See the AI video and voice page.

See AI video and voice

SEE ALSO

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

An AI video or voice is taking long or has failed: the statuses and what to do

Creating AI images through the API: the request, the status and saving the file

Before you publish an AI video or voice: what to check

RECOMMENDED PRODUCT

Web hosting with cPanel

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

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