Choose a model

PlayLyria uses WaveSpeed for two Google music models. Lyria 3 Pro is selected by default; Lyria 3 Clip is available in the same model menu. Lyria 3.5 is listed as upcoming and cannot be selected or submitted.

Model WaveSpeed model ID Provider price
Lyria 3 Pro google/lyria-3-pro/music $0.08 per track
Lyria 3 Clip google/lyria-3-clip/music $0.04 per track

These provider prices were checked on September 6, 2026, in the Pro documentation and Clip documentation. PlayLyria credit packs are priced separately.

Get an API key

Sign in to WaveSpeed, open API Keys, and create a key. Fund the WaveSpeed account before making a billable request. Keep WAVESPEED_API_KEY on your server; never expose it through browser code or a public environment variable. See WaveSpeed authentication for account and key permissions.

Submit once

The model ID is part of the URL. The request body contains a music description in prompt. Change lyria-3-pro to lyria-3-clip to use Clip.

curl --fail-with-body \
  https://api.wavespeed.ai/api/v3/google/lyria-3-pro/music \
  -H "Authorization: Bearer $WAVESPEED_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"prompt":"Gentle instrumental piano with soft strings and a quiet ending. No vocals."}'

A successful submission returns a prediction ID in data.id. Save it before doing anything else. This response acknowledges a task; it does not mean the audio is ready.

Query the saved task

Replace YOUR_TASK_ID with the saved ID. Querying the result does not create another generation.

curl --fail-with-body \
  https://api.wavespeed.ai/api/v3/predictions/YOUR_TASK_ID/result \
  -H "Authorization: Bearer $WAVESPEED_API_KEY"

Check data.status. When it is completed, read data.outputs for the audio URL. If it is failed, cancelled, timeout, or deleted, stop. For other states, wait at least two seconds and query again. See result polling.

Download the audio into your own storage. Do not send the API key to the audio URL. Validate the file and read its actual duration before showing a player or offering a download; temporary provider links should not serve as your permanent music library.

Recover without duplicate charges

Record a submission marker before the paid POST. If a task ID was received, resume by querying that ID. A broken network connection after submission can leave the result uncertain: automatically posting the same prompt again may create another billable track.

PlayLyria saves each task ID in its database, uses a durable workflow to check the result, and stores delivered MP3 files privately. A storage retry downloads or saves the same result; it does not ask the model to compose again. A user credit is captured only after delivery, and an undelivered task is released after the recovery window.

Duration controls

Clip is used for short music clips. Pro offers target-length guidance in PlayLyria’s Advanced options. WaveSpeed’s published request schema has no separate duration field for these endpoints, so PlayLyria includes this guidance in the prompt. The model determines the final length, which the player reads from the returned audio.