Lyria 3.5 API

by Google

Google's Lyria 3.5: a full song from one prompt, with an optional mood image

google/lyria-3.5/text-to-audio
Lyria 3.5 AI Music Generator online
  • Music

About Lyria 3.5

Lyria 3.5 has the smallest request surface among PopNow's music models: a prompt of up to 5,000 characters and an optional image_url. Everything else (genre, tempo, instrumentation, lyrics with section tags, a target duration) travels as prose inside that prompt, and the async job finishes with one track. It fits products that already collect a free-text brief, such as a trailer cue generator, a music-for-this-photo feature or a storyboard tool that drafts temp score.

Call it with the model name google/lyria-3.5/text-to-audio on POST /jobs/createTask, from $0.12.

Introduction

Lyria 3.5 API for text to music

Google DeepMind’s Lyria 3.5 generates a music track from a written brief and delivers one MP3 through this text-to-audio endpoint. Describe genre, mood, instruments, tempo, structure and desired length in prompt to direct the composition.

Google says its Lyria 3.5 launch improved musicality, lyric handling and vocal expression. Our acoustic folk test below measures duration and processing time.

Submit a music request

Submit google/lyria-3.5/text-to-audio with the music brief inside input.prompt.

{
  "model": "google/lyria-3.5/text-to-audio",
  "input": {
    "prompt": "Gentle acoustic folk instrumental, 100 BPM, picked guitar, warm bass and brushed percussion. Begin with guitar, add a restrained rhythm section, then close softly. Aim for 30 seconds."
  }
}
  1. Retain data.taskId from the accepted response.
  2. Query GET /api/v1/jobs/recordInfo?taskId=YOUR_TASK_ID with the creating API key until the task reaches a terminal state.
  3. On succeeded, download data.output.assets[0].url.

Read the task result

An accepted task returns an ID before the music is available. These abbreviated responses use placeholder identifiers and an example asset address:

{
  "code": 200,
  "data": {
    "taskId": "job_YOUR_TASK_ID",
    "state": "queued"
  }
}
{
  "code": 200,
  "data": {
    "taskId": "job_YOUR_TASK_ID",
    "state": "succeeded",
    "output": {
      "assets": [
        {"url": "https://example.com/your-track.mp3"}
      ]
    }
  }
}

Follow the task API documentation for the complete envelope. Inspect the terminal state before treating the returned record as a usable track.

Parameters and music direction

prompt carries the musical controls exposed by this endpoint. Tempo and length belong in its text rather than in separate numeric fields.

Field or instructionHow to use it
promptSupply the musical brief as text.
Genre and moodName a style and intended feeling, such as reflective acoustic folk.
InstrumentsIdentify the lead instrument and supporting parts.
TempoWrite a BPM or pace into the description.
StructureDescribe the opening, development and ending.
Desired lengthInclude a length wish; verify the returned duration.
Unsupported fieldsOmit duration, seed and output-format controls. Optional image_url is supported for a mood reference image.

Get a track that fits the project

A concrete arrangement brief gives you clear criteria for reviewing the music.

  • State “instrumental” when you want music without a sung part.
  • Choose a lead instrument and a small supporting ensemble so the intended mix is clear.
  • Describe how the energy changes instead of stacking unrelated mood words.
  • Change one part of the brief between takes, then compare the corresponding musical detail.
  • Keep the MP3 you approve alongside the prompt so the chosen take remains available.

What our acoustic folk test showed

Our acoustic folk instrumental test returned 61.6 seconds of music after requesting 30 seconds at 100 BPM. Generation took approximately 30 seconds; the output was one MP3 at 44.1 kHz stereo and about 193 kbps.

Test condition or measurementRecorded value
BriefNeutral acoustic folk instrumental
Requested tempo100 BPM
Requested length30 seconds
Actual duration61.6 seconds
Processing timeAbout 30 seconds
AudioMP3, 44.1 kHz stereo, about 193 kbps

This single result shows approximate length following, without establishing typical latency or quality across musical styles. Listen through the entire file for arrangement changes, then measure and trim it before synchronizing a precise video cut or podcast opening.

Limits and troubleshooting

Timing overruns require an editing pass because this endpoint has no dedicated duration setting. If a request fails, check that input contains the supported prompt field and review the returned error before submitting a revised brief.

Google says its music filters block requests for specific artist voices or copyrighted lyrics. Describe musical qualities and use text and voices you have the right to use; never impersonate a real person. Google’s model card also describes SynthID watermarking.

Choose a sibling for a different workflow

Choose this endpoint for a downloadable track whose arrangement and approximate length are described in text. Follow Google’s linked documentation to evaluate Clip for short cues or RealTime for streaming.

NeedChoice to consider
A prompt-directed MP3 for an editing timelineLyria 3.5 text-to-audio
A fixed 30-second music clipGoogle says Lyria 3 Clip generates 30-second clips.
Instrumental music steered during playbackGoogle describes Lyria RealTime as an interactive streaming model.
An exact cut or a prepared loopUse an audio editor to trim or crossfade the downloaded track.

Request parameters

ParameterRequiredDescription
image_urlNoThe picture to start from.
promptYesDescribe what you want to make.

Pricing

Prices are in USD and charged to your PopNow balance. When a task is accepted, we reserve the maximum quoted amount from your PopNow balance. On completion, we charge for actual usage, never more than the hold, and release the remainder. If the task fails, the hold is released.

OptionUSD per run
Standard$0.12

Send the same request body to POST /jobs/quote to see the estimated and maximum USD charge before running. A quote does not run the task or charge your balance.

API quick start

Call the Lyria 3.5 API in three steps

  1. Create an API key. Sign in to PopNow and create a key in the API console. Keys start with sk-popnow-. API calls are billed in USD from your PopNow balance.
  2. Send the request. POST /jobs/createTask with model google/lyria-3.5/text-to-audio and an input object that follows the parameter table. The response returns a task ID straight away.
  3. Get the result. Poll GET /jobs/recordInfo with the task ID, or pass a callBackUrl and we post the result to it. Download the output links when the task succeeds.
# 1. Create the task. Keep the Idempotency-Key if you retry after a network error.
export IDEMPOTENCY_KEY="$(uuidgen)"
curl -X POST https://api.popnow.ai/api/v1/jobs/createTask \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
  "model": "google/lyria-3.5/text-to-audio",
  "input": {
    "prompt": "Calm ambient pads with a slow rising motif"
  }
}'

# 2. Copy data.taskId from the response, then poll until state is succeeded, failed, canceled or expired.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

Replace the prompt and any links with your own. The API tab has the response, polling and callback reference.

What to build with the Lyria 3.5 API

  • A temp-score step in a storyboard tool: compose the prompt from the scene's mood and planned runtime, then trim the result to the cut. Our 60-second request returned 62.7 seconds.
  • A song-from-photo feature: pass the user's image as image_url and template the prompt with genre, tempo and their lyrics under [Verse] and [Chorus].

Lyria 3.5 parameter notes

  • There is no lyrics field. Concatenate the style text and tagged lyrics into prompt and keep line breaks, with each section tag on its own line.
  • There is no duration field either. Phrase length in words and measure the returned file: ours came back at 62.7 s for a 60-second ask and 2:11 for about two minutes.
  • Instrumental is a prompt instruction, not a boolean. Append the word Instrumental, as our trailer brief did, when no vocals are wanted.
  • image_url is optional and only lends mood and setting, so keep instrument and tempo choices in the text even when an image is attached.

How Lyria 3.5 API pricing adds up

Lyria 3.5 is billed per request, one track each, and the track's length does not change the charge. Log the composed prompt, any image_url and the measured duration of each result, since length is negotiated in prose and you will want to see how close each brief came.

  • Music: $0.12 per run, $12.00 for 100 runs

Async jobs, webhooks and rate limits

Every Lyria 3.5 request is asynchronous: createTask returns a taskId straight away, and the result arrives when the job finishes. Poll GET /jobs/recordInfo every few seconds, or pass a public https callBackUrl and verify the X-Webhook-Signature header (HMAC-SHA256 over taskId, timestamp and the body hash) before trusting the payload. Each account gets 1,000 write requests per 10 seconds; a 429 carries Retry-After. Send an Idempotency-Key with createTask so a retried request for google/lyria-3.5/text-to-audio never runs or bills twice.

Common Lyria 3.5 API errors

errorCodeWhat it usually means and how to fix it
invalid_requestThe prompt is missing or exceeds 5,000 characters once lyrics are appended. Validate the concatenated string, not the separate form fields.
content_rejectedShow the returned message and let the user edit the brief or lyrics; do not auto-retry the same text.
upstream_unavailableThe music service could not be reached. Retry later with backoff instead of looping immediately.

Lyria 3.5 API questions

How much does the Lyria 3.5 API cost?

Lyria 3.5 costs $0.12 per run. API usage is charged in USD to your PopNow balance. When a task is accepted, we reserve the maximum quoted amount from your PopNow balance. On completion, we charge for actual usage, never more than the hold, and release the remainder. If the task fails, the hold is released.

What is the model name for Lyria 3.5 in the API?

Put google/lyria-3.5/text-to-audio for Music in the model field of POST /jobs/createTask.

How do I remove trailing silence?

Trim it after download. Both of our test tracks ended with about 2.5 seconds of silence.

Can one call return two variations?

No. Each request returns one track; send separate requests for alternatives.

Can the image replace the text brief?

No. prompt is required; image_url only adds a mood reference.

What are the limits of the Lyria 3.5 API?

Prompt length (characters): 5,000; Largest upload: 20 MB. Requests outside these limits are rejected before anything is charged.

Can I try Lyria 3.5 without writing code?

Run Lyria 3.5 in the Playground without an API key, using the same PopNow balance as the website, shown in USD. Each run appears in your developer history with its matching code.

More about Lyria 3.5