ToAPIsToAPIs
Veo3

Veo3 動画生成

Generate high-quality videos using Google Veo3 model, supports async task management

POST
/v1/videos/generations

中国本土のユーザー向け: 中国本土のユーザーは https://toapis.cn を API エンドポイント(Base URL)としてご利用ください。本ドキュメント内の例では https://toapis.com を https://toapis.cn に置き換えてください。

  • Asynchronous processing mode, returns task ID for subsequent queries
  • Supports multiple generation modes including text-to-video and image-to-video
  • Generated videos are retained for 30 days, download and save them before they expire

Important Change: For better performance and cost control, we no longer support passing base64 image data directly in image_urls. Please use the Upload 画像API first to upload images and get URLs, then call this endpoint.

Authorizations

Authorizationstringヘッダー必須

All endpoints require Bearer Token authentication

Get your API Key from the API Key Management Page

Add to request header:

Authorization: Bearer YOUR_API_KEY

Body

modelstringボディ必須デフォルト: veo3.1-fast

Video generation model name

Available models:

  • veo3.1-fast - Fast generation model, suitable for quick preview and iteration
  • veo3.1-lite - Lightweight generation model, suitable for lower-cost fast generation

Example: "veo3.1-fast"

promptstringボディ必須

Text description for video generation

durationintegerボディ

Video duration (seconds)

Fixed value: 8 (VEO3 only supports 8-second duration)

aspect_ratiostringボディ

Video resolution

Supported formats:

  • 16:9 (landscape)
  • 9:16 (portrait)
image_urlsstring[]ボディ

Array of reference image URLs for image-to-video generation

⚠️ URL format only (base64 no longer supported)

  • Publicly accessible image URL (http:// or https://)
  • You can use the Upload 画像API to upload local images and get URLs

Limits:

  • Maximum file size: 10MB
  • Supported formats: .jpeg, .jpg, .png, .webp
metadataobjectボディ

VEO3-specific extended parameters

Show metadata fields
generation_typestringボディ

Video generation type

Supported types:

  • frame - Frame-to-video (FL mode)
  • reference - Reference image-to-video

If not provided, automatically determined by image count: 2 images for frame mode, 3 images for reference mode

resolutionstringボディ

Video resolution

Supported values:

  • 720p (default)
  • 1080p (veo3.1-lite only)

レスポンス

idstring

Unique task identifier for status queries

objectstring

Object type, always generation.task

modelstring

モデル name used

statusstring

Task status

  • queued - Queued for processing
  • in_progress - Processing
  • completed - Successfully completed
  • failed - Failed
progressinteger

Task progress percentage (0-100)

created_atinteger

Task creation timestamp (Unix timestamp)

metadataobject

Task metadata

リクエスト例

curl --request POST \
  --url https://toapis.com/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "veo3.1-fast",
    "prompt": "Dolphins jumping in the blue ocean",
    "duration": 8,
    "aspect_ratio": "16:9",
    "image_urls": ["https://example.com/start-frame.jpg", "https://example.com/end-frame.jpg"],
    "metadata": {
      "generation_type": "frame",
      "resolution": "720p"
    }
  }'
import requests

response = requests.post(
    "https://toapis.com/v1/videos/generations",
    headers={
        "Authorization": "Bearer your-ToAPIs-key",
        "Content-Type": "application/json"
    },
    json={
        "model": "veo3.1-fast",
        "prompt": "Dolphins jumping in the blue ocean",
        "duration": 8,
        "aspect_ratio": "16:9",
        "image_urls": ["https://example.com/start-frame.jpg", "https://example.com/end-frame.jpg"],
        "metadata": {
            "generation_type": "frame",
            "resolution": "720p"
        }
    }
)

task = response.json()
print(f"Task ID: {task['id']}")
print(f"Status: {task['status']}")
const response = await fetch('https://toapis.com/v1/videos/generations', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer your-ToAPIs-key',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    model: 'veo3.1-fast',
    prompt: 'Dolphins jumping in the blue ocean',
    duration: 8,
    aspect_ratio: '16:9',
    image_urls: ['https://example.com/start-frame.jpg', 'https://example.com/end-frame.jpg'],
    metadata: {
      generation_type: 'frame',
      resolution: '720p'
    }
  })
});

const task = await response.json();
console.log(`Task ID: ${task.id}`);
console.log(`Status: ${task.status}`);

レスポンス例

{
  "id": "video_01K8SGYNNNVBQTXNR4MM964S7K",
  "object": "generation.task",
  "model": "veo3.1-fast",
  "status": "queued",
  "progress": 0,
  "created_at": 1768380224,
  "metadata": {
    "aspect_ratio": "16:9"
  }
}