Generate hyper-realistic, cinematic videos directly within OpenWebUI using Google's Veo 3.1 model!
This script fully integrates Veo 3.1's advanced long-running operations and dynamically embeds a native HTML5 video player into your chat stream.
Note: This tool runs on Google's Gemini Enterprise Agent Platform (formerly Vertex AI). The 2026 rebrand changed the Cloud Console product name and some IAM role labels, but the API endpoint (
aiplatform.googleapis.com), model IDs, and SDKs are unchanged — so the setup below works as-is.
✨ Native Chat Embeds: Videos render flawlessly inline as native HTML5 video players.
✨ Image-to-Video: Upload reference images directly in the chat to use as starting frames or style references!
✨ Video Editing: Edit existing videos by uploading them or providing a GCS URI (gs://).
✨ Custom UserValves: Includes a custom settings UI allowing each user to choose their own Aspect Ratio (16:9 or 9:16), Duration (4s, 6s, 8s), and Resolution (720p, 1080p, 4K)!
✨ Multi-Video Support: Set the tool to generate up to 4 videos at once, and they will all stack neatly in the chat interface!
✨ Downloads: Direct download links are automatically generated below each video.
✨ Non-blocking: Uses an async polling loop to fetch long-running 4K video generation tasks without freezing your chat interface.
You must have a Google Cloud Project with the Gemini Enterprise Agent Platform (formerly Vertex AI) API enabled. Unlike OpenAI, Google requires proper IAM Authentication rather than a simple API key. Here is how to set it up depending on how you installed OpenWebUI:
- Install the Google Cloud SDK (
gcloudCLI) on your host machine. - Open your terminal/command prompt and run:
gcloud auth application-default login - A browser window will open. Log into your Google Cloud account.
- Restart your OpenWebUI Python server. The script will automatically detect the credentials!
Since OpenWebUI runs inside an isolated container, that container needs to be handed your Google Cloud credentials.
- Go to your Google Cloud Console and navigate to IAM & Admin > Service Accounts.
- Create a new Service Account and grant it the
Vertex AI Userrole. (The console may show this under a renamed label after the 2026 rebrand — the underlying permission is the same.) - Click on the Service Account, go to the Keys tab, and select Add Key > Create New Key > JSON. This will download a
.jsonfile. - Move this JSON file into your OpenWebUI data directory on your host (for example, name it
gcp-key.json). - Update your OpenWebUI
docker runcommand (ordocker-compose.yml) to add this environment variable:-e GOOGLE_APPLICATION_CREDENTIALS="/app/backend/data/gcp-key.json"(Note: Adjust the container path based on where your OpenWebUI data volume is mounted).
- Download your Service Account JSON key from Google Cloud (same as Docker steps 1-3).
- Create a secret in your OpenWebUI namespace:
kubectl create secret generic vertex-auth --from-file=gcp-key.json=./gcp-key.json - Update your OpenWebUI Helm
values.yamlto mount this secret:
extraEnvVars:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: "/auth/gcp-key.json"
extraVolumes:
- name: vertex-auth-volume
secret:
secretName: vertex-auth
extraVolumeMounts:
- name: vertex-auth-volume
mountPath: "/auth"
readOnly: true- Install this tool in your workspace using the
veo_video_tool.pyscript. - Click the Valves (gear) icon for this tool on the admin page.
- Enter your Google Cloud Project ID.
- Enter your Location ID (e.g.,
us-central1). - (Optional) Adjust the
Max Timeout Secondsif you plan to generate 4K 8-second videos, as those can take several minutes.
Users can click the Tool Settings gear icon in their chat interface to customize their preferred aspect ratio, resolution, duration, and the number of videos to generate. Then, just mention the tool in chat with your prompt!
You can provide existing media for Veo 3.1 to use as a starting frame or reference:
- Direct Upload (Images & Short videos): Click the
+attachment icon in OpenWebUI to attach an image or short video directly to your chat message. - Image URLs: Paste a public URL to an image in your prompt, and the tool will download it automatically.
- GCS URI (Long/Large videos): For larger videos, upload the video to a Google Cloud Storage bucket and provide the
gs://your-bucket-name/video.mp4link in your chat prompt. The tool will seamlessly hand it off to the platform!
For official tips, tricks, and best practices on prompting Veo 3.1 to get the best possible videos, check out the Official Gemini API Veo Prompting Guide.
