◉GEMINI LABJP
●CHANGELOG — No new Gemini API changelog entries since 11/19; the stable CLI is still v0.70.0●2.5 ROUTE — From 12/1, gemini-2.5-pro reroutes to 3.8 Flash and 2.5-flash to 3.5 Flash-Lite. 8 days left●SPEND CAP — Developers are asking for a hard spend limit on the API. Set budget alerts and decide how you would pause a key●CARBON — Gemini 4 Carbon launch pricing ends 11/30, 7 days left●OMNI 1.2 — On 12/3, gemini-omni-1.1-flash switches to 1.2 automatically●/SHELLS — /shells still appears in the docs but was removed. If a command fails, check whether it still exists●CHANGELOG — No new Gemini API changelog entries since 11/19; the stable CLI is still v0.70.0●2.5 ROUTE — From 12/1, gemini-2.5-pro reroutes to 3.8 Flash and 2.5-flash to 3.5 Flash-Lite. 8 days left●SPEND CAP — Developers are asking for a hard spend limit on the API. Set budget alerts and decide how you would pause a key●CARBON — Gemini 4 Carbon launch pricing ends 11/30, 7 days left●OMNI 1.2 — On 12/3, gemini-omni-1.1-flash switches to 1.2 automatically●/SHELLS — /shells still appears in the docs but was removed. If a command fails, check whether it still exists
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.

veo3lyriagemini-api291video-generation3music-generationpython113automation55pipeline9

✦ 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
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
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-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-04-03
Building Event-Driven Async AI Pipelines with Gemini API — Pub/Sub, Webhooks, and Queue Integration for Production
A deep dive into designing event-driven asynchronous AI pipelines using Gemini API with Google Cloud Pub/Sub, webhooks, and Redis queues. Includes the design pitfalls and how to estimate cost and throughput.
◈ API / SDK2026-10-22
Before You Swap in gemini-4-argon, Search Your Own Code for What to Remove
Four habits can break or silently change when you move to gemini-4-argon: explicit caches, sampling parameters, small max_output_tokens and short timeouts. A stdlib-only script finds them in your repository, with what to check after the swap and when to stay on Flash.