last_frame parameter is not supported in Gemini API. — Veo SDK error (generateAudio, video)
The exact error
ValueError: last_frame parameter is not supported in Gemini API.
What it means
This error is raised by the Google Gen AI SDK on your machine, not returned by Google’s servers. The SDK can target two backends: the Gemini API (API key) and Vertex AI (Google Cloud project). The message says the SDK will not pass this parameter to the Gemini API backend.
The traceback in Google AI Developers Forum thread 107529 shows this. A Python user calling generate_videos on veo-3.1-generate-preview with a last frame got a ValueError raised inside the SDK’s _GenerateVideosConfig_to_mldev function. Judging by the traceback, that is the step that converts the config into a Gemini API request, before any HTTP call. So there is no HTTP status code and no server response to inspect.
For last_frame, the cause was an out-of-date SDK. The original poster later wrote that their library version was not updated enough to handle the feature, and that a library update fixed it. A second user confirmed they needed a version that supports lastFrame. Google’s Veo docs now document lastFrame on the Gemini API for first and last frame generation with Veo 3.1. The parameter table says it must be used together with image.
Variants with other parameter names
The same message pattern appears for other fields:
generateAudio parameter is not supported in Gemini API.In js-genai issue #1017, a user passedgenerateAudio: falsetoveo-3.0-fast-generate-001. A responder assigned to the issue reproduced it on the Gemini API and reported that the same code worked on Vertex AI. They later explained that audio generation is on by default in the Gemini API and cannot be turned off there, while Vertex AI lets you disable it. Google’s Veo docs list audio as “Always on” for every Veo model on the Gemini API.video parameter is not supported in Gemini API.In js-genai issue #1059, a user extending a video in the browser hit this error. A js-genai contributor could not reproduce it on SDK v1.28.0 and suggested the latest version. In a later log from the same reporter, the request did reach the API and failed with a different error about the raw video bytes it carried.
How to confirm it’s this
- The error is a plain exception, not an API error with a status code. In Python it is a
ValueError. In issue #1017 the JavaScript SDK printed a plainError:, while the server-side error later in issue #1059 printed asApiError. - The stack trace points into the SDK, for example a function name ending in
_to_mldev, rather than into an HTTP response handler. - No request appears in your network logs or proxy.
- Check your installed SDK version against the latest release.
Fix
- Upgrade the SDK. For
last_frameandvideo, the reports above were resolved or could not be reproduced on a newer SDK. Then follow Google’s current example. In Python it passes the first frame asimage=and the last frame asconfig=types.GenerateVideosConfig(last_frame=...), onveo-3.1-generate-preview. - Remove parameters the Gemini API does not offer. For
generateAudio, delete the field. On the Gemini API, Veo always generates audio. - If you need a Vertex-only option, switch the SDK to the Vertex AI backend. The responder in issue #1017 said Vertex AI allows disabling audio. That requires a Google Cloud project with Vertex AI enabled, which the reporter in that issue did not have. Vertex AI has its own model access rules. For example, frame interpolation on Vertex has returned an allowlist error.
Retry or not
No. The SDK raises this before any network call, so a retry runs the same check and fails immediately. Nothing reaches Google, so there is nothing to wait out, and an agent that loops on it only wastes time. Treat it as a configuration or dependency error. Upgrade the SDK or change the parameters, then send a new call. There is no backoff to tune.
When it’s not this
Your use case is currently not supported.This one comes back from the server. In thread 107529, one user reported it when using a last frame with a 4-second duration, and said 8 seconds worked. That is a user report, but Google’s table does tie several Veo 3.1 features to an 8-second duration.Frame interpolation is not allowlisted for project. This is a server-side 400FAILED_PRECONDITION, reported on the Vertex AI side forlast_framewith a Veo 3.0 model.`fileUri` isn't supported by this model.The request reached the API and a field in the body was rejected.
Related errors
- Use case not supported
- Frame interpolation is not allowlisted
- fileUri isn’t supported by this model
- Input video must be generated by Veo
- API keys are not supported, expected OAuth2
Error text last verified against the sources below on .