Skip to content
Google logo

Lyria 3

Music Generation • Google

Model ID

Use with the Workers AI binding, the AI Gateway REST API, or the Unified API.

Calling the provider directly? Use the provider's model name instead, including with provider-native endpoints or the provider's own SDK. For example, Anthropic's name for anthropic/claude-opus-4.8 is claude-opus-4-8.

  • Third-party

Google's Lyria 3 model generates 30-second MP3 music clips from text and optional image prompts.

Model Info
More informationlink ↗
Pricing
  • Per track$0.04

Usage

const response = await env.AI.run(
  'google/lyria-3',
  { prompt: 'An indie pop song with bright guitars, crisp drums, and an optimistic summer chorus' },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "google/lyria-3",
  "input": {
    "prompt": "An indie pop song with bright guitars, crisp drums, and an optimistic summer chorus"
  }
}'
{
  "state": "Completed",
  "result": {
    "audio": "https://examples.aig.cloudflare.com/google/lyria-3/indie-pop-clip.mp3"
  }
}

Parameters

prompt
stringrequiredminLength: 1maxLength: 5000
image
stringminLength: 1Base64-encoded image used as visual inspiration
audio
stringGenerated music as an audio URL

API Schemas (Raw)

Input
Output

Was this helpful?