Complete Request Examples
Complete Request Example#
Producer API - Complete Request Examples#
This document provides comprehensive request body examples for all Producer API operations. Each example includes detailed explanations and best practices.⚠️ Migration Notice (2026-04, updated 2026-05)#
Producer API is powered by Google Lyria 3 Pro. Legacy mv values (FUZZ-*) are silently aliased to Lyria 3 Pro — your existing requests continue to work. The examples below use the new defaults.cover_music is supported again as of 2026-05-20 (see Cover Music below). It takes a new strength parameter (0–1) and the legacy cover_strength field is kept as an alias.The music_variation, swap_music_vocals, and swap_music_sound operations remain unsupported and return HTTP 410 Gone. For segment-level transformations, use replace_music targeting the specific time window.The advanced parameters make_instrumental, lyrics_strength, sound_strength, and weirdness are accepted at the API surface but silently ignored — Lyria 3 Pro does not support them.
Table of Contents#
1. Create Music (with Lyrics)#
Generate music with complete lyrics and optional style description.Endpoint#
POST /api/v1/producer/create
Request Body#
{
"task_type": "create_music",
"lyrics": "[Verse 1]\nStars they shine above me\nMoonlight softly glows\nWhispers in the night sky\nWhere only love grows\n\n[Verse 2]\nMidnight winds are calling\nCarrying a tune\nHeartbeats echo softly\nDancing with the moon\n\n[Chorus]\nStarry night starry night\nLet your light ignite ignite\nBright as day bright as day\nGuide my way guide my way\n\n[Verse 3]\nShadows move and twinkle\nNight will divide my in the heavens\nStories that survive\n\n[Bridge]\nMagic fills the darkness\nWonder in the air\nEvery star a secret\nIn the sky I stare\n\n[Chorus]\nStarry night starry night\nLet your light ignite ignite\nBright as day bright as day\nGuide my way guide my way",
"sound": "pop",
"title": "Starry Night"
}
Parameters Explanation#
task_type: create_music - Creates a new music track
lyrics: Complete song lyrics with verse/chorus structure
sound: Music style descriptor (e.g., "pop", "rock", "jazz")
title: Song title (max 80 characters)
mv: Optional. Defaults to Lyria 3 Pro.
Best Practices#
Provide complete, well-structured lyrics (minimum 20-30 words)
Use proper formatting with [Verse], [Chorus], [Bridge] markers
Include line breaks (\n) for proper lyric structure
The sound parameter helps define the musical style
2. Create Music (with Description/Sound)#
Generate music using only style descriptions without lyrics.Endpoint#
POST /api/v1/producer/create
Request Body#
{
"task_type": "create_music",
"sound": "upbeat electronic dance music with energetic synths, pulsing bass, and driving four-on-the-floor beat, perfect for club atmosphere with euphoric buildups and drops"
}
Alternative Examples#
Example 1: Ambient Meditation#
{
"task_type": "create_music",
"sound": "instrumental, no vocals, peaceful ambient meditation music with soft piano melodies, gentle nature sounds, flowing water, and calming atmospheric pads for deep relaxation",
"lyrics": "",
"title": "Inner Peace"
}
Example 2: Rock Anthem#
{
"task_type": "create_music",
"sound": "powerful rock anthem with distorted electric guitars, thundering drums, heavy bass, and energetic male vocals singing about overcoming challenges",
"title": "Rise Up"
}
Example 3: Jazz Lounge (Instrumental)#
{
"task_type": "create_music",
"sound": "instrumental, no vocals, smooth jazz lounge music with sultry saxophone, soft piano chords, brushed drums, and upright bass creating a sophisticated late-night atmosphere",
"lyrics": "",
"title": "Midnight Blues"
}
Example 4: With BPM and Length#
{
"task_type": "create_music",
"sound": "energetic pop rock with electric guitar and drums",
"lyrics": "[Verse]\nWalking through the city lights\nFeeling like I own the night\n\n[Chorus]\nWe are unstoppable tonight",
"title": "Unstoppable",
"bpm": 128,
"length": 60
}
Best Practices#
Write detailed, descriptive prompts (minimum 10-20 words)
Include specific instruments, mood, tempo, and genre
For instrumentals, include "instrumental, no vocals" in the prompt and leave lyrics empty
Be specific about the atmosphere or emotion you want
Use bpm for tempo control and length (1–240 seconds) to bound duration
3. Create Instrumental Music#
Generate pure instrumental tracks without vocals.Migration note: Lyria 3 Pro does not support a dedicated make_instrumental flag. Instead, leave lyrics empty and include explicit "instrumental, no vocals" cues in your sound prompt — Lyria responds well to these instructions.
Endpoint#
POST /api/v1/producer/create
Request Body#
{
"task_type": "create_music",
"sound": "instrumental, no vocals, cinematic orchestral score with soaring strings, powerful brass section, epic percussion, and dramatic crescendos perfect for movie trailer",
"lyrics": "",
"title": "Epic Journey"
}
Alternative Examples#
Example 1: Classical Piano#
{
"task_type": "create_music",
"sound": "instrumental, no vocals, classical piano solo with delicate melodic phrases, emotional dynamics, and romantic period styling reminiscent of Chopin",
"lyrics": "",
"title": "Moonlight Sonata Redux"
}
Example 2: Electronic Chillout#
{
"task_type": "create_music",
"sound": "instrumental, no vocals, downtempo electronic chillout with warm analog synths, subtle glitch effects, deep sub bass, and atmospheric textures",
"lyrics": "",
"title": "Digital Dreams",
"length": 90
}
Best Practices#
Always include "instrumental" and/or "no vocals" in the sound prompt
Set lyrics to an empty string ""
Provide detailed descriptions of desired instruments and mood
Use length to bound the duration (1–240 seconds)
4. Extend Music#
Continue an existing music track from a specific timestamp.Endpoint#
POST /api/v1/producer/create
Request Body (with explicit instruction)#
{
"task_type": "extend_music",
"clip_id": "abc123xyz789",
"starts_at": 45,
"instruction": "Add soaring violin strings and an uplifting orchestral build with increasing intensity. Conclude with a triumphant final chord.",
"length": 30
}
Request Body (legacy fallback — sound/lyrics auto-derive instruction)#
{
"task_type": "extend_music",
"clip_id": "abc123xyz789",
"starts_at": 45,
"sound": "soaring violin strings and uplifting orchestral build",
"lyrics": "[Outro]\nReaching for the stars above\nFeeling endless love\nThis is just the start\nOf our journey's heart"
}
Alternative Examples#
Example 1: Rock Song Extension#
{
"task_type": "extend_music",
"clip_id": "your-clip-id-here",
"starts_at": 60,
"instruction": "Explosive guitar solo with wah-wah effect, building to a powerful final chorus",
"length": 45
}
Example 2: Ambient Outro#
{
"task_type": "extend_music",
"clip_id": "your-clip-id-here",
"starts_at": 90,
"instruction": "Gradually fade into peaceful silence with gentle reverb and soft wind chimes",
"length": 20
}
Parameters Explanation#
clip_id: Required - The ID of the track to extend (from previous generation)
starts_at: Time in source clip (seconds) where extension begins (default: 30)
instruction: Edit guidance for the extension. Recommended; if omitted, derived from sound/lyrics
length: Optional. Duration of new content in seconds (1–240, default: 60)
sound/lyrics: Optional fallback if you don't pass instruction explicitly
Best Practices#
Use the clip_id from a successfully generated track
Provide an explicit instruction for best results — it's clearer than sound for editorial guidance
starts_at typically ranges from 30-90 seconds
Use length to bound the duration of the extension
5. Replace Music Section#
Replace a specific segment of an existing track with new content.Endpoint#
POST /api/v1/producer/create
Request Body (with explicit instruction)#
{
"task_type": "replace_music",
"clip_id": "abc123xyz789",
"starts_at": 30,
"ends_at": 45,
"instruction": "Replace this segment with a heavy distorted guitar riff over double-bass drums and aggressive energy"
}
Request Body (legacy fallback — sound/lyrics auto-derive instruction)#
{
"task_type": "replace_music",
"clip_id": "abc123xyz789",
"starts_at": 30,
"ends_at": 45,
"sound": "heavy distorted guitar riff with double bass drums and aggressive energy",
"lyrics": "[Bridge]\nBreak the chains\nFeel no pain\nRise again\nStronger than before"
}
Alternative Examples#
Example 1: Replace Chorus#
{
"task_type": "replace_music",
"clip_id": "your-clip-id-here",
"starts_at": 60,
"ends_at": 90,
"instruction": "Uplifting major-key change with gospel choir backing vocals and powerful dynamics. Vocals: 'We will rise above it all, standing strong and standing tall, nothing's gonna break our will, we'll keep climbing up that hill'."
}
Example 2: Replacing the Vocals in a Range (migration path from swap_music_vocals)#
{
"task_type": "replace_music",
"clip_id": "your-clip-id-here",
"starts_at": 0,
"ends_at": 30,
"instruction": "Replace the vocal performance with a smooth male R&B vocal with subtle autotune. Keep the instrumental groove the same.",
"lyrics": "[Verse 1]\nWhen I see you smile\nTime just stands still\nEvery moment with you\nIs a perfect thrill"
}
Example 3: Replacing the Instrumentation (migration path from swap_music_sound)#
{
"task_type": "replace_music",
"clip_id": "your-clip-id-here",
"starts_at": 0,
"ends_at": 60,
"instruction": "Re-arrange this section with ambient atmospheric pads, soft piano melodies, gentle reverb, and minimalist production. Keep vocals similar in character."
}
Parameters Explanation#
clip_id: Required - Track ID to modify
starts_at: Required - Start time of replacement window in seconds
ends_at: Required - End time of replacement window (must exceed starts_at)
instruction: Recommended. Edit guidance for the replacement segment. If omitted, derived from sound/lyrics
sound/lyrics: Optional fallback for instruction
Best Practices#
Precisely specify starts_at and ends_at for the section you want to replace
Use explicit instruction for the most accurate edits
replace_music is the recommended migration path for users who previously used swap_music_vocals or swap_music_sound
Ensure the new content fits stylistically with surrounding sections
6. Cover Music#
Reinterpret an existing track in a new style. Cover keeps the source clip's lyrical/structural skeleton and re-records it with a different sound — the strength parameter (0–1) controls how far the cover diverges from the original.Endpoint#
POST /api/v1/producer/create
Request Body (with explicit instruction)#
{
"task_type": "cover_music",
"clip_id": "abc123xyz789",
"instruction": "lofi piano remix, mellow downtempo with vinyl crackle and soft brushed drums",
"strength": 0.6
}
Request Body (using an uploaded clip)#
{
"task_type": "cover_upload_music",
"clip_id": "<from-producer-upload>",
"instruction": "acoustic guitar reharmonization, intimate coffeehouse arrangement",
"strength": 0.4
}
Alternative Examples#
Example 1: Subtle Reinterpretation#
{
"task_type": "cover_music",
"clip_id": "your-clip-id-here",
"instruction": "Same song, slower tempo, replace electric guitars with acoustic. Keep vocal character.",
"strength": 0.3
}
Example 2: Aggressive Reimagining#
{
"task_type": "cover_music",
"clip_id": "your-clip-id-here",
"instruction": "Heavy synthwave 80s reinterpretation with gated reverb drums, analog pads, and a dark cinematic atmosphere",
"strength": 0.85
}
Example 3: Genre Crossover#
{
"task_type": "cover_music",
"clip_id": "your-clip-id-here",
"instruction": "Reggae crossover — relaxed offbeat guitar, bouncy bassline, breezy island feel",
"strength": 0.7,
"title": "Cover — Island Version"
}
Parameters Explanation#
clip_id: Required — ID of the source clip from a previous create_music, extend, replace, or upload result.
instruction: Editorial guidance for the cover. Recommended; if omitted, derived from sound/lyrics.
strength: Transformation intensity in [0, 1]. Defaults to 0.5 if you also omit the legacy cover_strength. Lower values stay close to the source; higher values diverge more.
title, seed, mv: Optional, same semantics as the other Producer task types.
Best Practices#
Provide an explicit instruction describing the desired style — it gives the model the clearest signal for what to keep and what to change.
strength: 0.3–0.5 works well for "same song, different feel" covers.
strength: 0.7–0.9 produces more dramatic genre crossovers; expect more divergence from the source's melody and rhythm.
Existing SDK callers that pass cover_strength continue to work — it's auto-aliased to strength.
Use cover_upload_music when the source clip_id came from POST /api/v1/producer/upload.
7. Advanced Custom Parameters#
Leverage advanced parameters for fine-tuned control over generation.Example 1: Tempo and Length Control#
{
"task_type": "create_music",
"sound": "high-energy electro house with driving four-on-the-floor beat",
"lyrics": "[Drop]\nFeel the rhythm in your soul\nLet the music take control",
"title": "Club Anthem",
"bpm": 128,
"length": 90
}
Example 2: Reproducible Results with Seed#
{
"task_type": "create_music",
"sound": "upbeat pop rock with electric guitars and energetic drums",
"lyrics": "[Chorus]\nThis is our moment\nThis is our time\nWe'll make it happen\nEverything's fine",
"title": "Test Version A",
"seed": "test-seed-12345"
}
{
"task_type": "create_music",
"sound": "instrumental, no vocals, neoclassical piano composition with complex harmonies, dynamic contrasts, and virtuosic technical passages",
"lyrics": "",
"title": "Etude in D Minor",
"length": 180,
"seed": "classical2026"
}
Example 4: Slow Ballad Tempo#
{
"task_type": "create_music",
"sound": "modern pop ballad with emotional piano and strings",
"lyrics": "[Verse 1]\nLooking at your photograph\nMemories come rushing back\nAll the moments that we shared\nHow I wished that you were there\n\n[Chorus]\nI miss you every day\nThough you're far away\nIn my heart you'll always stay",
"title": "Memories of You",
"bpm": 72
}
Advanced Parameters Explained#
bpm (string | number, optional)#
Target beats per minute (must be ≥ 1)
Useful for matching DJ set tempos, fitness videos, or sync-licensing requirements
Lyria attempts to match the requested tempo but may deviate slightly to preserve musicality
length (integer, optional)#
Target duration in seconds, range 1–240
Bounds the generated clip length
Default behavior (when omitted) is upstream-determined, typically 30–60 seconds
instruction (string, optional for create; recommended for extend/replace)#
Direct editorial guidance to the model
For extend_music and replace_music, this is the most important field — clearer than sound for describing edits
If omitted, derived from sound / lyrics as a fallback
seed (string)#
Use the same seed for reproducible results
Different seeds produce different variations
Useful for A/B testing and version control
Deprecated Parameters#
The following parameters are accepted at the API surface for backwards compatibility but silently ignored by Lyria 3 Pro:make_instrumental — replaced by including "instrumental, no vocals" in the sound prompt
lyrics_strength, sound_strength, weirdness — Lyria infers these from prompt quality
cover_url — cover-art generation control has been removed
Legacy alias kept: cover_strength is still accepted on cover_music / cover_upload_music requests and is treated as a back-compat alias for the new strength parameter. You don't need to update existing SDK calls.
You do not need to remove these from existing SDK calls; they will be ignored without errors.Best Practices for Advanced Parameters#
Testing Phase: Use seed for consistent results during development
Tempo-sensitive content: Set bpm for DJ mixes, fitness videos, or sync-licensed material
Duration control: Use length to bound clip duration (1–240 seconds)
Edit guidance: For extend/replace operations, always supply instruction for best results
Start Conservative: Begin with default values, then adjust based on results
8. Upload Audio#
Upload your own audio and let Producer process it (costs 2 credits).Endpoint#
POST /api/v1/producer/upload
Request Body#
{
"audio_url": "https://example.com/audio/song.mp3"
}
With Webhook Notification#
{
"audio_url": "https://example.com/audio/song.mp3",
"webhook_url": "https://your-server.com/webhooks/upload",
"webhook_secret": "your-secret-key"
}
Parameters#
| Parameter | Type | Required | Description |
|---|
audio_url | string | Yes | Public URL of the audio file to upload |
webhook_url | string | No | HTTPS URL to receive upload completion notification |
webhook_secret | string | No | Secret for signing webhook payloads |
Response#
{ "code": 200, "message": "success", "task_id": "<uuid>" }
Result Retrieval#
Poll GET /api/v1/producer/task/{task_id} until completion to receive data:{ clip_id, audio_url, lyrics }
The returned clip_id can be used with extend_music, replace_music, or cover_upload_music operations
Auto-refund: If the upstream upload fails, the 2-credit charge is automatically refunded.
9. Download MP3/WAV#
Export an existing track to MP3 or WAV (costs 2 credits).Endpoint#
POST /api/v1/producer/download
Request Body#
{
"clip_id": "370c650a-88cd-4f4b-960d-801e686c8a7a",
"format": "mp3"
}
Parameters#
| Parameter | Type | Required | Description |
|---|
clip_id | string | Yes | Music clip ID to download |
format | string | No | Download format: mp3 or wav. Default: mp3 |
Response#
{ "code": 200, "message": "success", "task_id": "<uuid>" }
Result Retrieval#
Poll GET /api/v1/producer/task/{task_id}; on success returns data: Auto-refund: If the upstream download fails, the 2-credit charge is automatically refunded.
10. Webhook Integration#
Use webhooks to receive notifications when tasks complete instead of polling.How It Works#
1.
Include webhook_url (and optionally webhook_secret) in your create/upload request
2.
The API returns a task_id immediately
3.
When the task completes or fails, a POST request is sent to your webhook_url
4.
If webhook_secret is provided, the payload is signed with HMAC-SHA256 for verification
Create Music with Webhook#
{
"task_type": "create_music",
"sound": "instrumental, no vocals, chill lofi hip hop with soft piano and vinyl crackle",
"lyrics": "",
"title": "Late Night Study",
"webhook_url": "https://your-server.com/webhooks/music",
"webhook_secret": "your-secret-key"
}
Upload with Webhook#
{
"audio_url": "https://example.com/audio/song.mp3",
"webhook_url": "https://your-server.com/webhooks/upload",
"webhook_secret": "your-secret-key"
}
Webhook Requirements#
webhook_url must use HTTPS protocol
Maximum URL length: 1024 characters
Your endpoint must accept POST requests with JSON body
Webhook Payload (Success)#
{
"code": 200,
"data": [
{
"clip_id": "abc123",
"title": "Late Night Study",
"audio_url": "https://...",
"wav_url": "https://...",
"image_url": "https://...",
"lyrics_id": "...",
"lyrics_timing_markers": [[0, 0], [5, 9.874]],
"state": "succeeded",
"duration": null
}
],
"message": "success"
}
Webhook Payload (Failure)#
{
"code": 500,
"data": [],
"message": "Task failed"
}
Best Practices#
Always verify webhook signatures when using webhook_secret
Implement idempotency in your webhook handler (you may receive duplicate notifications)
Return a 2xx status code from your webhook endpoint to acknowledge receipt
Implement a timeout handler as a fallback in case webhook delivery fails
Available Models Reference#
| Model | Avg. Generation Time | Notes |
|---|
| Lyria 3 Pro (Default) | ~30s | Google Lyria 3 production-ready model — vocals, instrumentals, and full tracks |
Backwards Compatibility#
Legacy mv values are silently aliased to Lyria 3 Pro and continue to work without code changes:FUZZ-2.0, FUZZ-2.0 Pro, FUZZ-2.0 Raw, FUZZ-1.1 Pro, FUZZ-1.0 Pro, FUZZ-1.1, FUZZ-1.0, FUZZ-0.8, FUZZ-3-Demo, Lyria 3 preview → all routed to Lyria 3 Pro.
Complete Workflow Example#
Here's a complete production workflow using multiple operations:Step 1: Create Initial Track#
{
"task_type": "create_music",
"sound": "indie rock with jangly guitars and melodic vocals",
"lyrics": "[Verse 1]\nWalking down these empty streets\nCity lights and concrete\nSearching for a place to be\nSomewhere I can feel free\n\n[Chorus]\nTake me away from here\nTo a place with no fear\nWhere I can finally breathe\nAnd be who I want to be",
"title": "City Lights",
"length": 90,
"webhook_url": "https://your-server.com/webhooks/music"
}
Step 2: Extend with Bridge#
{
"task_type": "extend_music",
"clip_id": "<from-step-1>",
"starts_at": 90,
"instruction": "Build intensity with layered guitars and driving drums. Add a bridge with new lyrics: 'Every step I take, every move I make, brings me closer to the person I've been meant to be'.",
"length": 30
}
Step 3: Replace the Final Chorus#
{
"task_type": "replace_music",
"clip_id": "<from-step-2>",
"starts_at": 100,
"ends_at": 120,
"instruction": "Replace this final chorus with a stripped-down acoustic version — fingerpicked guitar and raw, intimate vocals."
}
Step 4: Generate an Alternate Version with a Different Seed#
{
"task_type": "create_music",
"sound": "indie rock with jangly guitars and melodic vocals",
"lyrics": "[Verse 1]\nWalking down these empty streets\nCity lights and concrete\nSearching for a place to be\nSomewhere I can feel free\n\n[Chorus]\nTake me away from here\nTo a place with no fear\nWhere I can finally breathe\nAnd be who I want to be",
"title": "City Lights (Alternate)",
"length": 90,
"seed": "alt-version-2"
}
Migration tip: The legacy music_variation task type is no longer supported. To get an alternate version of a track, re-run create_music with the same prompt and a different seed.
Error Prevention Checklist#
Before submitting your request, verify:sound or lyrics contains meaningful content (not "test" or placeholders)
lyrics are at least 20-30 words with proper structure (when present)
sound descriptions are detailed (10+ words)
clip_id is provided for extend_music and replace_music operations
starts_at is provided for extend_music; both starts_at and ends_at for replace_music
task_type matches your intended operation
For instrumental tracks: lyrics: "" and "instrumental, no vocals" in the sound prompt
length is between 1 and 240 (when provided)
Required parameters are included
webhook_url uses HTTPS (if provided)
You are NOT calling deprecated task_types: music_variation, swap_music_vocals, swap_music_sound (all return 410 Gone)
For cover_music / cover_upload_music, clip_id is provided and strength is between 0 and 1 (defaults to 0.5 if omitted)
Quick Reference Table#
| Operation | task_type | Requires clip_id | Required params | Best Use Case |
|---|
| Create | create_music | No | sound or lyrics | New original tracks |
| Extend | extend_music | Yes | starts_at | Add outro / bridge / extension |
| Replace | replace_music | Yes | starts_at, ends_at | Fix or modify a section, vocal/instrumental swaps |
| Cover | cover_music / cover_upload_music | Yes | instruction, strength (0–1) | Reinterpret a track in a new style |
Removed task types (return HTTP 410 Gone): music_variation, swap_music_vocals, swap_music_sound. Use replace_music for segment-level transformations, or re-run create_music with a fresh seed for an alternate version.
Support#
Modified at 2026-05-20 10:09:48