openclaw - ✅(Solved) Fix [Bug]: video_generate: Google Veo 3.1 returns 404 'No such model' due to wrong API endpoint [2 pull requests, 1 comments, 2 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#63008Fetched 2026-04-09 07:59:36
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×2commented ×1referenced ×1renamed ×1

Error Message

The video_generate tool fails when using google/veo-3.1-fast-generate-preview model with error: The SDK's generateVideos() calls a different endpoint that doesn't recognize the Veo video model, hence the 404 error.

Root Cause

The OpenClaw Google video generation provider uses @google/genai SDK's client.models.generateVideos() method, which calls models/{model}:generateVideos endpoint.

However, the correct Google AI Studio API for Veo video generation uses predictLongRunning endpoint:

# This works correctly:
curl -X POST \\
  \"https://generativelanguage.googleapis.com/v1beta/models/\${MODEL_ID}:predictLongRunning?key=\${GEMINI_API_KEY}\"

The SDK's generateVideos() calls a different endpoint that doesn't recognize the Veo video model, hence the 404 error.

Fix Action

Fixed

PR fix notes

PR #63014: fix(google): use predictLongRunning for Veo video generation #63008

Description (problem / solution / changelog)

Summary

  • Problem: video_generate fails for Veo (e.g. google/veo-3.1-fast-generate-preview) with 404 "No such model" because the provider uses the SDK models.generateVideos() endpoint.
  • Why it matters: Veo video generation in the Gemini API is exposed via a long-running operation flow (:predictLongRunning), so the current endpoint choice breaks real-world usage.
  • What changed: Switch Google video generation to the Gemini REST flow: models/{model}:predictLongRunning + poll the operation + download the resulting video.uri.
  • What did NOT change (scope boundary): No changes to other providers, core routing, or config schema. Kept the existing duration rounding behavior (to 4/6/8).

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Fixes #63008

User-visible / Behavior Changes

  • Google Veo video generation now uses the Gemini API predictLongRunning endpoint and polls the LRO before downloading the final video.

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (No)
  • New/changed network calls? (Yes) Switched the request path to :predictLongRunning, added explicit operation polling and video.uri download.
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (No)

Repro + Verification

Environment

  • OS: Linux
  • Model/provider: Google / Veo (Gemini API)
  • Relevant config (redacted):
    • agents.defaults.videoGenerationModel.primary = google/veo-3.1-fast-generate-preview
    • GEMINI_API_KEY=***

Steps

  1. Configure GEMINI_API_KEY.
  2. Set agents.defaults.videoGenerationModel.primary to google/veo-3.1-fast-generate-preview.
  3. Ask the agent to generate a video.

Expected

  • Video generation completes successfully.

Actual

  • Before: 404 NOT_FOUND "No such model ... at this location".
  • After: Uses :predictLongRunning, polls completion, downloads the generated video.

Evidence

  • Failing behavior reported in issue + unit test coverage for REST request/poll/download flow.

Human Verification (required)

  • Verified scenarios:
    • Unit test: pnpm test extensions/google/video-generation-provider.test.ts
  • Edge cases checked:
    • Duration rounding to supported Veo values (4/6/8).
  • What I did not verify:
    • Live request against Google APIs (requires real API key / network).

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (No)
  • Migration needed? (No)

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly:
    • Revert this PR commit.
  • Known bad symptoms reviewers should watch for:
    • Video generation polls timing out or failing to download from video.uri.

Risks and Mitigations

  • Risk: Response shape drift in the operation payload.
    • Mitigation: Parsing is defensive and the test locks the expected request + polling + download flow.

Changed files

  • extensions/google/video-generation-provider.test.ts (modified, +137/-86)
  • extensions/google/video-generation-provider.ts (modified, +210/-86)

PR #62343: fix(google): add REST fallback for Veo SDK 404 compatibility issue

Description (problem / solution / changelog)

Problem

@google/genai 1.x client.models.generateVideos returns 404 for Veo 3.x models on some environments, while the equivalent REST endpoint (predictLongRunning) succeeds with the same API key and model.

Fix

For text-only video generation, try the SDK path first. If it returns a 404 or reports no generated videos, transparently fall back to the predictLongRunning REST API.

For prompts with reference image or video inputs, the SDK path is kept as-is — the REST API does not expose equivalent conditioning parameters.

Testing

  • Verified end-to-end with veo-3.1-lite-generate-preview via Telegram
  • SDK alone returns 404; REST returns 200 on same key + model
  • Unit tests added for fallback paths

Closes #62309 Closes #63008

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • extensions/google/video-generation-provider.test.ts (modified, +143/-17)
  • extensions/google/video-generation-provider.ts (modified, +394/-58)

Code Example

404 NOT_FOUND
No such model \"veo-3.1-fast-generate-preview\" at this location

---

# This works correctly:
curl -X POST \\
  \"https://generativelanguage.googleapis.com/v1beta/models/\${MODEL_ID}:predictLongRunning?key=\${GEMINI_API_KEY}\"
RAW_BUFFERClick to expand / collapse

Problem

The video_generate tool fails when using google/veo-3.1-fast-generate-preview model with error:

404 NOT_FOUND
No such model \"veo-3.1-fast-generate-preview\" at this location

Environment

  • OpenClaw version: 2026.4.8 (also affected 2026.4.5 when feature was introduced)
  • Google plugin with @google/genai SDK

Steps to Reproduce

  1. Configure GEMINI_API_KEY environment variable
  2. Set agents.defaults.videoGenerationModel.primary to google/veo-3.1-fast-generate-preview
  3. Ask agent to generate a video with a prompt

Root Cause

The OpenClaw Google video generation provider uses @google/genai SDK's client.models.generateVideos() method, which calls models/{model}:generateVideos endpoint.

However, the correct Google AI Studio API for Veo video generation uses predictLongRunning endpoint:

# This works correctly:
curl -X POST \\
  \"https://generativelanguage.googleapis.com/v1beta/models/\${MODEL_ID}:predictLongRunning?key=\${GEMINI_API_KEY}\"

The SDK's generateVideos() calls a different endpoint that doesn't recognize the Veo video model, hence the 404 error.

Verification

The same GEMINI_API_KEY and model (veo-3.1-fast-generate-preview) works correctly when using the predictLongRunning endpoint directly via curl, confirming the API key and model are valid.

Expected Behavior

video_generate should successfully generate videos using Google Veo models.

Code Reference

The video generation provider is implemented in:

  • extensions/google/video-generation-provider.ts - uses GoogleGenAI from @google/genai
  • Line 233: client.models.generateVideos({...})

The predictLongRunning endpoint pattern is documented in Google AI Studio's example code for video generation.

extent analysis

TL;DR

Update the video_generate tool to use the predictLongRunning endpoint instead of generateVideos to fix the 404 error with the veo-3.1-fast-generate-preview model.

Guidance

  • Verify the GEMINI_API_KEY and model (veo-3.1-fast-generate-preview) are correct by testing with the predictLongRunning endpoint via curl.
  • Update the extensions/google/video-generation-provider.ts file to use the predictLongRunning endpoint, replacing the client.models.generateVideos() call on line 233.
  • Consult the Google AI Studio's example code for video generation to ensure correct implementation of the predictLongRunning endpoint.
  • Test the updated video_generate tool to ensure successful video generation using the veo-3.1-fast-generate-preview model.

Example

// Update line 233 in extensions/google/video-generation-provider.ts
// from:
// client.models.generateVideos({...})
// to:
// client.models.predictLongRunning({...})

Notes

The fix relies on updating the video_generate tool to use the correct endpoint for Veo video generation. This change should be tested thoroughly to ensure compatibility with other models and features.

Recommendation

Apply workaround: Update the video_generate tool to use the predictLongRunning endpoint, as the current generateVideos method is not compatible with the veo-3.1-fast-generate-preview model.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING