openclaw - ✅(Solved) Fix [Bug]: video_generate tool fails with 404 for Google Veo models (API key is valid) [1 pull requests, 2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#62309Fetched 2026-04-08 03:06:16
View on GitHub
Comments
2
Participants
3
Timeline
9
Reactions
0
Author
Timeline (top)
commented ×2cross-referenced ×2labeled ×2mentioned ×1

When attempting to generate a video using the built-in video_generate tool with Google's Veo models (e.g., google/veo-3.1-fast-generate-preview), the operation immediately fails with a 404 error. The GEMINI_API_KEY is correctly configured and works perfectly when tested with the official google-genai Python SDK.

Error Message

When attempting to generate a video using the built-in video_generate tool with Google's Veo models (e.g., google/veo-3.1-fast-generate-preview), the operation immediately fails with a 404 error. The GEMINI_API_KEY is correctly configured and works perfectly when tested with the official google-genai Python SDK. 4. Observe the failure event in the background task: {"error":{"message":"","code":404,"status":""}}

Root Cause

When attempting to generate a video using the built-in video_generate tool with Google's Veo models (e.g., google/veo-3.1-fast-generate-preview), the operation immediately fails with a 404 error. The GEMINI_API_KEY is correctly configured and works perfectly when tested with the official google-genai Python SDK.

Fix Action

Fixed

PR fix notes

PR #62423: fix(google): use v1alpha API version for preview Veo models (#62309)

Description (problem / solution / changelog)

Summary

Google Veo preview models (e.g. veo-3.1-fast-generate-preview) return HTTP 404 because the @google/genai SDK defaults to the v1beta API version, but these models are only available at v1alpha.

Root Cause

The @google/genai SDK's models.generateVideos() internally calls POST /v1beta/models/{model}:predictLongRunning. Preview Veo models are not yet served at v1beta — they require v1alpha. The SDK accepts an apiVersion override via httpOptions, but the provider was not setting it.

Changes

  • extensions/google/video-generation-provider.ts: Add resolveApiVersion() helper that returns "v1alpha" for models ending in -preview, and pass it via httpOptions.apiVersion when constructing the GoogleGenAI client.
  • extensions/google/video-generation-provider.test.ts: Update the existing test to verify apiVersion: "v1alpha" is passed for preview models, and add a new test confirming GA models (e.g. veo-2.0-generate-001) do not set apiVersion.

Test

pnpm test extensions/google/video-generation-provider.test.ts
# 4 passed (4)

Closes #62309

Changed files

  • extensions/google/video-generation-provider.test.ts (modified, +45/-1)
  • extensions/google/video-generation-provider.ts (modified, +13/-2)

Code Example



---

from google import genai
client = genai.Client()

operation = client.models.generate_videos(
    model="veo-3.1-fast-generate-preview",
    prompt="A test prompt..."
)
print(operation) # Successfully returns the Operation ID
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

When attempting to generate a video using the built-in video_generate tool with Google's Veo models (e.g., google/veo-3.1-fast-generate-preview), the operation immediately fails with a 404 error. The GEMINI_API_KEY is correctly configured and works perfectly when tested with the official google-genai Python SDK.

Steps to reproduce

  1. Set a valid GEMINI_API_KEY in the environment that has access to Veo.
  2. Call the video_generate tool with model="google/veo-3.1-fast-generate-preview".
  3. Alternatively, set the default model via config: openclaw config set agents.defaults.videoGenerationModel.primary "google/veo-3.1-fast-generate-preview", restart the gateway, and call video_generate.
  4. Observe the failure event in the background task: {"error":{"message":"","code":404,"status":""}}

Expected behavior

The video generation task should submit successfully and return the generated video.

Actual behavior

raise 404

OpenClaw version

2026.4.5

Operating system

wsl2

Install method

npm

Model

GPT-5.4

Provider / routing chain

openai-codex

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

I verified that the API key and account permissions are completely fine. I ran a test script using the official google-genai SDK within the same environment, and it successfully submitted the task and generated the video:

from google import genai
client = genai.Client()

operation = client.models.generate_videos(
    model="veo-3.1-fast-generate-preview",
    prompt="A test prompt..."
)
print(operation) # Successfully returns the Operation ID

extent analysis

TL;DR

The issue might be resolved by checking the model name and version used in the video_generate tool, as the official Google GenAI SDK uses a different model name ("veo-3.1-fast-generate-preview" without the "google/" prefix).

Guidance

  • Verify that the model name used in the video_generate tool matches the one used in the official Google GenAI SDK, which does not include the "google/" prefix.
  • Check the documentation for the video_generate tool to ensure that the model name format is correct.
  • Test the video_generate tool with a different model to see if the issue is specific to the "google/veo-3.1-fast-generate-preview" model.
  • Review the API documentation for any specific requirements or restrictions on model names and versions.

Example

# Official Google GenAI SDK example
from google import genai
client = genai.Client()

operation = client.models.generate_videos(
    model="veo-3.1-fast-generate-preview",  # Note the model name format
    prompt="A test prompt..."
)
print(operation)

Notes

The issue may be specific to the video_generate tool or the OpenClaw version being used. Further investigation into the tool's documentation and configuration may be necessary to resolve the issue.

Recommendation

Apply workaround: Try removing the "google/" prefix from the model name in the video_generate tool to match the format used in the official Google GenAI SDK.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The video generation task should submit successfully and return the generated video.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING