Video
Sora Video Generation
Generate videos using OpenAI's Sora model. Submit a prompt, poll for status, and download the finished video.
Create Generation
POST
/v1/videos/generationsBody Parameters
modelstringrequiredModel ID — "sora" or "sora-1.0-turbo"
promptstringrequiredText description of the desired video
aspect_ratiostringVideo aspect ratio
Options: 16:9, 9:16, 1:1
durationintegerVideo duration in seconds
Options: 5, 10, 15, 20
nintegerNumber of videos to generate
Default: 1
cURL
curl -X POST https://api.metriqual.com/v1/videos/generations \
-H "Authorization: Bearer mql_your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "sora",
"prompt": "A timelapse of a flower blooming in a garden"
}'TypeScript SDK
const generation = await mql.video.create({
model: 'sora',
prompt: 'A timelapse of a flower blooming in a garden',
aspect_ratio: '16:9',
duration: 10
});
console.log(generation.id); // Use to poll statusPython SDK
gen = mql.video.create(
model="sora",
prompt="A timelapse of a flower blooming in a garden",
aspect_ratio="16:9",
duration=10,
)
print(gen["id"])
# Or create and wait for completion
result = mql.video.create_and_wait(
model="sora",
prompt="A timelapse of a flower blooming in a garden",
)
# Or create, wait, and download in one step
video = mql.video.create_and_download(
model="sora",
prompt="A timelapse of a flower blooming in a garden",
)Check Status
GET
/v1/videos/generations/:idPoll this endpoint to check if the video generation is complete. The status transitions from pending → processing → completed.
TypeScript SDK
const status = await mql.video.getStatus(generation.id);
if (status.status === 'completed') {
const content = await mql.video.download(generation.id);
// content contains the video data
}Python SDK
status = mql.video.get_status(gen["id"])
if status["status"] == "completed":
content = mql.video.download(gen["id"])Download Video
GET
/v1/videos/:id/contentDownload the generated video content once the generation status is completed.