> ## Documentation Index
> Fetch the complete documentation index at: https://docs.magnific.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Lyria API

> Generate original 30-second music tracks from text with Google Lyria. Describe genre, mood, and instruments to create instrumental audio for video, games, and ads.

<Card title="Google Lyria integration" icon="music">
  Powered by Google Lyria, this API generates original instrumental music tracks from text descriptions.
</Card>

Google Lyria is an AI-powered music generation API that creates original instrumental music from text descriptions. Describe the genre, mood, instruments, and tempo you want, and receive an audio track delivered as a URL. Each request produces a single track with a fixed duration of 30 seconds, making it ideal for video production, games, podcasts, and multimedia projects.

### Key capabilities

* **Text-guided generation**: describe any music style to generate (e.g., "Uplifting orchestral score with soaring strings", "Warm lo-fi hip hop beat with vinyl crackle")
* **Fixed 30-second tracks**: each request produces a single 30-second instrumental track
* **Negative prompt**: exclude unwanted instruments, styles, or moods with `negative_prompt`
* **Reproducible output**: pass a `seed` to get a consistent result for the same prompt
* **Audio URL output**: the generated track is delivered via a URL for download
* **Async processing**: webhook notifications or polling for task completion

### Use cases

* **Video production**: background music for videos and presentations
* **Game development**: custom instrumental loops for games and apps
* **Content creation**: unique music beds for podcasts, streams, and social media
* **Advertising**: original background tracks for ads
* **Film production**: temp tracks or production music for films

### Generate music with Google Lyria

Submit a text description of the music you want to create. The service returns a task ID for async polling or webhook notification.

<div className="my-11">
  <Columns cols={2}>
    <Card title="POST /v1/ai/music-generation/google-lyria" icon="music" href="/api-reference/music-generation/google-lyria/generate">
      Create a new Google Lyria music generation task
    </Card>

    <Card title="GET /v1/ai/music-generation/google-lyria" icon="list" href="/api-reference/music-generation/google-lyria/google-lyria-tasks">
      List all Google Lyria tasks
    </Card>

    <Card title="GET /v1/ai/music-generation/google-lyria/{task-id}" icon="magnifying-glass" href="/api-reference/music-generation/google-lyria/task-by-id">
      Get task status and results by ID
    </Card>
  </Columns>
</div>

### Parameters

| Parameter         | Type           | Required | Default | Description                                                                                                          |
| ----------------- | -------------- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------- |
| `prompt`          | `string`       | Yes      | -       | Text description of the music to generate (1-2500 characters). Be specific about genre, mood, instruments, and tempo |
| `negative_prompt` | `string`       | No       | -       | Elements to avoid in the generated track (e.g., `"vocals, distortion, dissonance"`)                                  |
| `seed`            | `integer`      | No       | -       | Seed for reproducible generation; same prompt + seed returns a consistent result. Omit for a random seed             |
| `webhook_url`     | `string` (uri) | No       | -       | Optional callback URL that receives task status notifications                                                        |

### Prompt tips

For best results, include details about:

* **Genre**: lo-fi hip hop, orchestral, synthwave, acoustic folk, etc.
* **Mood**: uplifting, melancholic, energetic, relaxed
* **Instruments**: piano, strings, electric guitar, 808 drums, etc.
* **Tempo**: slow tempo, upbeat, driving rhythm

**Example prompts:**

* "Uplifting orchestral score with soaring strings and triumphant brass"
* "Warm lo-fi hip hop beat with vinyl crackle and mellow keys"
* "Energetic synthwave track with driving bass and retro leads"
* "Peaceful acoustic folk with fingerpicked guitar and soft strings"

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="What is Google Lyria and how does it work?">
    Google Lyria is an AI-powered text-to-music API. You submit a text description of the music you want (genre, mood, instruments, tempo), receive a task ID immediately, then poll for results or receive a webhook notification. Each request returns a single 30-second instrumental track delivered via a URL.
  </Accordion>

  <Accordion title="How long are the generated tracks?">
    Every Google Lyria request produces a single track with a fixed duration of 30 seconds. There is no duration parameter.
  </Accordion>

  <Accordion title="What is the output format?">
    Google Lyria returns an audio track delivered via a URL that remains accessible for download after task completion.
  </Accordion>

  <Accordion title="How do I reproduce the same track?">
    Pass the same `seed` together with the same `prompt`. Identical inputs return a consistent result across requests. Omit `seed` to get a random seed on each request.
  </Accordion>

  <Accordion title="What does the negative prompt do?">
    Use `negative_prompt` to describe elements to avoid, such as unwanted instruments, styles, or moods (for example `"vocals, distortion, harsh percussion"`).
  </Accordion>

  <Accordion title="What are the rate limits for Google Lyria?">
    Rate limits vary by subscription tier. See [Rate Limits](/ratelimits) for current limits.
  </Accordion>

  <Accordion title="How much does Google Lyria cost?">
    See the [Pricing page](/pricing) for current rates and subscription options.
  </Accordion>
</AccordionGroup>

## Best practices

* **Prompt specificity**: use detailed descriptions of genre, mood, instruments, and tempo for better accuracy
* **Negative prompts**: exclude unwanted elements to steer the composition
* **Reproducibility**: fix `seed` to compare prompt variations against a stable baseline
* **Production integration**: use webhooks instead of polling for scalable applications
* **Error handling**: implement retry logic with exponential backoff for 503 errors

## Related APIs

* **Lyria 3**: text-to-music with selectable `clip` or `pro` model variants and optional reference images. See the [Lyria 3 overview](/api-reference/music-generation/lyria-3/overview).
* **[ElevenLabs Music](/api-reference/music-generation/overview)**: generate 10-240 second music tracks from text
* **[Sound Effects](/api-reference/sound-effects/overview)**: generate sound effects from text descriptions
* **[Audio Isolation](/api-reference/audio-isolation/overview)**: isolate specific sounds from audio files
