万相 Wan 与 Gemini Omni
Gemini Omni 1.2 Flash Ext
Gemini Omni 文生视频、图生视频、参数与价格
POST
/
api
/
v1
/
task
/
submit
Gemini Omni 1.2 Flash Ext
curl --request POST \
--url https://api.example.com/api/v1/task/submit \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/task/submit"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/task/submit', 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.example.com/api/v1/task/submit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/task/submit"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.example.com/api/v1/task/submit")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/task/submit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body先配置 API 鉴权。提交后用返回的
按输出时长计费,总费用向上取整到整数积分。1 积分为 $0.01。
data.taskId 查询任务。
参数
API 模型 ID 为gemini-omni-1.2-flash-ext。
input.prompt必填,最多 5,000 字符。input.duration为 3–15 的整数,默认 5 秒。首尾帧最长 10 秒。input.resolution可填360p、720p、1080p、4k,默认720p。1080p 和 4K 为放大输出,4K 可能没有音轨。input.ratio可填16:9或9:16,默认16:9。input.mode可填text-to-video、image-to-video、reference-to-video或first-last-frame。通过input.imageUrls传入公开图片 URL。单图转视频用 1 张,首尾帧用 2 张且按顺序传入,参考图模式最多 10 张。省略模式时,根据图片数量推断文生视频、单图转视频或参考图模式。
价格
| 分辨率 | 美元/秒 | 5 秒实际扣分 |
|---|---|---|
| 360p | $0.0207 | 11 |
| 720p | $0.063 | 32 |
| 1080p | $0.0936 | 47 |
| 4k | $0.1881 | 95 |
请求示例
{
"model": "gemini-omni-1.2-flash-ext",
"input": {
"prompt": "镜头绕着晨光下的蓝色陶瓷杯缓慢移动。",
"duration": 5,
"resolution": "720p",
"ratio": "16:9"
}
}
⌘I
Gemini Omni 1.2 Flash Ext
curl --request POST \
--url https://api.example.com/api/v1/task/submit \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/task/submit"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/task/submit', 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.example.com/api/v1/task/submit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/task/submit"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.example.com/api/v1/task/submit")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/task/submit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body