GEMINI LABJP
SIRI — WWDC 2026 confirms the revamped Siri runs on a Google Gemini model, though it won't ship in the EU at iOS 27 due to the DMAFLASH3.5 — Gemini 3.5 Flash is now GA, the top Flash model for sustained frontier performance on agentic and coding tasksIMAGE-GA — Gemini 3.1 Flash Image and 3.1 Pro Image are GA as native visual models; the preview versions shut down Jun 25MANAGED-AGENTS — Managed Agents launch in public preview in the Gemini API, running autonomous agents in Google-hosted isolated Linux sandboxesFILE-SEARCH — File Search now supports multimodal search, with native image embedding and retrieval via gemini-embedding-2DEPRECATION — gemini-3.1-flash-image-preview and gemini-3-pro-image-preview shut down Jun 25 — migrate to the GA models soonSIRI — WWDC 2026 confirms the revamped Siri runs on a Google Gemini model, though it won't ship in the EU at iOS 27 due to the DMAFLASH3.5 — Gemini 3.5 Flash is now GA, the top Flash model for sustained frontier performance on agentic and coding tasksIMAGE-GA — Gemini 3.1 Flash Image and 3.1 Pro Image are GA as native visual models; the preview versions shut down Jun 25MANAGED-AGENTS — Managed Agents launch in public preview in the Gemini API, running autonomous agents in Google-hosted isolated Linux sandboxesFILE-SEARCH — File Search now supports multimodal search, with native image embedding and retrieval via gemini-embedding-2DEPRECATION — gemini-3.1-flash-image-preview and gemini-3-pro-image-preview shut down Jun 25 — migrate to the GA models soon
Articles/API / SDK
API / SDK/2026-04-18Advanced

Building an Automated Content Pipeline with Veo 3 & Lyria 3 Pro API — Mass-Producing Video + Music

Learn how to combine Veo 3 and Lyria 3 Pro APIs to automatically generate and merge video and music from text prompts. Covers setup, production-ready Python code, error handling, common pitfalls, and cost optimization strategies.

veo32lyriagemini-api285video-generation3music-generationpython132automation57pipeline7

Premium Article

If you've tried to produce short-form video content at scale as a solo creator, you've probably run into the same wall I did: generating the visuals is one problem, generating decent background music is another, and stitching them together is a third. Doing all three manually for ten videos a day is tedious. Doing it for a hundred is impossible.

Veo 3 and Lyria 3 Pro are now both available through the Google Gen AI API, which means the entire workflow — text prompt → video → music → merged output — can run in a single Python script with no human in the loop. In this guide I'll walk through the production pipeline I've built and currently run, including the parts that took me the longest to get right.

Fair warning: there are several undocumented behaviors in both APIs that will silently break your pipeline if you don't account for them. I'll call each one out explicitly.

What You Need to Know About These Two APIs Before Starting

Veo 3 is Google's video generation model. Given a text prompt (or an image), it produces up to 8 seconds of video. You call it via client.models.generate_video() in the Google Gen AI Python SDK. The response is an Operation — an asynchronous job reference — not the video itself. You have to poll until the job completes, then download the output.

Lyria 3 Pro is Google's music generation model. You describe the style, genre, mood, instruments, and tempo in a text prompt, and it generates up to 3 minutes and 30 seconds of music. Like Veo 3, it's async, though music generation typically finishes faster.

A few facts worth having upfront as of April 2026:

  • Veo 3: Maximum 8 seconds per video, supports 16:9 and 9:16 aspect ratios, billed by resolution and duration
  • Lyria 3 Pro: Maximum 210 seconds per track, WAV or MP3 output, stereo, detailed style control via prompt
  • Quota independence: The two APIs have separate quotas. Hitting the Veo 3 rate limit does not affect Lyria, and vice versa. Design your pipeline to handle each independently.

The most important architectural decision you'll make is whether to run the two generations sequentially or in parallel. Sequential is simpler to implement. Parallel is roughly 40% faster in wall-clock time because Veo 3 generation (60–120 seconds typical) and Lyria generation (20–60 seconds typical) can overlap. This guide uses the parallel approach.

Pipeline Architecture Overview

Here's the shape of what we're building:

  • Input: A content description, split into a video prompt and a music prompt
  • Step 1: Veo 3 generates the video file (async, polled to completion)
  • Step 2: Lyria 3 Pro generates the music file (async, run in parallel with Step 1)
  • Step 3: ffmpeg merges the two files, adjusts audio volume, applies a fade-out
  • Output: A finished .mp4 saved to the output directory

Each step has its own retry logic with exponential backoff. The pipeline returns a structured result dict so you can log successes and failures and feed the output into downstream automation (social media scheduling, CDN upload, etc.).

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
Solve the authentication, rate-limiting, and polling pitfalls that trip up every developer when combining Veo 3 and Lyria 3 Pro APIs — with working code to fix them
Get a copy-paste production pipeline that automatically generates video and background music from a single text prompt, then merges them using ffmpeg
Master cost reduction strategies that cut API spend by up to 60%, plus a formula to forecast your monthly bill before it surprises you
Secure payment via Stripe · Cancel anytime
Share

Thank You for Reading

Gemini Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

API / SDK2026-04-14
Veo API Not Working? Common Errors and How to Fix Them
Troubleshoot common Veo API errors including polling implementation mistakes, safety filter rejections, quota exceeded, and video file download failures. With working Python code examples.
API / SDK2026-05-17
Auto-generating Japanese and English Release Notes from git log with Gemini API — A Real Implementation from Beautiful HD Wallpapers v2.1.0
I realized I was spending 1–2 hours per release writing notes in multiple languages. Here's how I automated that with Gemini API and git log — tested on Beautiful HD Wallpapers v2.1.0, with code you can run today.
API / SDK2026-05-03
Automate Contact Form Handling with Gemini API — Classification, Priority Scoring & Slack Alerts
Build a Python system that automatically classifies incoming contact form submissions using Gemini API, scores their priority, and sends structured Slack notifications — ready to deploy today.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →