curl --request POST \
--url 'https://api.elkapi.com/v1/videos' \
--header 'Authorization: Bearer <token>' \
--form 'model=sora-2' \
--form 'prompt=A small kitten running through a sunny garden, cinematic, highly detailed' \
--form 'image=https://example.com/image.png' \
--form 'duration=5' \
--form 'width=1280' \
--form 'height=720' \
--form 'fps=30' \
--form 'seed=12345' \
--form 'n=1' \
--form 'response_format=json' \
--form 'user=user-1234' \
--form 'metadata=[object Object]'
import requests
url = "https://api.elkapi.com/v1/videos"
headers = {
"Authorization": "Bearer <token>"
}
files = {
}
data = {
"model": "sora-2",
"prompt": "A small kitten running through a sunny garden, cinematic, highly detailed",
"image": "https://example.com/image.png",
"duration": "5",
"width": "1280",
"height": "720",
"fps": "30",
"seed": "12345",
"n": "1",
"response_format": "json",
"user": "user-1234",
"metadata": "[object Object]",
}
response = requests.request("POST", url, headers=headers, data=data, files=files)
print(response.text)
const url = "https://api.elkapi.com/v1/videos";
const headers = {
"Authorization": "Bearer <token>"
};
const form = new FormData();
form.append("model", "sora-2");
form.append("prompt", "A small kitten running through a sunny garden, cinematic, highly detailed");
form.append("image", "https://example.com/image.png");
form.append("duration", "5");
form.append("width", "1280");
form.append("height", "720");
form.append("fps", "30");
form.append("seed", "12345");
form.append("n", "1");
form.append("response_format", "json");
form.append("user", "user-1234");
form.append("metadata", "[object Object]");
const response = await fetch(url, {
method: "POST",
headers,
body: form
});
console.log(await response.text());
{
"id": "id",
"object": "object",
"model": "sora-2",
"status": "status",
"progress": 1,
"created_at": 1,
"seconds": "seconds",
"completed_at": 1,
"expires_at": 1,
"size": "1024x1024",
"error": {
"message": "message",
"code": "code"
},
"metadata": {}
}
{
"error": {
"message": "message",
"type": "type",
"param": "param",
"code": "code"
}
}
Sora Format
Create Sora Video
- OpenAI-compatible video generation endpoint.
- Reference documentation: https://platform.openai.com/docs/api-reference/videos/create
POST
/
v1
/
videos
curl --request POST \
--url 'https://api.elkapi.com/v1/videos' \
--header 'Authorization: Bearer <token>' \
--form 'model=sora-2' \
--form 'prompt=A small kitten running through a sunny garden, cinematic, highly detailed' \
--form 'image=https://example.com/image.png' \
--form 'duration=5' \
--form 'width=1280' \
--form 'height=720' \
--form 'fps=30' \
--form 'seed=12345' \
--form 'n=1' \
--form 'response_format=json' \
--form 'user=user-1234' \
--form 'metadata=[object Object]'
import requests
url = "https://api.elkapi.com/v1/videos"
headers = {
"Authorization": "Bearer <token>"
}
files = {
}
data = {
"model": "sora-2",
"prompt": "A small kitten running through a sunny garden, cinematic, highly detailed",
"image": "https://example.com/image.png",
"duration": "5",
"width": "1280",
"height": "720",
"fps": "30",
"seed": "12345",
"n": "1",
"response_format": "json",
"user": "user-1234",
"metadata": "[object Object]",
}
response = requests.request("POST", url, headers=headers, data=data, files=files)
print(response.text)
const url = "https://api.elkapi.com/v1/videos";
const headers = {
"Authorization": "Bearer <token>"
};
const form = new FormData();
form.append("model", "sora-2");
form.append("prompt", "A small kitten running through a sunny garden, cinematic, highly detailed");
form.append("image", "https://example.com/image.png");
form.append("duration", "5");
form.append("width", "1280");
form.append("height", "720");
form.append("fps", "30");
form.append("seed", "12345");
form.append("n", "1");
form.append("response_format", "json");
form.append("user", "user-1234");
form.append("metadata", "[object Object]");
const response = await fetch(url, {
method: "POST",
headers,
body: form
});
console.log(await response.text());
{
"id": "id",
"object": "object",
"model": "sora-2",
"status": "status",
"progress": 1,
"created_at": 1,
"seconds": "seconds",
"completed_at": 1,
"expires_at": 1,
"size": "1024x1024",
"error": {
"message": "message",
"code": "code"
},
"metadata": {}
}
{
"error": {
"message": "message",
"type": "type",
"param": "param",
"code": "code"
}
}
curl --request POST \
--url 'https://api.elkapi.com/v1/videos' \
--header 'Authorization: Bearer <token>' \
--form 'model=sora-2' \
--form 'prompt=A small kitten running through a sunny garden, cinematic, highly detailed' \
--form 'image=https://example.com/image.png' \
--form 'duration=5' \
--form 'width=1280' \
--form 'height=720' \
--form 'fps=30' \
--form 'seed=12345' \
--form 'n=1' \
--form 'response_format=json' \
--form 'user=user-1234' \
--form 'metadata=[object Object]'
import requests
url = "https://api.elkapi.com/v1/videos"
headers = {
"Authorization": "Bearer <token>"
}
files = {
}
data = {
"model": "sora-2",
"prompt": "A small kitten running through a sunny garden, cinematic, highly detailed",
"image": "https://example.com/image.png",
"duration": "5",
"width": "1280",
"height": "720",
"fps": "30",
"seed": "12345",
"n": "1",
"response_format": "json",
"user": "user-1234",
"metadata": "[object Object]",
}
response = requests.request("POST", url, headers=headers, data=data, files=files)
print(response.text)
const url = "https://api.elkapi.com/v1/videos";
const headers = {
"Authorization": "Bearer <token>"
};
const form = new FormData();
form.append("model", "sora-2");
form.append("prompt", "A small kitten running through a sunny garden, cinematic, highly detailed");
form.append("image", "https://example.com/image.png");
form.append("duration", "5");
form.append("width", "1280");
form.append("height", "720");
form.append("fps", "30");
form.append("seed", "12345");
form.append("n", "1");
form.append("response_format", "json");
form.append("user", "user-1234");
form.append("metadata", "[object Object]");
const response = await fetch(url, {
method: "POST",
headers,
body: form
});
console.log(await response.text());
{
"id": "id",
"object": "object",
"model": "sora-2",
"status": "status",
"progress": 1,
"created_at": 1,
"seconds": "seconds",
"completed_at": 1,
"expires_at": 1,
"size": "1024x1024",
"error": {
"message": "message",
"code": "code"
},
"metadata": {}
}
{
"error": {
"message": "message",
"type": "type",
"param": "param",
"code": "code"
}
}
Authorizations
string
required
All endpoints require Bearer Token authentication.Add it to the request headers:
Authorization: Bearer YOUR_API_KEY
Body
string
default:"sora-2"
Model/style IDExample:
sora-2string
Text promptExample:
The astronaut stands up and walks awaystring
Image input (URL or Base64)Example:
https://example.com/image.jpgnumber
Video duration (seconds)Example:
5integer
Video widthExample:
1280integer
Video heightExample:
720integer
Video frame rateExample:
30integer
Random seedExample:
20231234integer
Number of videos to generateExample:
1string
Response formatExample:
urlstring
User identifierExample:
user-1234object
Additional parameters (such as negative_prompt, style, quality_level)
Response
string
Video ID
string
Object type
string
default:"sora-2"
Model usedExample:
sora-2string
Task status
integer
Progress percentage
integer
Creation timestamp
string
Video duration
integer
Completion timestamp
integer
Expiration timestamp
string
Video size
object
Additional metadata