Google Veo 3 & Veo 3.1 Fast API: Setup Guide for ComfyUI and Python Workflows
Target Model:
veo3.1-fast(alsoveo3.1-lite; official family:Veo3.1-fast-official,Veo3.1-lite-official,Veo3.1-quality-official)
Inference Endpoint:https://toapis.com/v1/videos/generations
Related: Veo 3 API pricing breakdown · Sora 2 third-party access · OpenAI Sora 2 API guide · Veo3 Video Generation · Veo3 Official Video Generation
1. TL;DR & Performance Overview
The schedule title still says “Google Veo 3 & Veo 3.1 Fast.” On the pages checked on 2026-11-24, the live ToAPIs catalog is a Veo 3.1 family. There is no live model-guide page for veo3, veo-3, or veo3-fast (those slugs return the title Model Guide Not Found). Planning drafts that send google-veo-3 or google-veo-3-1-fast do not match any official reference fetched today.
What is documented:
- Gateway family — Veo3 Video Generation: public IDs
veo3.1-fastandveo3.1-lite. Duration is a fixed 8 seconds.aspect_ratiois16:9or9:16.metadata.resolutiondefaults to720p;1080pis documented forveo3.1-liteonly. The live Veo 3.1 Fast model guide agrees: max resolution 720p, billed per request. - Official family — Veo3 Official Video Generation: a different contract, described as a direct connection to Google Vertex AI. Request examples use
Veo3.1-quality-official,Veo3.1-fast-official, andVeo3.1-lite-official(capitalV). Duration is4,6, or8seconds (default 8). Aspect is thesizefield (16:9or9:16). Resolution is a top-level field. Official-only metadata includesgenerateAudio,negativePrompt,personGeneration,lastFrame,referenceImages,compressionQuality, andresizeMode. - Auth and poll:
Authorization: Bearer <API_KEY>.POST /v1/videos/generations, thenGET /v1/videos/generations/{task_id}. Ordinary tasks may also be queried withGET /v1/tasks/{id}. Official examples usehttps://toapis.com(mainland China:https://toapis.cn). - ComfyUI: no official ToAPIs custom node was published on the pages checked today. The honest path is Python (and a generic HTTP node if you stay inside ComfyUI).
- Prices: quote model-guide figures only as a 2026-11-24 snapshot. The account catalog is authoritative. See the companion pricing breakdown.
2. Official IDs, Two Contracts, and Resolution Limits
Do not treat “Veo 3” as a single model string. The English docs sitemap on 2026-11-24 lists /api-reference/videos/veo3/generation and /api-reference/videos/veo3-official/generation. Paths such as /videos/veo-3/generation or /videos/veo3.1-fast/generation were not in that sitemap.
Gateway Veo3 (veo3.1-fast, veo3.1-lite)
| Field | Documented values (2026-11-24) |
|---|---|
model | veo3.1-fast (default on that page), veo3.1-lite |
prompt | Required |
duration | Fixed 8 |
aspect_ratio | 16:9, 9:16 |
image_urls | Public http(s) URLs only; base64 is not accepted; max 10MB; .jpeg, .jpg, .png, .webp |
metadata.generation_type | frame (frame-to-video) or reference. If omitted, 2 images select frame mode and 3 images select reference mode |
metadata.resolution | 720p (default); 1080p for veo3.1-lite only |
The live Veo 3.1 Fast model-guide key-parameters table also lists resolution as 720p only. Playground field tests in this repository make the same split (veo3.1-fast → 720p; veo3.1-lite → 720p and 1080p), but the API reference and model-guide pages are the contract you should implement.
Official Veo3 (Veo3.1-*-official)
The official page default is Veo3.1-quality-official. Model-guide titles use lowercase display names (veo3.1-fast-official), but the request examples and “use the fixed value” lines on those guides use the capital-V strings. Send the documented request IDs:
| Field | Documented values (2026-11-24) |
|---|---|
model | Veo3.1-quality-official, Veo3.1-fast-official, Veo3.1-lite-official |
prompt | Required |
duration | 4, 6, or 8 (default 8) |
size | 16:9 (default), 9:16 |
resolution | Official API reference: 720p (default), 1080p, 4k (preview). The lite-official model guide lists 720p and 1080p only — do not assume 4k on lite-official |
image_urls | First-frame URL; only the first URL in the array is used. Mutually exclusive with metadata.referenceImages |
metadata.generateAudio | Default false |
metadata.negativePrompt | Optional |
metadata.personGeneration | allow_adult or dont_allow |
metadata.lastFrame | Last-frame URL; only has effect together with image_urls |
metadata.referenceImages | Style/asset references, maximum 3; not used as the starting frame; cannot be combined with image_urls |
metadata.compressionQuality | optimized (default) or lossless |
metadata.resizeMode | pad or crop |
Both families retain generated videos for 30 days. Upload local images first; do not send base64 in image_urls.

Figure 1: Submit a documented Veo request, poll GET /v1/videos/generations/{task_id} until completed, then read result.data[0].url. The same HTTP path is what a generic ComfyUI HTTP node should call.
3. Production Implementation: Python, cURL, and an Honest ComfyUI Path
Step 1: cURL for gateway veo3.1-fast (720p, 8 seconds)
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"
}
}'
1080p on the gateway family requires veo3.1-lite:
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "veo3.1-lite",
"prompt": "Dolphins jumping in the blue ocean",
"duration": 8,
"aspect_ratio": "16:9",
"metadata": {
"resolution": "1080p"
}
}'
Official-family example (capital-V model ID, size instead of aspect_ratio):
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "Veo3.1-fast-official",
"prompt": "A dolphin leaping through crystal blue ocean waters",
"duration": 8,
"size": "16:9",
"resolution": "720p",
"metadata": {
"generateAudio": false,
"negativePrompt": "blurry, low quality"
}
}'
Poll:
curl --request GET \
--url 'https://toapis.com/v1/videos/generations/<task_id>' \
--header 'Authorization: Bearer <token>'
Step 2: Python with a bounded poller
import os
import time
import random
import requests
BASE = "https://toapis.com" # mainland China: https://toapis.cn
HEADERS = {
"Authorization": f"Bearer {os.environ['TOAPIS_API_KEY']}",
"Content-Type": "application/json",
}
def submit_veo31_fast(prompt: str, aspect_ratio: str = "16:9") -> str:
response = requests.post(
f"{BASE}/v1/videos/generations",
headers=HEADERS,
json={
"model": "veo3.1-fast",
"prompt": prompt,
"duration": 8,
"aspect_ratio": aspect_ratio,
"metadata": {"resolution": "720p"},
},
timeout=30,
)
response.raise_for_status()
return response.json()["id"]
def poll_video(task_id: str, deadline_s: int = 600, interval: int = 10) -> dict:
start = time.time()
time.sleep(5)
wait = interval
while time.time() - start < deadline_s:
poll = requests.get(
f"{BASE}/v1/videos/generations/{task_id}",
headers=HEADERS,
timeout=15,
)
if poll.status_code == 429:
retry_after = int(poll.headers.get("Retry-After", wait))
time.sleep(retry_after + random.uniform(0, 1))
wait = min(wait * 2, 120)
continue
poll.raise_for_status()
data = poll.json()
status = data.get("status")
if status == "completed":
item = data["result"]["data"][0]
return {"url": item["url"], "expires_at": data.get("expires_at")}
if status == "failed":
raise RuntimeError(f"Generation failed: {data.get('error')}")
time.sleep(wait + random.uniform(0, 1))
raise TimeoutError(f"Task {task_id} still running after {deadline_s}s — query it before resubmitting")
if __name__ == "__main__":
task_id = submit_veo31_fast("Dolphins jumping in the blue ocean")
print("task:", task_id)
result = poll_video(task_id)
print(result)
Step 3: ComfyUI without inventing a first-party node
As of 2026-11-24, official ToAPIs documentation and the Veo model-guide pages do not describe a ToAPIs ComfyUI custom node, a pip/git install path, or a first-party node name. This guide therefore does not tell you to “install the ToAPIs ComfyUI custom node.”
If you orchestrate shots in ComfyUI, keep the documented HTTP contract:
- Build the same JSON body you would send from Python (
model,prompt,duration, and the field names that belong to that family). - Use a generic HTTP request node (or a small Python helper node you maintain) to
POST https://toapis.com/v1/videos/generationswithAuthorization: Bearer <API_KEY>andContent-Type: application/json. - Store the returned
id. PollGET /v1/videos/generations/{id}untilstatusiscompletedorfailed, with a 5–10 second interval, jitter, and a bounded timeout. Official status docs recommend at least 5–10 seconds and honoringRetry-Afteron429. - On
completed, readresult.data[0].urland download the file into your ComfyUI workflow. Do not assume a top-levelvideo_urlfield. - Treat any community pack that claims to be an official ToAPIs node as unofficial until a first-party docs page exists.
That is still a ComfyUI workflow — it just does not invent a package that is not in the official catalog.
4. Error Handling & Status Matrix
A successful HTTP query is not a completed video. Always read task status. See the error reference and Get Video Task Status.
| HTTP or task state | Common category | Recommended action |
|---|---|---|
400 | Wrong family body (for example aspect_ratio on an official ID, or 1080p on veo3.1-fast), missing prompt, or both image_urls and referenceImages | Match the body to the family; keep veo3.1-fast at 720p; use only one of image_urls or metadata.referenceImages on the official path |
401 | Missing or invalid API key | Confirm Authorization: Bearer <API_KEY>. Official Veo pages do not document extra auth scopes |
429 | Rate or concurrency limit | Honor Retry-After; back off with jitter |
5xx or client timeout | Temporary gateway or upstream issue | Query the existing task id before resubmitting |
status: queued or in_progress | Not an error | Continue polling on GET /v1/videos/generations/{task_id} |
status: failed | Generation did not succeed | Read error.message. Official docs do not state that failed tasks are always unbilled |
invalid apitype: -1 (model-guide FAQ) | Request sent to the wrong endpoint, often a chat endpoint | Submit the documented video generation path and poll the video status path |
5. Pricing & FinOps ROI
Quote only what the live model-guide pages showed on 2026-11-24, and treat those figures as a snapshot. Final billing follows the current account pricing catalog and the actual cost fields on the task.
- Veo 3.1 Fast: planning reference $0.14 per request at 720p,
per_request. The page itself says the displayed value is a planning reference. - veo3.1-lite: planning reference 14 credits / request. That page does not publish a USD table or a 720p-versus-1080p split.
- Official guides quote credits per second: fast-official 16 credits/second, lite-official 4.8 credits/second, quality-official 64 credits/second. They do not publish a per-resolution USD table.
Do not invent per-second USD rates, Vertex AI list prices, or “2x faster / sub-25 second” latency claims. Choose veo3.1-fast when you need a fixed 8-second 720p draft; switch to veo3.1-lite when you need documented 1080p on the gateway family; use the official family when you need 4/6/8-second durations, generateAudio, or keyframe fields. Compare the two families in the pricing article.
6. Frequently Asked Questions
See the FAQ block in frontmatter. Summary: use documented Veo 3.1 IDs, not draft google-veo-3 strings; keep veo3.1-fast at 720p; do not invent a first-party ComfyUI node; poll GET /v1/videos/generations/{task_id} and read result.data[0].url; treat model-guide rates as a dated snapshot.
7. Action Checklist
- Pick a family first: gateway (
veo3.1-fast/veo3.1-lite) or official (Veo3.1-*-official), and use that page’s field names. - Never send
google-veo-3orgoogle-veo-3-1-fastunless an official page starts documenting them. - Keep
veo3.1-fastat720p/ 8 seconds; useveo3.1-litewhen you need gateway 1080p. - Authenticate with
Authorization: Bearer <API_KEY>and callPOST /v1/videos/generations. - Poll
GET /v1/videos/generations/{task_id}with a bounded timeout; readresult.data[0].urlonly aftercompleted. - In ComfyUI, call the same HTTP API from a generic node; do not install an undocumented “official ToAPIs node.”
- Upload images first; do not send base64 in
image_urls. On the official path, do not combineimage_urlswithreferenceImages. - Price from the live catalog; treat 2026-11-24 model-guide figures as snapshots.
- Download finished videos before
expires_at(documented 30-day retention).