メインコンテンツへスキップ
POST
/
v3
/
async
/
veo-3.0-generate-preview-img2video
Veo 3.0 Preview 画像から動画
curl --request POST \
  --url https://api.highwayapi.ai/v3/async/veo-3.0-generate-preview-img2video \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "prompt": "<string>",
  "image_url": "<string>",
  "image_base64": "<string>",
  "aspect_ratio": "<string>",
  "duration_seconds": 123,
  "enhance_prompt": true,
  "generate_audio": true,
  "negative_prompt": "<string>",
  "person_generation": "<string>",
  "resolution": "<string>",
  "sample_count": 123,
  "seed": {}
}
'
import requests

url = "https://api.highwayapi.ai/v3/async/veo-3.0-generate-preview-img2video"

payload = {
"prompt": "<string>",
"image_url": "<string>",
"image_base64": "<string>",
"aspect_ratio": "<string>",
"duration_seconds": 123,
"enhance_prompt": True,
"generate_audio": True,
"negative_prompt": "<string>",
"person_generation": "<string>",
"resolution": "<string>",
"sample_count": 123,
"seed": {}
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
prompt: '<string>',
image_url: '<string>',
image_base64: '<string>',
aspect_ratio: '<string>',
duration_seconds: 123,
enhance_prompt: true,
generate_audio: true,
negative_prompt: '<string>',
person_generation: '<string>',
resolution: '<string>',
sample_count: 123,
seed: {}
})
};

fetch('https://api.highwayapi.ai/v3/async/veo-3.0-generate-preview-img2video', 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.highwayapi.ai/v3/async/veo-3.0-generate-preview-img2video",
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' => '<string>',
'image_url' => '<string>',
'image_base64' => '<string>',
'aspect_ratio' => '<string>',
'duration_seconds' => 123,
'enhance_prompt' => true,
'generate_audio' => true,
'negative_prompt' => '<string>',
'person_generation' => '<string>',
'resolution' => '<string>',
'sample_count' => 123,
'seed' => [

]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);

$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.highwayapi.ai/v3/async/veo-3.0-generate-preview-img2video"

payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"image_url\": \"<string>\",\n \"image_base64\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"duration_seconds\": 123,\n \"enhance_prompt\": true,\n \"generate_audio\": true,\n \"negative_prompt\": \"<string>\",\n \"person_generation\": \"<string>\",\n \"resolution\": \"<string>\",\n \"sample_count\": 123,\n \"seed\": {}\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")

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.highwayapi.ai/v3/async/veo-3.0-generate-preview-img2video")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"prompt\": \"<string>\",\n \"image_url\": \"<string>\",\n \"image_base64\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"duration_seconds\": 123,\n \"enhance_prompt\": true,\n \"generate_audio\": true,\n \"negative_prompt\": \"<string>\",\n \"person_generation\": \"<string>\",\n \"resolution\": \"<string>\",\n \"sample_count\": 123,\n \"seed\": {}\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.highwayapi.ai/v3/async/veo-3.0-generate-preview-img2video")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"prompt\": \"<string>\",\n \"image_url\": \"<string>\",\n \"image_base64\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"duration_seconds\": 123,\n \"enhance_prompt\": true,\n \"generate_audio\": true,\n \"negative_prompt\": \"<string>\",\n \"person_generation\": \"<string>\",\n \"resolution\": \"<string>\",\n \"sample_count\": 123,\n \"seed\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "task_id": "<string>"
}
Veo 3.0 Preview 動画生成モデルを使用し、入力画像とテキスト説明から高品質な動画コンテンツを生成します。このインターフェースは非同期処理方式を採用しており、最終的な生成結果は task_id を使用して照会する必要があります。

リクエストヘッダー

Content-Type
string
必須
列挙値: application/json
Authorization
string
必須
Bearer 認証形式: Bearer {{API キー}}。

リクエストボディ

prompt
string
必須
生成したい動画を説明するテキスト文字列。
image_url
string
入力画像の URL。image_url と image_base64 のいずれか一方を指定する必要があります。
image_base64
string
Base64 エンコードされた入力画像。
aspect_ratio
string
生成する動画のアスペクト比を指定します。列挙値: 16:99:16。デフォルト値は 16:9 です。
duration_seconds
integer
生成したい動画ファイルの長さ(秒)。列挙値: 468。デフォルト値は 8 です。
enhance_prompt
boolean
Gemini を使用してプロンプトを強化するかどうかを指定します。デフォルト値: true
generate_audio
boolean
必須
動画に音声を生成するかどうかを指定します。
negative_prompt
string
モデルに生成させたくない内容を説明するテキスト文字列。
person_generation
string
人物または顔の生成を許可するかどうかを制御する安全設定。列挙値:
  • allow_adult (デフォルト): 成人のみ生成を許可
  • dont_allow: 画像内に人物または顔を含めることを許可しない
  • allow_all: すべての年齢層の人物の生成を許可(プロジェクトが allowlist に含まれている必要があります)
resolution
string
生成する動画の解像度。列挙値: 720p (デフォルト) または 1080p
sample_count
integer
生成する動画サンプルの数。取値範囲: 1-4
seed
uint32
ランダム生成プロセスを初期化するための数値。同じシード、プロンプト、およびその他のパラメータを使用すると同じ出力動画が生成され、生成プロセスに決定性を持たせることができます。取値範囲: 0-4,294,967,295

レスポンス情報パラメータ

task_id
string
必須
非同期タスクの task_id。生成結果を取得するには、この task_id を使用して タスク結果照会 API をリクエストしてください