{"uid":"cap_HLFwaKMbM_u1tEfN5NCfd","slug":"audio-withzero-xyz-google-lyria-3-pro-song-generator-2d62f951","name":"Google Lyria 3 Pro Song Generator","description":"Generate one to three complete songs with Google's Lyria 3 Pro, optionally translate vocal functions into instruments, master the audio, rank candidates with local DSP, and return hosted audio URLs.","url":"https://audio.withzero.xyz/api/v1/songs/lyria-3-pro","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","example":{"prompt":"A short upbeat synthwave instrumental with a driving bassline"},"required":["prompt","candidateCount"],"properties":{"seed":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"description":"Seed for repeatable generation (best effort)."},"topP":{"type":"number","maximum":1,"minimum":0,"description":"OpenRouter nucleus-sampling probability from 0 to 1."},"prompt":{"type":"string","maxLength":4000,"minLength":1,"description":"Text description of the song to generate (1–4000 characters)."},"sections":{"type":"array","items":{"type":"object","required":["startSec","endSec","name","description"],"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"description":"Section label, for example Intro, Verse, Chorus, or Bridge."},"endSec":{"type":"integer","maximum":300,"minimum":1,"description":"Exclusive section end in whole seconds."},"startSec":{"type":"integer","maximum":300,"minimum":0,"description":"Inclusive section start in whole seconds."},"intensity":{"type":"integer","maximum":10,"minimum":1,"description":"Target section intensity from 1 (minimal) to 10 (maximum)."},"description":{"type":"string","maxLength":500,"minLength":1,"description":"Instrumentation, melody, rhythm, and production instructions for this section."}},"additionalProperties":false},"maxItems":20,"description":"Up to 20 ordered, non-overlapping arrangement sections converted to Lyria timestamp directives."},"mastering":{"type":"object","required":["targetLufs","truePeakDb","fadeOutSec"],"properties":{"fadeOutSec":{"type":"number","default":1,"maximum":10,"minimum":0,"description":"Final fade duration in seconds."},"targetLufs":{"type":"number","default":-14,"maximum":-8,"minimum":-24,"description":"Target integrated loudness in LUFS."},"truePeakDb":{"type":"number","default":-1,"maximum":-0.1,"minimum":-6,"description":"Maximum true peak in dBTP."}},"description":"Optional ffmpeg loudness normalization, true-peak control, and final fade. Omit to return Lyria audio unchanged.","additionalProperties":false},"durationSec":{"type":"integer","maximum":300,"minimum":30,"description":"Target duration in seconds (30–300; best effort)."},"temperature":{"type":"number","maximum":2,"minimum":0,"description":"OpenRouter sampling temperature from 0 to 2."},"instrumental":{"type":"boolean","description":"When true, explicitly excludes vocals, speech, vocal chops, and choir."},"candidateCount":{"type":"integer","default":1,"maximum":3,"minimum":1,"description":"Generate 1–3 seeded candidates. Extra candidates cost the normal per-song price; the objectively closest result is returned at top level."},"negativePrompt":{"type":"string","maxLength":1000,"minLength":1,"description":"Elements to discourage, appended to the Lyria prompt as explicit exclusions."},"tailReserveSec":{"type":"integer","maximum":15,"minimum":0,"description":"Reserve the final seconds for non-essential decay so an early model stop does not remove the musical resolution."},"selectionTarget":{"type":"object","properties":{"bpm":{"type":"number","maximum":240,"minimum":40},"matchPriorities":{"type":"object","properties":{"groove":{"type":"integer","maximum":5,"minimum":1},"harmony":{"type":"integer","maximum":5,"minimum":1},"structure":{"type":"integer","maximum":5,"minimum":1},"production":{"type":"integer","maximum":5,"minimum":1},"instrumentation":{"type":"integer","maximum":5,"minimum":1}},"description":"Optional 1–5 importance weights. Higher-weight traits receive stronger analysis, prompting, and candidate-ranking emphasis.","additionalProperties":false}},"description":"Optional BPM and match weights used to rank multiple candidates with local DSP.","additionalProperties":false},"referenceImageUrls":{"type":"array","items":{"type":"string","format":"uri","maxLength":2048},"maxItems":10,"description":"Up to 10 public reference images to guide mood, visual story, and style."},"instrumentalLeadMapping":{"type":"array","items":{"type":"object","required":["role","instrument"],"properties":{"role":{"enum":["lead","harmony","response","ad-lib","sustained","ensemble"],"type":"string","description":"The source vocal function being reassigned."},"register":{"enum":["low","mid","high","wide"],"type":"string"},"instrument":{"type":"string","maxLength":80,"minLength":1,"description":"Instrument that should perform this role, for example expressive piano or bright pluck synth."},"articulation":{"type":"string","maxLength":160,"minLength":1,"description":"Phrasing and envelope, for example clipped staccato attacks with short releases."}},"additionalProperties":false},"maxItems":8,"minItems":1,"description":"Map source vocal functions to instrumental parts such as lead → expressive piano and harmony → warm strings."},"instrumentalLeadContinuity":{"enum":["sectional","persistent"],"type":"string","description":"How strongly to retain the mapped lead instrument. Persistent reasserts it after every transition and prevents another instrument from replacing it."}},"additionalProperties":false},"responseSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["url","mimeType","sizeBytes","seconds","model","price_usdc"],"properties":{"url":{"type":"string","description":"Hosted URL of the generated song (MP3)."},"model":{"type":"string","description":"The model that produced the song."},"seconds":{"type":"number","description":"Approximate duration of the song in seconds."},"mimeType":{"type":"string","description":"Content type of the generated audio."},"sizeBytes":{"type":"number","description":"Size of the generated audio in bytes."},"candidates":{"type":"array","items":{"type":"object","required":["index","url","sizeBytes","seconds","score","diagnostics"],"properties":{"url":{"type":"string"},"seed":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991},"index":{"type":"integer","maximum":9007199254740991,"minimum":0},"score":{"type":"object","required":["overall","duration","groove","structure","production"],"properties":{"groove":{"anyOf":[{"type":"number","maximum":1,"minimum":0},{"type":"null"}]},"overall":{"type":"number","maximum":1,"minimum":0},"duration":{"type":"number","maximum":1,"minimum":0},"structure":{"anyOf":[{"type":"number","maximum":1,"minimum":0},{"type":"null"}]},"production":{"type":"number","maximum":1,"minimum":0}},"additionalProperties":false},"seconds":{"type":"number","exclusiveMinimum":0},"sizeBytes":{"type":"integer","maximum":9007199254740991,"exclusiveMinimum":0},"diagnostics":{"type":"object","required":["durationSec","tempo","brightness","energy","sections","cues"],"properties":{"key":{"type":"object","required":["tonic","mode","camelot","confidence"],"properties":{"mode":{"enum":["major","minor"],"type":"string"},"tonic":{"type":"string"},"camelot":{"type":"string"},"confidence":{"type":"number","maximum":1,"minimum":0}},"additionalProperties":false},"cues":{"type":"object","required":["mixInSec","mixOutSec"],"properties":{"mixInSec":{"type":"number","minimum":0},"mixOutSec":{"type":"number","minimum":0}},"additionalProperties":false},"tempo":{"type":"object","required":["bpm","beatOffsetSec","beatIntervalSec","downbeatOffsetBeats","downbeatConfidence"],"properties":{"bpm":{"type":"number","exclusiveMinimum":0},"beatOffsetSec":{"type":"number","minimum":0},"beatIntervalSec":{"type":"number","exclusiveMinimum":0},"downbeatConfidence":{"type":"number","maximum":1,"minimum":0},"downbeatOffsetBeats":{"type":"integer","maximum":3,"minimum":0}},"additionalProperties":false},"energy":{"type":"array","items":{"type":"number","maximum":1,"minimum":0}},"stereo":{"type":"object","required":["correlation","sideToMidRatio"],"properties":{"correlation":{"type":"number","maximum":1,"minimum":-1},"sideToMidRatio":{"type":"number","minimum":0}},"additionalProperties":false},"loudness":{"type":"object","required":["integratedLufs","rangeLu","truePeakDb"],"properties":{"rangeLu":{"type":"number"},"truePeakDb":{"type":"number"},"integratedLufs":{"type":"number"}},"additionalProperties":false},"sections":{"type":"array","items":{"type":"object","required":["kind","startSec","endSec"],"properties":{"kind":{"type":"string"},"endSec":{"type":"number","exclusiveMinimum":0},"startSec":{"type":"number","minimum":0}},"additionalProperties":false}},"brightness":{"type":"array","items":{"type":"number","maximum":1,"minimum":0}},"durationSec":{"type":"number","exclusiveMinimum":0}},"additionalProperties":false}},"additionalProperties":false}},"price_usdc":{"type":"string","description":"The amount charged for this request, in USDC."},"diagnostics":{"type":"object","required":["final"],"properties":{"final":{"type":"object","required":["durationSec","tempo","brightness","energy","sections","cues"],"properties":{"key":{"type":"object","required":["tonic","mode","camelot","confidence"],"properties":{"mode":{"enum":["major","minor"],"type":"string"},"tonic":{"type":"string"},"camelot":{"type":"string"},"confidence":{"type":"number","maximum":1,"minimum":0}},"additionalProperties":false},"cues":{"type":"object","required":["mixInSec","mixOutSec"],"properties":{"mixInSec":{"type":"number","minimum":0},"mixOutSec":{"type":"number","minimum":0}},"additionalProperties":false},"tempo":{"type":"object","required":["bpm","beatOffsetSec","beatIntervalSec","downbeatOffsetBeats","downbeatConfidence"],"properties":{"bpm":{"type":"number","exclusiveMinimum":0},"beatOffsetSec":{"type":"number","minimum":0},"beatIntervalSec":{"type":"number","exclusiveMinimum":0},"downbeatConfidence":{"type":"number","maximum":1,"minimum":0},"downbeatOffsetBeats":{"type":"integer","maximum":3,"minimum":0}},"additionalProperties":false},"energy":{"type":"array","items":{"type":"number","maximum":1,"minimum":0}},"stereo":{"type":"object","required":["correlation","sideToMidRatio"],"properties":{"correlation":{"type":"number","maximum":1,"minimum":-1},"sideToMidRatio":{"type":"number","minimum":0}},"additionalProperties":false},"loudness":{"type":"object","required":["integratedLufs","rangeLu","truePeakDb"],"properties":{"rangeLu":{"type":"number"},"truePeakDb":{"type":"number"},"integratedLufs":{"type":"number"}},"additionalProperties":false},"sections":{"type":"array","items":{"type":"object","required":["kind","startSec","endSec"],"properties":{"kind":{"type":"string"},"endSec":{"type":"number","exclusiveMinimum":0},"startSec":{"type":"number","minimum":0}},"additionalProperties":false}},"brightness":{"type":"array","items":{"type":"number","maximum":1,"minimum":0}},"durationSec":{"type":"number","exclusiveMinimum":0}},"additionalProperties":false},"beforeMastering":{"type":"object","required":["durationSec","tempo","brightness","energy","sections","cues"],"properties":{"key":{"type":"object","required":["tonic","mode","camelot","confidence"],"properties":{"mode":{"enum":["major","minor"],"type":"string"},"tonic":{"type":"string"},"camelot":{"type":"string"},"confidence":{"type":"number","maximum":1,"minimum":0}},"additionalProperties":false},"cues":{"type":"object","required":["mixInSec","mixOutSec"],"properties":{"mixInSec":{"type":"number","minimum":0},"mixOutSec":{"type":"number","minimum":0}},"additionalProperties":false},"tempo":{"type":"object","required":["bpm","beatOffsetSec","beatIntervalSec","downbeatOffsetBeats","downbeatConfidence"],"properties":{"bpm":{"type":"number","exclusiveMinimum":0},"beatOffsetSec":{"type":"number","minimum":0},"beatIntervalSec":{"type":"number","exclusiveMinimum":0},"downbeatConfidence":{"type":"number","maximum":1,"minimum":0},"downbeatOffsetBeats":{"type":"integer","maximum":3,"minimum":0}},"additionalProperties":false},"energy":{"type":"array","items":{"type":"number","maximum":1,"minimum":0}},"stereo":{"type":"object","required":["correlation","sideToMidRatio"],"properties":{"correlation":{"type":"number","maximum":1,"minimum":-1},"sideToMidRatio":{"type":"number","minimum":0}},"additionalProperties":false},"loudness":{"type":"object","required":["integratedLufs","rangeLu","truePeakDb"],"properties":{"rangeLu":{"type":"number"},"truePeakDb":{"type":"number"},"integratedLufs":{"type":"number"}},"additionalProperties":false},"sections":{"type":"array","items":{"type":"object","required":["kind","startSec","endSec"],"properties":{"kind":{"type":"string"},"endSec":{"type":"number","exclusiveMinimum":0},"startSec":{"type":"number","minimum":0}},"additionalProperties":false}},"brightness":{"type":"array","items":{"type":"number","maximum":1,"minimum":0}},"durationSec":{"type":"number","exclusiveMinimum":0}},"additionalProperties":false}},"additionalProperties":false},"selectionNotes":{"type":"array","items":{"type":"string"}},"selectionMethod":{"type":"string","const":"local-dsp"},"selectedCandidate":{"type":"integer","maximum":9007199254740991,"minimum":0,"description":"Zero-based selected candidate index when candidateCount is greater than one."},"generationFailures":{"type":"integer","maximum":9007199254740991,"minimum":0}},"additionalProperties":false},"example":null,"exampleRequest":null,"tags":[],"displayCostAmount":"0.08","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":5,"rating":{"score":"0.58","successRate":"0.76","reviews":5,"stars":"3.3","state":"rated"},"availabilityStatus":"healthy","priceObserved":{"p10Cents":"8.0000","medianCents":"8.0000","p90Cents":"8.0000","minCents":"8.0000","maxCents":"8.0000","p95Cents":"8.0000","sampleCount":2,"varies":false,"failureChargeRate":0},"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.08/call","primary":{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.08","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.08","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_gu2JQbh1VghtqkKRRbo8h","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.08","costPer":"request","priority":0,"asset":"0x20C000000000000000000000b9537d11c60E8b50","unit":"request","depositMicros":null,"planRef":"audio.lyria-3-pro:1"}],"brandName":"audio.withzero.xyz","brandSlug":"audio-withzero-xyz-mpp","brandBaseUrl":"https://audio.withzero.xyz","brandDocsUrl":null,"whatItDoes":"Generates a complete, full-length song (MP3) from a text prompt using Google's Lyria 3 Pro model and returns a hosted audio URL.","exampleAgentPrompt":"Can you generate a full-length upbeat pop song with catchy hooks about summer road trips and friendship using Google's Lyria 3 Pro? Use seed 42 so we can reproduce it if it sounds great.","exampleUseCases":[{"title":"Create branded jingles for podcast ads","prompt":"I need you to generate a catchy 30-second jingle for our podcast sponsor that sounds professional and memorable. Make it upbeat with a modern indie vibe, something that would work great as an intro or outro bumper."},{"title":"Compose background music for video content","prompt":"Can you create a full-length ambient electronic track that's about 3 minutes long? I want something calm and atmospheric that would work perfectly as background music for our meditation app without any lyrics or vocals."},{"title":"Generate custom songs for social media campaigns","prompt":"Create an original hip-hop track with verses about sustainability and eco-friendly living that we can use for our environmental nonprofit's TikTok campaign. Make it energetic and inspiring so it resonates with younger audiences."}],"resultDescription":"Returns a JSON object containing a hosted MP3 URL of the generated song, its approximate duration in seconds, file size in bytes, MIME type, the model used (Google Lyria 3 Pro), and the USDC price charged for the request.","failureModes":["Prompt too long (over 4000 characters) — validation error","Empty prompt (minLength 1 violated) — validation error","Model generation failure — server error or timeout","Invalid seed value outside supported integer range — validation error","Audio hosting failure — URL may not be accessible"],"whenToPreferThis":"Choose this endpoint when you need a complete, full-length AI-generated song (not just a short clip or sound effect) from a text description, specifically leveraging Google's Lyria 3 Pro model quality. Prefer it over TTS endpoints when you want music rather than spoken audio, and over transcription endpoints when you are creating rather than analyzing audio.","instructions":null,"reviewSummary":"Google Lyria 3 Pro song generation delivers usable instrumental and vocal tracks at very low cost (~$0.08 per run) when it works, handling diverse prompts from ad background beds to child-friendly sung narratives. However, a notable failure rate produces HTTP 502 'music_generation_returned_no_audio' errors with no audio output despite charging the caller, and duration accuracy can drift significantly from the requested length. Reliability is mixed — three successes and two consecutive zero-output failures suggest upstream instability, particularly on ambient or non-vocal prompts.","reviewSummaryHighlights":["Very low cost per generation (~$0.08 USDC per run)","Handles diverse prompts including instrumental beds and sung lyric tracks","Returns hosted audio URLs quickly when generation succeeds"],"reviewSummaryConcerns":["HTTP 502 errors return zero audio chunks while still charging the caller","Output duration can significantly exceed the requested length, requiring trimming","Ambient or non-vocal instrumental prompts may be more prone to generation failures"],"reviewSummaryGeneratedAt":"2026-09-08T02:15:07.632Z","activationCount":138,"lastUsedAt":"2026-09-07T22:33:33.738Z","lastSuccessfullyRanAt":"2026-09-07T22:33:33.738Z","lastHealthCheckAt":"2026-09-15T09:15:13.335Z","isFirstParty":true}