Sora2 Pro 文本转视频
curl --request POST \
--url https://api.sinancode.com/v1/generate/k/sora2-pro-text-to-video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "a cinematic scene of a spaceship",
"aspect_ratio": "landscape",
"n_frames": 10,
"remove_watermark": false,
"size": "standard"
}
'import requests
url = "https://api.sinancode.com/v1/generate/k/sora2-pro-text-to-video"
payload = {
"prompt": "a cinematic scene of a spaceship",
"aspect_ratio": "landscape",
"n_frames": 10,
"remove_watermark": False,
"size": "standard"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'a cinematic scene of a spaceship',
aspect_ratio: 'landscape',
n_frames: 10,
remove_watermark: false,
size: 'standard'
})
};
fetch('https://api.sinancode.com/v1/generate/k/sora2-pro-text-to-video', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sinancode.com/v1/generate/k/sora2-pro-text-to-video",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'a cinematic scene of a spaceship',
'aspect_ratio' => 'landscape',
'n_frames' => 10,
'remove_watermark' => false,
'size' => 'standard'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sinancode.com/v1/generate/k/sora2-pro-text-to-video"
payload := strings.NewReader("{\n \"prompt\": \"a cinematic scene of a spaceship\",\n \"aspect_ratio\": \"landscape\",\n \"n_frames\": 10,\n \"remove_watermark\": false,\n \"size\": \"standard\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sinancode.com/v1/generate/k/sora2-pro-text-to-video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"a cinematic scene of a spaceship\",\n \"aspect_ratio\": \"landscape\",\n \"n_frames\": 10,\n \"remove_watermark\": false,\n \"size\": \"standard\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/k/sora2-pro-text-to-video")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"a cinematic scene of a spaceship\",\n \"aspect_ratio\": \"landscape\",\n \"n_frames\": 10,\n \"remove_watermark\": false,\n \"size\": \"standard\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "01234567-89ab-cdef-0123-456789abcdef"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}视频生成 - Sora 2
Sora 2 Pro 文本转视频
使用 Sora 2 Pro 模型从文本生成高质量视频(异步)
POST
/
generate
/
k
/
sora2-pro-text-to-video
Sora2 Pro 文本转视频
curl --request POST \
--url https://api.sinancode.com/v1/generate/k/sora2-pro-text-to-video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "a cinematic scene of a spaceship",
"aspect_ratio": "landscape",
"n_frames": 10,
"remove_watermark": false,
"size": "standard"
}
'import requests
url = "https://api.sinancode.com/v1/generate/k/sora2-pro-text-to-video"
payload = {
"prompt": "a cinematic scene of a spaceship",
"aspect_ratio": "landscape",
"n_frames": 10,
"remove_watermark": False,
"size": "standard"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'a cinematic scene of a spaceship',
aspect_ratio: 'landscape',
n_frames: 10,
remove_watermark: false,
size: 'standard'
})
};
fetch('https://api.sinancode.com/v1/generate/k/sora2-pro-text-to-video', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sinancode.com/v1/generate/k/sora2-pro-text-to-video",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'a cinematic scene of a spaceship',
'aspect_ratio' => 'landscape',
'n_frames' => 10,
'remove_watermark' => false,
'size' => 'standard'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sinancode.com/v1/generate/k/sora2-pro-text-to-video"
payload := strings.NewReader("{\n \"prompt\": \"a cinematic scene of a spaceship\",\n \"aspect_ratio\": \"landscape\",\n \"n_frames\": 10,\n \"remove_watermark\": false,\n \"size\": \"standard\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sinancode.com/v1/generate/k/sora2-pro-text-to-video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"a cinematic scene of a spaceship\",\n \"aspect_ratio\": \"landscape\",\n \"n_frames\": 10,\n \"remove_watermark\": false,\n \"size\": \"standard\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/k/sora2-pro-text-to-video")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"a cinematic scene of a spaceship\",\n \"aspect_ratio\": \"landscape\",\n \"n_frames\": 10,\n \"remove_watermark\": false,\n \"size\": \"standard\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "01234567-89ab-cdef-0123-456789abcdef"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}使用 OpenAI 的 Sora 2 Pro 模型生成专业级视频。
模型特点:
- 双质量等级 - 支持 standard 和 high 两种质量模式
- 更长时长 - 支持生成最长 25 秒的高质量视频
- 增强控制 - 更精准的镜头角度、镜头类型和视觉风格控制
- 专业输出 - 适合商业广告、电影短片等专业场景
授权
请使用您的 API Token 进行认证
请求体
application/json
任务参数
提示词(必填)
Minimum string length:
1示例:
"a cinematic scene of a spaceship"
宽高比(可选,默认 landscape)
可用选项:
portrait, landscape 示例:
"landscape"
视频时长(可选,10或15秒,默认10)
可用选项:
10, 15 示例:
10
移除水印(可选)
示例:
false
视频质量(可选,standard/high,默认 standard)
可用选项:
standard, high 示例:
"standard"
响应
OK
Task ID
示例:
"01234567-89ab-cdef-0123-456789abcdef"
⌘I