Lyria is a new foundation model for high-quality audio
generation, capable of creating diverse soundscapes and musical pieces from text
prompts. Lyria enables users to generate high-quality
instrumental music from text prompts. To explore this model in the console, see the Lyria model card in
the Model Garden (accessible using the Media Studio tab).
Try Lyria on Vertex AI (Vertex AI Studio) The Lyria API supports the following model: Use the following parameters for the Lyria model. For more
information, see the Lyria Model Garden card details. (in
Required. The text description in US English (en-us) of the audio to generate.
Example: "An energetic electronic dance track with a fast tempo."
(in
Optional. A description of what to exclude from the generated audio.
Example: "vocals, slow tempo"
(in
Optional. A seed for deterministic generation. If provided, the model will attempt to produce the same audio given the same prompt and other parameters.
Cannot be used with Example: (in
Optional. The number of audio samples to generate. Default is 1 if not specified and seed is not used.
Cannot be used with Example: Use the following request to generate instrumental music from a text prompt: This example uses This example uses To test a text prompt using the Lyria API, send a POST request to
the publisher model endpoint. The following example omits A successful request returns a JSON object containing the generated audio data.
Each generated audio clip is 30 seconds long and provided as a WAV audio file at
a 48kHz sample rate. An array of generated audio samples. Each object in the array represents one audio clip. Base64-encoded string of the generated WAV audio data. The MIME type of the audio data. For Lyria, this is The ID of the deployed model that processed the request (if applicable for the endpoint type). The full resource name of the model that processed the request. The display name of the model. Refer to the Lyria Model Card for detailed best practices on
prompting, language support (US English only for prompts), generation times,
output format (WAV, 48 kHz, 30s instrumental clips), safety measures, and
deployment information. Key points: Lyria 2 usage is priced at $0.06 per 30 seconds of output music generated. For
more details, see Vertex AI Pricing.Supported Models
lyria-002
HTTP request
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
https://LOCATION[-aiplatform.googleapis.com/v1/projects/](https://-aiplatform.googleapis.com/v1/projects/)PROJECT_ID/locations/LOCATION/publishers/google/models/lyria-002:predict \
-d '{
"instances": [
{
"prompt": "string",
"negative_prompt": "string", // Optional
"seed": 0 // Optional. Cannot be used with sample_count.
}
],
"parameters": {
"sample_count": 1 // Optional. Cannot be used with seed.
}
}'
Parameter
prompt
instances
object)
string
negative_prompt
instances
object)
string
seed
instances
object)
integer
sample_count
in the same request.
12345
sample_count
parameters
object)
integer
seed
in the same request.
2
Sample request
Text-to-music generation request
curl
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
https://us-central1-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/us-central1/publishers/google/models/lyria-002:predict \
-d '{
"instances": [
{
"prompt": "A calm acoustic folk song with a gentle guitar melody and soft strings.",
"negative_prompt": "drums, electric guitar",
"seed": 98765
}
],
"parameters": {}
}'
JSON
seed
for reproducible output.
{
"instances": [
{
"prompt": "A calm acoustic folk song with a gentle guitar melody and soft strings.",
"negative_prompt": "drums, electric guitar",
"seed": 98765
}
],
"parameters": {}
}
JSON with sample_count
sample_count
to generate multiple samples.seed
from the instances
object and uses sample_count
in the parameters
object to generate multiple samples.
{
"instances": [
{
"prompt": "A calm acoustic folk song with a gentle guitar melody and soft strings.",
"negative_prompt": "drums, electric guitar"
}
],
"parameters": {
"sample_count": 2
}
}
Response body
{
"predictions": [
{
"audioContent": "BASE64_ENCODED_WAV_STRING_SAMPLE_1",
"mimeType": "audio/wav"
}
// Additional audio samples will be listed here if sample_count > 1
// e.g.,
//{"audioContent": "BASE64_ENCODED_WAV_STRING_SAMPLE_2",
// "mimeType": "audio/wav"
//}
],
"deployedModelId": "xxxxxxxxxxxxxxx", // Actual ID may vary based on deployment
"model": "projects/PROJECT_ID/locations/LOCATION/publishers/google/models/lyria-002",
"modelDisplayName": "Lyria 2"
}
Response element
predictions
array
predictions[].audioContent
string
predictions[].mimeType
string
"audio/wav"
.
deployedModelId
string
model
string
modelDisplayName
string
Best practices and limitations
negative_prompt
to exclude
elements.Pricing
More information
What's next
Lyria API
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-21 UTC.