Introduction
Describe the music in prompt, including an approximate length and the arrangement you want. Lyria 3.5 returns one 44.1 kHz stereo MP3, billed per track regardless of duration. The supplied acoustic folk test requested 30 seconds and returned 61.6 seconds of audio.
| Field | Value |
|---|---|
| Input | Text |
| Output | Audio |
| Music model | Google DeepMind Lyria 3.5 |
| Accepted input | prompt |
| Returned asset | One MP3 track, 44.1 kHz stereo |
| Measured encoding | About 193 kbps |
| Length handling | Approximate direction in the prompt; no duration field |
| Billing unit | One generated track, independent of length |
Key features & highlights
Put the musical decisions in one brief
Genre, mood, instruments, tempo, structure and desired length all belong in prompt text. For a podcast cue, name a restrained arrangement and an opening motif; for a video montage, describe how the energy should rise and settle. This gives you concrete details to listen for in the returned track.
Plan the cut after hearing the track
Our acoustic folk test asked for a 30-second instrumental at 100 BPM and returned a 61.6-second MP3 in about 30 seconds. Use that observation to plan an audition and trimming step. It establishes neither an exact-duration control nor a typical processing time across genres.
Bring a stereo MP3 into the project
Each generation delivers one MP3 track in 44.1 kHz stereo; the supplied test measured about 193 kbps. Check the opening, middle and ending against your creative brief. If a podcast or advertisement has narration, listen to the music beneath that narration before approving the mix.
Budget for variations by track count
Billing uses the generated track as its unit and does not scale with the track’s length. Consult the displayed rate and decide which prompt variations are worth generating. A shorter length request changes the musical brief without changing the billing unit.
Request parameters
| Parameter | Required | Description |
|---|---|---|
prompt | Yes | Describe genre, mood, instruments, tempo and the progression from opening to ending. at least 1 characters · at most 5000 characters |
image_url | No | Unsupported by this endpoint; omit |
Pricing
$0.12 / song
Billed once per generated song, independent of its length. Failed generations are not charged; consult the track rate displayed on this page.
Use cases
Background music for a video
For a hiking montage, request an uplifting acoustic folk instrumental at 100 BPM with picked guitar, light percussion and a gentle ending. Receive one MP3 to audition against the footage and trim to the edit.
A podcast opening cue
For a weekly science podcast, describe a curious electronic instrumental at 90 BPM with rounded synth notes, restrained drums and a short opening motif. The resulting track gives the editor material for an intro beneath the spoken welcome.
Music for a game loop
For a puzzle level, ask for calm ambient music at 80 BPM with soft marimba, sustained pads and a repeating section. Download the MP3, select a usable passage, and check or crossfade the loop boundary in an audio editor.
An advertising music bed
For a home-goods demonstration, request bright instrumental pop at 110 BPM with muted guitar, light bass and sparse percussion. Use the returned MP3 as a candidate music bed and check that it leaves space for the voiceover.
A mood sketch before production
For a quiet nighttime scene, describe a reflective piano instrumental at 70 BPM that opens sparsely and adds warm strings near the end. The track provides a musical direction to review before arranging the final score.
Prompt guide & pro tips
Define the music brief
Write a prompt with genre, mood, named instruments, tempo and an opening-to-ending structure. Include a desired length as guidance and say “instrumental” when that is the intended result.
Submit the generation request
POST to https://api.spicyapi.ai/api/v1/jobs/createTask with bearer authentication and JSON {"model":"google/lyria-3.5/text-to-audio","input":{"prompt":"Calm acoustic folk instrumental, 100 BPM, picked guitar, soft percussion, gentle ending; aim for 30 seconds."}}.
Collect the completed track
Save data.taskId, then GET /api/v1/jobs/recordInfo?taskId=YOUR_TASK_ID using the creating API key. When data.state is succeeded, retrieve the MP3 through data.output.assets[0].url.
Check timing in your edit
Listen through the arrangement and measure the returned duration before placing it on a timeline. Adjust the prompt for another musical direction, or trim the file when you need an exact endpoint.
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. This illustrative body is separate from the measured test 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."
}
}
- Send that body to
POST https://api.spicyapi.ai/api/v1/jobs/createTaskwithAuthorization: Bearer YOUR_API_KEYandContent-Type: application/json. - Retain
data.taskIdfrom the accepted response. - Query
GET /api/v1/jobs/recordInfo?taskId=YOUR_TASK_IDwith the creating API key until the task reaches a terminal state. - On
succeeded, downloaddata.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 instruction | How to use it |
|---|---|
prompt | Supply the musical brief as text. |
| Genre and mood | Name a style and intended feeling, such as reflective acoustic folk. |
| Instruments | Identify the lead instrument and supporting parts. |
| Tempo | Write a BPM or pace into the description. |
| Structure | Describe the opening, development and ending. |
| Desired length | Include a length wish; verify the returned duration. |
| Unsupported fields | Omit image_url, duration, seed and output-format controls. |
Get a track that fits the project
A concrete arrangement brief gives you clear criteria for reviewing the music. For an ad bed, ask for restrained instrumentation and listen with the actual voiceover; for a game cue, ask for a repeating passage and edit its loop boundary afterward.
- 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 measurement | Recorded value |
|---|---|
| Brief | Neutral acoustic folk instrumental |
| Requested tempo | 100 BPM |
| Requested length | 30 seconds |
| Actual duration | 61.6 seconds |
| Processing time | About 30 seconds |
| Audio | MP3, 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.
Pricing by generated track
Billing is per track and independent of its duration. Consult the rate displayed on this page to budget for prompt variations; asking for a shorter cue does not change the billing unit. An unsuccessful generation incurs no track charge.
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.
| Need | Choice to consider |
|---|---|
| A prompt-directed MP3 for an editing timeline | Lyria 3.5 text-to-audio |
| A fixed 30-second music clip | Google says Lyria 3 Clip generates 30-second clips. |
| Instrumental music steered during playback | Google describes Lyria RealTime as an interactive streaming model. |
| An exact cut or a prepared loop | Use an audio editor to trim or crossfade the downloaded track. |
API quick start
# Generate the idempotency key once; reuse it when retrying after a lost response.
export SPICY_IDEMPOTENCY_KEY="${SPICY_IDEMPOTENCY_KEY:-$(uuidgen)}"
curl -X POST https://api.spicyapi.ai/api/v1/jobs/createTask \
-H "Authorization: Bearer $SPICY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $SPICY_IDEMPOTENCY_KEY" \
-d '{
"model": "google/lyria-3.5/text-to-audio",
"input": {
"prompt": "Calm ambient pads with a slow rising motif"
}
}'
# Copy data.taskId from the response into TASK_ID, then poll the status.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.spicyapi.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
-H "Authorization: Bearer $SPICY_API_KEY"
See the API reference for authentication, the complete schema, polling, and error handling.
