google/lyria-2
Lyria 2 is Google's AI audio generation model. Produce high-quality music tracks, sound effects, and audio landscapes from natural language prompts.
Example output — click Run to generate your own
Send your first request
OpenAI-compatible endpoint with unified authentication and usage tracking.
https://api.sandbase.ai/v1/rungoogle/lyria-2Input Schema
2 parameters · 1 required · 1 optional
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Required | The text prompt describing the music you want to generate · Min length: 1 · Max length: 2000 |
seed | integer | Optional | A seed for deterministic generation. If provided, the model will attempt to produce the same audio given the same prompt and other parameters. |
Output Schema
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the generation task |
status | string | Task status: pending, running, completed, failed, timeout |
model | string | Model used for the generation |
outputs | array | Array of output items |
outputs[].url | string | URL of the generated artifact |
outputs[].content_type | string | MIME type (e.g. image/png, video/mp4) |
error | object | null | Error details if failed, null on success |
error.type | string | Machine-readable error type code |
error.message | string | Human-readable error description |
Async Workflow
This model uses asynchronous execution. Submit a request and poll for the result.
- Submit — POST to /v1/run, receive an
id - Poll — GET /v1/run/{id} until status is
completed,failed, ortimeout - Retrieve — Read
outputsfrom the completed response
Code Examples
Ready-to-run snippets
# Step 1: Submit
curl -X POST https://api.sandbase.ai/v1/run \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "google/lyria-2",
"prompt": "A lush, ambient soundscape featuring the serene sounds of a flowing river, complemented by the distant chirping of birds, and a gentle, melancholic piano melody that slowly unfolds."
}'
# Step 2: Poll result (replace <id>)
curl https://api.sandbase.ai/v1/run/<id> \
-H "Authorization: Bearer YOUR_API_KEY"API README
Lyria 2
google/lyria-2 generates instrumental music from a natural-language brief describing genre, mood, instrumentation, tempo, arrangement, and production character. Lyria 2 is designed to develop a coherent musical idea rather than emitting an isolated sound, balancing structural progression with detailed timbre and expressive performance. This combination makes the model a practical choice when the creative outcome depends on those qualities rather than on a generic media conversion.
For production work with google/lyria-2, the resulting track can support scores, background beds, concept demos, brand music, and creative exploration when a written direction needs to become polished original audio. The result is most reliable when the source material and creative brief clearly describe the intended subject, progression, visual or sonic character, and the qualities that must remain unchanged.
Highlights
Instrumental composition develops melody, harmony, rhythm, and arrangement from text.
Musical coherence sustains a recognizable idea across the generated piece.
Style interpretation translates genre, mood, era, instrumentation, and production language into sound.
High-fidelity synthesis renders detailed instruments, spatial character, and polished musical texture.
Pricing
| Billing unit | Price |
|---|---|
| Per request | $0.1 |
When to Use
| ✅ Good fit | ❌ Consider alternatives |
|---|---|
| The model's named workflow matches the source material and intended output | A different input modality or model route is required |
| A managed asynchronous result is suitable for the production pipeline | A synchronous, interactive editor is essential |
| The documented controls cover the required duration, framing, or format | The project needs controls outside this endpoint's schema |
| Creative iteration benefits from a repeatable request structure | Exact deterministic pixels, frames, geometry, or samples are mandatory |
| A finished downloadable media asset is the desired deliverable | Editable source layers or a native project file are required |
Prompt Guide
For generation, state the intended result first, then add the subject or source treatment, progression, style, and delivery constraints. Keep one creative variable per phrase, use the documented field names for controls, and change one setting at a time when comparing results.
{
"prompt": "A lush, ambient soundscape featuring the serene sounds of a flowing river, complemented by the distant chirping of birds, and a gentle, melancholic piano melody that slowly unfolds."
}
Technical Specs
| Spec | Value |
|---|---|
| Model ID | google/lyria-2 |
| Inputs | prompt, seed |
| Required inputs | prompt |
| Output fields | content_type, url |
| Execution | Async (submit, then poll for result) |

