Create Video
Create a video generation task using the OpenAI/Sora-compatible request format. This endpoint is for models configured as video-generation channels, such as sora-2 and bytedance-seedance-1.5; actual availability depends on the model list and account channel configuration.
For the Alibaba Cloud Model Studio / DashScope native input / parameters format, see Aliyun Video Generation.
Try It
/v1/videoshttps://api-platform.ope.aiEndpoints
| Endpoint | Auth | Purpose |
|---|---|---|
POST /v1/videos | Authorization: Bearer <api-key> | Create a video task with an API key |
POST /api/videos | token: <jwt> | Frontend-token proxy endpoint; request body is the same |
Use the token header for a normal frontend JWT. Admin JWTs may use Authorization: Bearer <jwt>.
Authentication
Use Bearer token authentication.
- Header:
Authorization: Bearer <api-key> - Example:
Authorization: Bearer sk-xxxxxx
Request Body(application/json)
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Video model ID, for example sora-2 or bytedance-seedance-1.5 |
prompt | string | Yes | Text prompt |
size | string | Yes | Output size, preferably widthxheight, for example 720x1280 |
seconds | string | Yes | Video duration as a string, for example "4"; valid values depend on the model |
generate_audio | boolean | No | Whether to generate audio, for models that support it |
enhance_prompt | boolean | No | Whether to enhance the prompt, for models that support it |
negative_prompt | string | No | Negative prompt |
person_generation | string | No | Person-generation policy; supported values depend on the model |
seed | integer | No | Random seed |
remix_video_id | string | No | Existing video task ID for video remix/edit flows |
input_reference.content | array | No | Multimodal reference content; each item supports only image_url, video_url, or audio_url |
input_reference.content[] shape:
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | image_url, video_url, or audio_url |
role | string | No | Reference role, for example reference_image |
image_url.url | string | Conditional | Required when type=image_url; image URL or Data URL |
video_url.url | string | Conditional | Required when type=video_url; video URL |
audio_url.url | string | Conditional | Required when type=audio_url; audio URL |
Field Restrictions
The platform rejects these incompatible fields: aspect_ratio, resolution, duration_seconds, top-level content, img_url in JSON requests, and legacy input_reference.file_id / input_reference.image_url. Put text in prompt; do not send input_reference.content[].text.
multipart/form-data is only for uploading a reference image file through the input_reference field. The file must be at most 10 MB and use image/jpeg, image/png, or image/webp. Do not send an input_reference file and remix_video_id in the same request.
Request Examples
- cURL
- JavaScript
- Python
curl -X POST "https://api-platform.ope.ai/v1/videos" \
-H "Authorization: Bearer $OPEAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2",
"prompt": "Create a short high-definition tech-style video showing AI video generation capabilities.",
"size": "720x1280",
"seconds": "4"
}'
const res = await fetch("https://api-platform.ope.ai/v1/videos", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.OPEAI_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "sora-2",
prompt: "Create a short high-definition tech-style video showing AI video generation capabilities.",
size: "720x1280",
seconds: "4",
}),
});
console.log(await res.json());
import os
import requests
resp = requests.post(
"https://api-platform.ope.ai/v1/videos",
headers={"Authorization": f"Bearer {os.environ['OPEAI_API_KEY']}"},
json={
"model": "sora-2",
"prompt": "Create a short high-definition tech-style video showing AI video generation capabilities.",
"size": "720x1280",
"seconds": "4",
},
timeout=120,
)
print(resp.json())
Reference Content Example
{
"model": "bytedance-seedance-1.5",
"prompt": "Make the subject in the reference image turn naturally toward the camera with cinematic lighting.",
"size": "1280x720",
"seconds": "5",
"input_reference": {
"content": [
{
"type": "image_url",
"role": "reference_image",
"image_url": {
"url": "https://example.com/reference.png"
}
}
]
}
}
Response Example
The create endpoint returns a task ID. Poll Get Video Task Status, then download the result with Get Video Content after the task succeeds.
{
"id": "video_690d9b52e2b081908a05ded32cbfc629",
"object": "video",
"status": "queued",
"created_at": 1762499410,
"model": "sora-2",
"prompt": "Create a short high-definition tech-style video showing AI video generation capabilities.",
"size": "720x1280",
"seconds": "4"
}