by Anil-matcha
Python wrapper for Veo 4 API by Google DeepMind — native 4K AI video with integrated audio, character consistency & advanced camera controls.
# Add to your Claude Code skills
git clone https://github.com/Anil-matcha/Veo-4-APIThe most comprehensive Python wrapper for the Veo 4 API (developed by Google DeepMind), delivered via muapi.ai. Generate native 4K AI videos up to 30 seconds with integrated audio, character consistency, and advanced camera controls — Google's most powerful video generation model.
🌊 Also explore these top AI video models:
- Seedance 2.0 API — ByteDance's cinematic 2K video model with character sheets & omni-reference
- HappyHorse 1.0 API — Alibaba's #1 ranked model (1392 Elo I2V) with native 1080p & integrated audio
Veo 4 is Google DeepMind's latest state-of-the-art AI video generation model, featuring a 3x larger Transformer architecture than Veo 3, native 4K output, and advanced character anchoring technology.
No comments yet. Be the first to share your thoughts!
images_list.character_video() anchors on reference photos to keep identity consistent across scenes.camera_control for cinematic movements — pan, zoom, orbit, tracking shots.upload_file().16:9, 9:16 (TikTok/Reels), and 1:1.1080p and 4k (native) output.pip install veo-4-api
git clone https://github.com/Anil-matcha/Veo-4-API.git
cd Veo-4-API
pip install -r requirements.txt
Create a .env file in the root directory and add your MuAPI API key:
MUAPI_API_KEY=your_muapi_api_key_here
Use Veo 4 as an MCP (Model Context Protocol) server, allowing AI assistants like Claude Desktop or Cursor to directly invoke Veo 4 generation tools.
MUAPI_API_KEY is set in your environment.python3 mcp_server.py
npx -y @modelcontextprotocol/inspector python3 mcp_server.py
from veo4_api import Veo4API
# Initialize the Veo 4 client
api = Veo4API()
# Generate Video from Text (T2V)
print("Generating AI Video using Veo 4...")
submission = api.text_to_video(
prompt="A cinematic tracking shot through a lush rainforest, sunlight filtering through the canopy, birds calling",
aspect_ratio="16:9",
duration=8,
quality="4k",
camera_control="tracking shot"
)
# Wait for completion
result = api.wait_for_completion(submission['request_id'])
print(f"Success! View your Veo 4 video here: {result['outputs'][0]}")
Veo 4 jointly generates synchronized video and audio in a single pass — include sound cues in your prompt for best results.
from veo4_api import Veo4API
api = Veo4API()
# Text-to-video with audio
submission = api.text_to_video_with_audio(
prompt="A street musician playing violin in Paris, rain on cobblestones, distant traffic, melancholic melody",
aspect_ratio="16:9",
duration=15,
quality="4k"
)
result = api.wait_for_completion(submission['request_id'])
print(f"Video with audio: {result['outputs'][0]}")
# Image-to-video with audio
submission = api.image_to_video_with_audio(
prompt="@image1 comes alive — waves crashing, seagulls calling, ocean breeze rustling palm trees",
images_list=["https://example.com/beach.jpg"],
duration=10,
)
result = api.wait_for_completion(submission['request_id'])
print(f"Animated with audio: {result['outputs'][0]}")
Tip: Include explicit sound cues (e.g. "thunder rumbling", "crowd cheering", "piano melody") for richer, more accurate audio generation.
Veo 4's character anchoring keeps faces and identity consistent across all frames.
from veo4_api import Veo4API
api = Veo4API()
# Anchor on a reference photo
submission = api.character_video(
prompt="@image1 walks confidently through a neon-lit Tokyo street at night",
character_images=["https://example.com/person.jpg"],
aspect_ratio="16:9",
duration=8,
quality="4k",
with_audio=True,
)
result = api.wait_for_completion(submission['request_id'])
print(f"Character video: {result['outputs'][0]}")
Specify cinematic camera movements with the camera_control parameter.
# Zoom in dramatically
submission = api.text_to_video(
prompt="A lone lighthouse on a rocky cliff at dusk, storm approaching",
aspect_ratio="16:9",
duration=10,
quality="4k",
camera_control="slow zoom in"
)
# Orbit around a subject
submission = api.text_to_video(
prompt="A marble statue in a sunlit museum courtyard",
aspect_ratio="16:9",
duration=8,
camera_control="orbit"
)
Endpoint: POST https://api.muapi.ai/api/v1/veo-4-t2v
curl --location --request POST "https://api.muapi.ai/api/v1/veo-4-t2v" \
--header "Content-Type: application/json" \
--header "x-api-key: YOUR_API_KEY" \
--data-raw '{
"prompt": "A majestic eagle soaring over snow-capped mountains at sunrise",
"aspect_ratio": "16:9",
"duration": 8,
"quality": "4k",
"camera_control": "pan right"
}'
Endpoint: POST https://api.muapi.ai/api/v1/veo-4-i2v
curl --location --request POST "https://api.muapi.ai/api/v1/veo-4-i2v" \
--header "Content-Type: application/json" \
--header "x-api-key: YOUR_API_KEY" \
--data-raw '{
"prompt": "@image1 — the clouds drift slowly, light shifts from golden to dusk",
"images_list": ["https://example.com/landscape.jpg"],
"aspect_ratio": "16:9",
"duration": 8,
"quality": "4k"
}'
Endpoint: POST https://api.muapi.ai/api/v1/veo-4-t2v-audio
curl --location --request POST "https://api.muapi.ai/api/v1/veo-4-t2v-audio" \
--header "Content-Type: application/json" \
--header "x-api-key: YOUR_API_KEY" \
--data-raw '{
"prompt": "A busy Tokyo street at night, neon signs, rain, jazz music drifting from a bar",
"aspect_ratio": "16:9",
"duration": 15,
"quality": "4k"
}'
Endpoint: POST https://api.muapi.ai/api/v1/veo-4-i2v-audio
curl --location --request POST "https://api.muapi.ai/api/v1/veo-4-i2v-audio" \
--header "Content-Type: application/json" \
--header "x-api-key: YOUR_API_KEY" \
--data-raw '{
"prompt": "@image1 — waves begin to crash, seagulls cry in the distance, wind howling",
"images_list": ["https://example.com/ocean.jpg"],
"aspect_ratio": "16:9",
"duration": 10,
"quality": "4k"
}'
Endpoint: POST https://api.muapi.ai/api/v1/veo-4-character
curl --location --request POST "https://api.muapi.ai/api/v1/veo-4-character" \
--header "Content-Type: application/json" \
--header "x-api-key: YOUR_API_KEY" \
--data-raw '{
"prompt": "@image1 walks confidently through a neon-lit Tokyo street",
"images_list": ["https://example.com/person.jpg"],
"aspect_ratio": "16:9",
"duration": 8,
"quality": "4k"
}'
Endpoint: POST https://api.muapi.ai/api/v1/veo-4-extend
curl --location --request POST "https://api.muapi.ai/api/v1/veo-4-extend" \
--header "Content-Type: application/json" \
--header "x-api-key: YOUR_API_KEY" \
--data-raw '{
"request_id": "your-completed-request-id",
"prompt": "The eagle lands on a mountain peak, surveying the valley below",
"duration": 10,
"quality": "4k"
}'
Endpoint: POST https://api.muapi.ai/api/v1/veo-4-video-edit
curl --location --request POST "https://api.muapi.ai/api/v1/veo-4-video-edit" \
--header "Content-Type: application/json" \
--header "x-api-key: YOUR_API_KEY" \
--data-raw '{
"prompt": "Change the weather to a dramatic thunderstorm",
"video_urls": ["https://example.com/video.mp4"],
"