Skip to main content

Open Sora Endpoint

Overview

The Open Sora endpoint generate captivating video by passing in text prompt

Request

--request POST 'https://modelslab.com/api/v6/video/open_sora' \

Make a POST request to https://modelslab.com/api/v6/video/open_sora endpoint and pass the required parameters in the request body.

Body Attributes

ParameterDescriptionValues
keyYour unique API key used for authorization.key
promptThe input text for video generation.string
heightThe height of the video.The default is 320 pixels. The maximum height is 768 pixels.
widthThe width of the video.The default is 576 pixels. The maximum width is 768 pixels.
fpsFrames per second. The duration of the video is calculated as the number of frames divided by the FPS.The default is 7 FPS. The maximum is 16 FPS.
tempIndicates whether to use a temporary file for the processed video.The default is yes. (YES or NO)

Example

Body

Body
{
"key":"",
"prompt":"a dog playing cards",
"height":"256",
"width":256,
"num_frames": 25,
"fps":12,
"webhook":null,
"track_id": null
}

Request

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
"key":"",
"prompt":"a dog playing cards",
"height": 256,
"width":256,
"num_frames": 25,
"fps":12,
"webhook":null,
"track_id": null
});

var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};

fetch("https://modelslab.com/api/v6/video/open_sora", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));

Response

Example Response

{
"status": "success",
"generationTime": 10.56,
"id": 148,
"output": [
"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/generations/8d299336-e805-4e75-bc0e-02fe03f87edf.mp4"
],
"proxy_links": [
"https://cdn2.stablediffusionapi.com/generations/8d299336-e805-4e75-bc0e-02fe03f87edf.mp4"
],
"meta": {
"ar": 25,
"batch_size": 1,
"file_prefix": "8d299336-e805-4e75-bc0e-02fe03f87edf",
"fps": 12,
"frame_interval": 3,
"height": 256,
"num_frames": 25,
"output_type": "mp4",
"prompt": null,
"seed": 1902962721,
"temp": "no",
"width": 256
}
}