Veo 3.1 create video (Gemini)
POST/v1beta/models/veo-3.1:predictLongRunning
Create an asynchronous Veo 3.1 video generation task with the Gemini REST API (:predictLongRunning).
Call this system's /v1beta/... endpoints. Do not call generativelanguage.googleapis.com or *-aiplatform.googleapis.com.
Auth may use either header:
Authorization: Bearer YOUR_API_KEY
x-goog-api-key: YOUR_API_KEY
Gemini SDK / official REST examples commonly use x-goog-api-key.
Request flow
- Call
POST /v1beta/models/veo-3.1:predictLongRunningto submit a task - Read
namefrom the response (for examplemodels/veo-3.1/operations/task_xxx) - Poll
GET /v1beta/models/veo-3.1/operations/{operation_id}untildoneistrue - Download the video from
response.generateVideoResponse.generatedVideos[0].video.uri
This path also accepts:
POST /v1beta/models/veo-3.1:generateVideos
sampleCount is fixed to 1 by the system.
Image-to-video uses instances[0].image with bytesBase64Encoded and mimeType. HTTP/HTTPS image URLs, referenceImages, lastFrame, video extension (video), and remix are not guaranteed.
Do not mix this task's poll path with the OpenAI Videos style (GET /v1/videos/{video_id}).
Request example
curl --location 'https://open-api.fancyai.com/v1beta/models/veo-3.1:predictLongRunning' \
--header 'Content-Type: application/json' \
--header 'x-goog-api-key: YOUR_API_KEY' \
--data '{
"instances": [
{
"prompt": "A cat walking on a sunny beach, cinematic camera push-in, native audio"
}
],
"parameters": {
"aspectRatio": "16:9",
"durationSeconds": 8,
"resolution": "720p"
}
}'
Request
Responses
- 200
- 400
- 401
Task submitted successfully
Invalid request parameters
Unauthorized