curl --request POST \
--url https://api.aiid.edu.kg/v1beta/models/{model}:predictLongRunning \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"instances": [
{
"prompt": "A cinematic aerial shot of a modern city at sunrise",
"referenceImages": [
{
"image": {
"inlineData": {
"mimeType": "image/png",
"data": "BASE64_IMAGE_DATA"
}
},
"referenceType": "asset"
}
]
}
],
"parameters": {
"aspectRatio": "16:9",
"durationSeconds": 5,
"resolution": "720p"
}
}
'import requests
url = "https://api.aiid.edu.kg/v1beta/models/{model}:predictLongRunning"
payload = {
"instances": [
{
"prompt": "A cinematic aerial shot of a modern city at sunrise",
"referenceImages": [
{
"image": { "inlineData": {
"mimeType": "image/png",
"data": "BASE64_IMAGE_DATA"
} },
"referenceType": "asset"
}
]
}
],
"parameters": {
"aspectRatio": "16:9",
"durationSeconds": 5,
"resolution": "720p"
}
}
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({
instances: [
{
prompt: 'A cinematic aerial shot of a modern city at sunrise',
referenceImages: [
{
image: {inlineData: {mimeType: 'image/png', data: 'BASE64_IMAGE_DATA'}},
referenceType: 'asset'
}
]
}
],
parameters: {aspectRatio: '16:9', durationSeconds: 5, resolution: '720p'}
})
};
fetch('https://api.aiid.edu.kg/v1beta/models/{model}:predictLongRunning', 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.aiid.edu.kg/v1beta/models/{model}:predictLongRunning",
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([
'instances' => [
[
'prompt' => 'A cinematic aerial shot of a modern city at sunrise',
'referenceImages' => [
[
'image' => [
'inlineData' => [
'mimeType' => 'image/png',
'data' => 'BASE64_IMAGE_DATA'
]
],
'referenceType' => 'asset'
]
]
]
],
'parameters' => [
'aspectRatio' => '16:9',
'durationSeconds' => 5,
'resolution' => '720p'
]
]),
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.aiid.edu.kg/v1beta/models/{model}:predictLongRunning"
payload := strings.NewReader("{\n \"instances\": [\n {\n \"prompt\": \"A cinematic aerial shot of a modern city at sunrise\",\n \"referenceImages\": [\n {\n \"image\": {\n \"inlineData\": {\n \"mimeType\": \"image/png\",\n \"data\": \"BASE64_IMAGE_DATA\"\n }\n },\n \"referenceType\": \"asset\"\n }\n ]\n }\n ],\n \"parameters\": {\n \"aspectRatio\": \"16:9\",\n \"durationSeconds\": 5,\n \"resolution\": \"720p\"\n }\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.aiid.edu.kg/v1beta/models/{model}:predictLongRunning")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"instances\": [\n {\n \"prompt\": \"A cinematic aerial shot of a modern city at sunrise\",\n \"referenceImages\": [\n {\n \"image\": {\n \"inlineData\": {\n \"mimeType\": \"image/png\",\n \"data\": \"BASE64_IMAGE_DATA\"\n }\n },\n \"referenceType\": \"asset\"\n }\n ]\n }\n ],\n \"parameters\": {\n \"aspectRatio\": \"16:9\",\n \"durationSeconds\": 5,\n \"resolution\": \"720p\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiid.edu.kg/v1beta/models/{model}:predictLongRunning")
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 \"instances\": [\n {\n \"prompt\": \"A cinematic aerial shot of a modern city at sunrise\",\n \"referenceImages\": [\n {\n \"image\": {\n \"inlineData\": {\n \"mimeType\": \"image/png\",\n \"data\": \"BASE64_IMAGE_DATA\"\n }\n },\n \"referenceType\": \"asset\"\n }\n ]\n }\n ],\n \"parameters\": {\n \"aspectRatio\": \"16:9\",\n \"durationSeconds\": 5,\n \"resolution\": \"720p\"\n }\n}"
response = http.request(request)
puts response.read_body{
"name": "models/veo3.1-fast/operations/abc123"
}Tạo video (định dạng Omni và Veo)
Dòng này hỗ trợ định dạng tạo video OpenAI (xem chi tiết tại liên kết Định dạng tương thích với Sora tạo video).
Trang chuyên đề của giao diện này dùng để giải thích các định dạng video liên quan đến Omni và Veo, cũng như trạng thái hỗ trợ của cổng hiện tại đối với định dạng gốc của Veo.
Hiện tại, khi sử dụng dòng Veo để công khai, vui lòng dùng chế độ tương thích OpenAI Sora: POST /v1/videos.
Đường dẫn dành riêng cho chế độ nguyên bản của Google là: POST /v1beta/models/{model}:predictLongRunning. Hiện cổng chưa kết nối với chuỗi phân phối tác vụ nguyên bản của Veo, vì vậy hiện chưa hỗ trợ gọi theo request body nguyên bản instances/parameters.
Lưu ý: gemini-omni Điểm cuối mà mô hình hỗ trợ là định dạng tương thích Sora POST /v1/videos hoặc định dạng Seedance POST /api/v3/contents/generations/tasks; không hỗ trợ điểm cuối Google gốc Veo predictLongRunning trên trang này.
curl --request POST \
--url https://api.aiid.edu.kg/v1beta/models/{model}:predictLongRunning \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"instances": [
{
"prompt": "A cinematic aerial shot of a modern city at sunrise",
"referenceImages": [
{
"image": {
"inlineData": {
"mimeType": "image/png",
"data": "BASE64_IMAGE_DATA"
}
},
"referenceType": "asset"
}
]
}
],
"parameters": {
"aspectRatio": "16:9",
"durationSeconds": 5,
"resolution": "720p"
}
}
'import requests
url = "https://api.aiid.edu.kg/v1beta/models/{model}:predictLongRunning"
payload = {
"instances": [
{
"prompt": "A cinematic aerial shot of a modern city at sunrise",
"referenceImages": [
{
"image": { "inlineData": {
"mimeType": "image/png",
"data": "BASE64_IMAGE_DATA"
} },
"referenceType": "asset"
}
]
}
],
"parameters": {
"aspectRatio": "16:9",
"durationSeconds": 5,
"resolution": "720p"
}
}
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({
instances: [
{
prompt: 'A cinematic aerial shot of a modern city at sunrise',
referenceImages: [
{
image: {inlineData: {mimeType: 'image/png', data: 'BASE64_IMAGE_DATA'}},
referenceType: 'asset'
}
]
}
],
parameters: {aspectRatio: '16:9', durationSeconds: 5, resolution: '720p'}
})
};
fetch('https://api.aiid.edu.kg/v1beta/models/{model}:predictLongRunning', 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.aiid.edu.kg/v1beta/models/{model}:predictLongRunning",
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([
'instances' => [
[
'prompt' => 'A cinematic aerial shot of a modern city at sunrise',
'referenceImages' => [
[
'image' => [
'inlineData' => [
'mimeType' => 'image/png',
'data' => 'BASE64_IMAGE_DATA'
]
],
'referenceType' => 'asset'
]
]
]
],
'parameters' => [
'aspectRatio' => '16:9',
'durationSeconds' => 5,
'resolution' => '720p'
]
]),
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.aiid.edu.kg/v1beta/models/{model}:predictLongRunning"
payload := strings.NewReader("{\n \"instances\": [\n {\n \"prompt\": \"A cinematic aerial shot of a modern city at sunrise\",\n \"referenceImages\": [\n {\n \"image\": {\n \"inlineData\": {\n \"mimeType\": \"image/png\",\n \"data\": \"BASE64_IMAGE_DATA\"\n }\n },\n \"referenceType\": \"asset\"\n }\n ]\n }\n ],\n \"parameters\": {\n \"aspectRatio\": \"16:9\",\n \"durationSeconds\": 5,\n \"resolution\": \"720p\"\n }\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.aiid.edu.kg/v1beta/models/{model}:predictLongRunning")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"instances\": [\n {\n \"prompt\": \"A cinematic aerial shot of a modern city at sunrise\",\n \"referenceImages\": [\n {\n \"image\": {\n \"inlineData\": {\n \"mimeType\": \"image/png\",\n \"data\": \"BASE64_IMAGE_DATA\"\n }\n },\n \"referenceType\": \"asset\"\n }\n ]\n }\n ],\n \"parameters\": {\n \"aspectRatio\": \"16:9\",\n \"durationSeconds\": 5,\n \"resolution\": \"720p\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiid.edu.kg/v1beta/models/{model}:predictLongRunning")
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 \"instances\": [\n {\n \"prompt\": \"A cinematic aerial shot of a modern city at sunrise\",\n \"referenceImages\": [\n {\n \"image\": {\n \"inlineData\": {\n \"mimeType\": \"image/png\",\n \"data\": \"BASE64_IMAGE_DATA\"\n }\n },\n \"referenceType\": \"asset\"\n }\n ]\n }\n ],\n \"parameters\": {\n \"aspectRatio\": \"16:9\",\n \"durationSeconds\": 5,\n \"resolution\": \"720p\"\n }\n}"
response = http.request(request)
puts response.read_body{
"name": "models/veo3.1-fast/operations/abc123"
}Ủy quyền
Sử dụng xác thực Bearer Token.
Định dạng: Authorization: Bearer sk-xxxxxx
Tham số đường dẫn
Veo Tên mô hình.
veo3, veo3-fast, veo3-fast-frames, veo3-frames, veo3-pro, veo3-pro-frames, veo3.1, veo3.1-4k, veo3.1-components, veo3.1-fast, veo3.1-pro, veo3.1-pro-4k "veo3.1-fast"
Nội dung
1Hide child attributes
Hide child attributes
Tạo từ gợi ý
"A cinematic aerial shot of a modern city at sunrise"
Tùy chọn. 1~3 hình ảnh tham chiếu, sử dụng cấu trúc inlineData gốc của Google hoặc URI tệp.
Hide child attributes
Hide child attributes
"asset"
Phản hồi
Cấu trúc phản hồi thành công đang được bảo lưu. Hiện tại chỉ dùng để mô tả giao thức, không hỗ trợ gọi thực tế.
operation name, dùng để truy vấn trạng thái sau này.
"models/veo3.1-fast/operations/abc123"
