Veo 3.1 文本转视频
curl --request POST \
--url https://api.sinancode.com/v1/generate/k/veo3-text-to-video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "a cat playing with a ball",
"aspectRatio": "16:9",
"enableTranslation": true,
"model": "veo3_fast",
"seeds": 12345,
"watermark": ""
}
'import requests
url = "https://api.sinancode.com/v1/generate/k/veo3-text-to-video"
payload = {
"prompt": "a cat playing with a ball",
"aspectRatio": "16:9",
"enableTranslation": True,
"model": "veo3_fast",
"seeds": 12345,
"watermark": ""
}
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 cat playing with a ball',
aspectRatio: '16:9',
enableTranslation: true,
model: 'veo3_fast',
seeds: 12345,
watermark: ''
})
};
fetch('https://api.sinancode.com/v1/generate/k/veo3-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/veo3-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 cat playing with a ball',
'aspectRatio' => '16:9',
'enableTranslation' => true,
'model' => 'veo3_fast',
'seeds' => 12345,
'watermark' => ''
]),
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/veo3-text-to-video"
payload := strings.NewReader("{\n \"prompt\": \"a cat playing with a ball\",\n \"aspectRatio\": \"16:9\",\n \"enableTranslation\": true,\n \"model\": \"veo3_fast\",\n \"seeds\": 12345,\n \"watermark\": \"\"\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/veo3-text-to-video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"a cat playing with a ball\",\n \"aspectRatio\": \"16:9\",\n \"enableTranslation\": true,\n \"model\": \"veo3_fast\",\n \"seeds\": 12345,\n \"watermark\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/k/veo3-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 cat playing with a ball\",\n \"aspectRatio\": \"16:9\",\n \"enableTranslation\": true,\n \"model\": \"veo3_fast\",\n \"seeds\": 12345,\n \"watermark\": \"\"\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>"
}{
"error_code": "<string>",
"message": "<string>"
}视频生成 - Veo 3
Veo 3.1 文本转视频
使用 Google Veo 3.1 模型从文本提示生成视频(异步)
POST
/
generate
/
k
/
veo3-text-to-video
Veo 3.1 文本转视频
curl --request POST \
--url https://api.sinancode.com/v1/generate/k/veo3-text-to-video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "a cat playing with a ball",
"aspectRatio": "16:9",
"enableTranslation": true,
"model": "veo3_fast",
"seeds": 12345,
"watermark": ""
}
'import requests
url = "https://api.sinancode.com/v1/generate/k/veo3-text-to-video"
payload = {
"prompt": "a cat playing with a ball",
"aspectRatio": "16:9",
"enableTranslation": True,
"model": "veo3_fast",
"seeds": 12345,
"watermark": ""
}
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 cat playing with a ball',
aspectRatio: '16:9',
enableTranslation: true,
model: 'veo3_fast',
seeds: 12345,
watermark: ''
})
};
fetch('https://api.sinancode.com/v1/generate/k/veo3-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/veo3-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 cat playing with a ball',
'aspectRatio' => '16:9',
'enableTranslation' => true,
'model' => 'veo3_fast',
'seeds' => 12345,
'watermark' => ''
]),
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/veo3-text-to-video"
payload := strings.NewReader("{\n \"prompt\": \"a cat playing with a ball\",\n \"aspectRatio\": \"16:9\",\n \"enableTranslation\": true,\n \"model\": \"veo3_fast\",\n \"seeds\": 12345,\n \"watermark\": \"\"\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/veo3-text-to-video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"a cat playing with a ball\",\n \"aspectRatio\": \"16:9\",\n \"enableTranslation\": true,\n \"model\": \"veo3_fast\",\n \"seeds\": 12345,\n \"watermark\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/k/veo3-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 cat playing with a ball\",\n \"aspectRatio\": \"16:9\",\n \"enableTranslation\": true,\n \"model\": \"veo3_fast\",\n \"seeds\": 12345,\n \"watermark\": \"\"\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>"
}{
"error_code": "<string>",
"message": "<string>"
}使用 Google DeepMind 的 Veo 3.1 模型从文本生成视频。
模型特点:
- 原生音频生成 - 同步生成对话、音效和环境音,精准唇形同步
- 超真实画面 - 1080P 高清输出,改进的物理效果和人物表现
- 镜头控制 - 支持指定镜头运动、电影风格和场景过渡
授权
请使用您的 API Token 进行认证
请求体
application/json
Task parameters
提示词(必填)- 视频生成的文本描述
Minimum string length:
1示例:
"a cat playing with a ball"
宽高比(可选)- 视频宽高比,默认 16:9
可用选项:
16:9, 9:16, Auto 示例:
"16:9"
启用翻译(可选)- 启用翻译,默认 true
示例:
true
模型(可选)- veo3(质量优先)或 veo3_fast(速度优先),默认 veo3_fast
可用选项:
veo3, veo3_fast 示例:
"veo3_fast"
随机种子(可选)- 范围 10000-99999
必填范围:
10000 <= x <= 99999示例:
12345
水印(可选)- 水印标识
示例:
""
响应
OK
Task ID
示例:
"01234567-89ab-cdef-0123-456789abcdef"
⌘I