Hi everyone,
I’m trying to use the Veo 3.1 video extension feature via the REST API (not Python SDK), and I’m consistently getting errors no matter which payload format I try. I’ve tested 7 different formats based on various documentation sources, and none work.
### My Setup
- **Endpoint**: `https://generativelanguage.googleapis.com/v1beta/models/veo-3.1-generate-preview:predictLongRunning\`
- **Authentication**: API key via `x-goog-api-key` header
- **Goal**: Extend an 8-second Veo-generated video by another 8 seconds
- **Video uploaded via**: GoogleAIFileManager (returns file ID like `files/xxx`)
### The Problem
All my attempts fail with errors indicating the `video` field format is wrong, but I can’t find the correct format for REST API.
### What I’ve Tried
**Attempt 1: Plain string (short format)**
```json
{
“instances”: [{
“prompt”: “Continue the video…”,
“video”: “files/abc123xyz”
}],
“parameters”: {
“resolution”: “720p”,
“aspectRatio”: “16:9”,
“durationSeconds”: 8
}
}
```
**Error**: `“No struct value found for field expecting a video.”`
-–
**Attempt 2: Plain string (full URI)**
```json
{
“instances”: [{
“prompt”: “Continue the video…”,
“video”: “https://generativelanguage.googleapis.com/v1beta/files/abc123xyz”
}],
“parameters”: {…}
}
```
**Error**: `“No struct value found for field expecting a video.”`
-–
**Attempt 3: Object with fileUri (Vertex AI style)**
```json
{
“instances”: [{
“prompt”: “Continue the video…”,
“video”: {
“fileUri”: “files/abc123xyz”
}
}],
“parameters”: {…}
}
```
**Error**: `“`fileUri` isn’t supported by this model.”`
-–
**Attempt 4: Object with gcsUri**
```json
{
“instances”: [{
“prompt”: “Continue the video…”,
“video”: {
“gcsUri”: “gs://bucket/video.mp4”
}
}],
“parameters”: {…}
}
```
**Error**: `“`gcsUri` isn’t supported by this model.”`
-–
**Attempt 5: fileData wrapper (camelCase)**
```json
{
“instances”: [{
“prompt”: “Continue the video…”,
“video”: {
“fileData”: {
“fileUri”: “files/abc123xyz”
}
}
}],
“parameters”: {…}
}
```
**Error**: `“`fileData` isn’t supported by this model.”`
-–
**Attempt 6: Simple file object**
```json
{
“instances”: [{
“prompt”: “Continue the video…”,
“video”: {
“file”: “files/abc123xyz”
}
}],
“parameters”: {…}
}
```
**Error**: `“No struct value found for field expecting a video.”`
-–
**Attempt 7: file_data with mime_type (per Files API docs)**
Based on the Files API documentation which shows REST API format as:
```json
“file_data”: {
“mime_type”: “${MIME_TYPE}”,
“file_uri”: “${file_uri}”
}
```
I tried:
```json
{
“instances”: [{
“prompt”: “Continue the video…”,
“video”: {
“file_data”: {
“file_uri”: “files/abc123xyz”,
“mime_type”: “video/mp4”
}
}
}],
“parameters”: {…}
}
```
**Result**: Request sent but no response received (20+ minutes, no error or success in logs)
### Questions
1. **What is the correct REST API payload format for video extension?** The Python SDK examples show `video=file_object`, but what’s the equivalent JSON structure for REST?
2. **Does video extension require special access/allowlisting?** The official docs don’t mention any restrictions, but I can’t get it to work.
3. **Is there a REST API example for video extension?** All the documentation examples I found use the Python SDK. I need the raw JSON structure.
4. **Are there any differences between Gemini API and Vertex AI formats?** I’m using the Gemini API endpoint with API key authentication (not Vertex AI with OAuth2).
### What Works
-
Initial video generation (text-to-video) works fine
-
File upload via GoogleAIFileManager works
-
Using the uploaded file for image-to-video works (using same file ID format)
-
Only video extension fails
### Environment
- API: Gemini API
- Model: veo-3.1-generate-preview
- Authentication: API key rotation (20 keys)
- Node.js with axios for HTTP requests
- Video: Valid 8-second Veo-generated MP4, uploaded via GoogleAIFileManager
Has anyone successfully used video extension via REST API? If so, could you share a working payload example?
Any help would be greatly appreciated! I’ve been stuck on this for days and exhausted all documented formats.
Thanks!