Sora2 Pro 画像から動画
curl --request POST \
--url https://api.sinancode.com/v1/generate/k/sora2-pro-image-to-video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"image_urls": [
"https://example.com/image1.jpg"
],
"prompt": "animate the scene with smooth motion",
"aspect_ratio": "landscape",
"n_frames": 10,
"remove_watermark": false,
"size": "standard"
}
'import requests
url = "https://api.sinancode.com/v1/generate/k/sora2-pro-image-to-video"
payload = {
"image_urls": ["https://example.com/image1.jpg"],
"prompt": "animate the scene with smooth motion",
"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({
image_urls: ['https://example.com/image1.jpg'],
prompt: 'animate the scene with smooth motion',
aspect_ratio: 'landscape',
n_frames: 10,
remove_watermark: false,
size: 'standard'
})
};
fetch('https://api.sinancode.com/v1/generate/k/sora2-pro-image-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-image-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([
'image_urls' => [
'https://example.com/image1.jpg'
],
'prompt' => 'animate the scene with smooth motion',
'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-image-to-video"
payload := strings.NewReader("{\n \"image_urls\": [\n \"https://example.com/image1.jpg\"\n ],\n \"prompt\": \"animate the scene with smooth motion\",\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-image-to-video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"image_urls\": [\n \"https://example.com/image1.jpg\"\n ],\n \"prompt\": \"animate the scene with smooth motion\",\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-image-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 \"image_urls\": [\n \"https://example.com/image1.jpg\"\n ],\n \"prompt\": \"animate the scene with smooth motion\",\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 Image to Video
Sora 2 Pro モデルを使用した画像からの高品質動画生成(非同期)
POST
/
generate
/
k
/
sora2-pro-image-to-video
Sora2 Pro 画像から動画
curl --request POST \
--url https://api.sinancode.com/v1/generate/k/sora2-pro-image-to-video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"image_urls": [
"https://example.com/image1.jpg"
],
"prompt": "animate the scene with smooth motion",
"aspect_ratio": "landscape",
"n_frames": 10,
"remove_watermark": false,
"size": "standard"
}
'import requests
url = "https://api.sinancode.com/v1/generate/k/sora2-pro-image-to-video"
payload = {
"image_urls": ["https://example.com/image1.jpg"],
"prompt": "animate the scene with smooth motion",
"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({
image_urls: ['https://example.com/image1.jpg'],
prompt: 'animate the scene with smooth motion',
aspect_ratio: 'landscape',
n_frames: 10,
remove_watermark: false,
size: 'standard'
})
};
fetch('https://api.sinancode.com/v1/generate/k/sora2-pro-image-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-image-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([
'image_urls' => [
'https://example.com/image1.jpg'
],
'prompt' => 'animate the scene with smooth motion',
'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-image-to-video"
payload := strings.NewReader("{\n \"image_urls\": [\n \"https://example.com/image1.jpg\"\n ],\n \"prompt\": \"animate the scene with smooth motion\",\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-image-to-video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"image_urls\": [\n \"https://example.com/image1.jpg\"\n ],\n \"prompt\": \"animate the scene with smooth motion\",\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-image-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 \"image_urls\": [\n \"https://example.com/image1.jpg\"\n ],\n \"prompt\": \"animate the scene with smooth motion\",\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 モデルを使用して画像から高品質な動画を生成します。
承認
API Tokenを使用して認証を行ってください
ボディ
application/json
タスクパラメータ
画像URLリスト(必須、配列)
Minimum array length:
1例:
["https://example.com/image1.jpg"]
プロンプト(必須)
Minimum string length:
1例:
"animate the scene with smooth motion"
アスペクト比(オプション、デフォルト landscape)
利用可能なオプション:
portrait, landscape 例:
"landscape"
動画の長さ(オプション、10または15秒、デフォルト10)
利用可能なオプション:
10, 15 例:
10
透かしを削除(オプション)
例:
false
動画の品質(オプション、standard/high、デフォルト standard)
利用可能なオプション:
standard, high 例:
"standard"
レスポンス
OK
タスクID
例:
"01234567-89ab-cdef-0123-456789abcdef"
⌘I