Google Lyria 3 Clip Music API Documentation

Google Lyria 3 Clip Music API Documentation

Playground

Try it on WaveSpeedAI!

Google Lyria 3 Clip generates novel music tracks from text prompts and optional image input. Produces complete songs with lyrics, descriptions, and audio output. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.

Features

Google Lyria 3 Clip is Google’s advanced AI music generation model. Describe the sound you want in natural language — genre, tempo, instruments, mood, and style — and get a high-quality music clip in seconds. Optionally guide the output with a reference image.


Why Choose This?

  • Detailed text-to-music generation Describe your track with as much or as little detail as you want — genre, BPM, instruments, energy level, and mood all influence the output.

  • Image-guided generation Upload a reference image to inspire the musical mood and atmosphere of the clip.

  • Prompt Enhancer Built-in tool to automatically refine your music descriptions for richer results.


Parameters

ParameterRequiredDescription
promptYesText description of the desired music style, genre, tempo, and instruments.
imageNoReference image to guide the mood and atmosphere of the generated music.

How to Use

  1. Write your prompt — describe the genre, tempo, instruments, mood, and style. Use the Prompt Enhancer for better results.
  2. Upload a reference image (optional) — provide an image to inspire the musical atmosphere.
  3. Submit — generate and download your music clip.

Example Prompt

Driving techno track, heavy kick drum at 130 BPM, dark industrial synths, repetitive hypnotic bassline, Berlin underground club style, no vocals.


Pricing

Just $0.04 per clip.


Best Use Cases

  • Content Creation — Generate background music for videos, podcasts, reels, and social media content.
  • Game & Interactive Media — Produce atmospheric tracks and sound design for games and apps.
  • Advertising — Create custom music beds for promotional videos without licensing fees.
  • Creative Exploration — Rapidly prototype musical ideas and styles from text descriptions.
  • Mood & Ambience — Generate focus music, relaxation tracks, or energetic workout playlists on demand.

Pro Tips

  • Be specific about BPM, key instruments, and energy level for the most accurate results.
  • Put exclusions in the prompt itself, for example “no vocals” or “no drums”.
  • Generation is not deterministic; run the same prompt again to get a new variation.
  • Try pairing abstract or atmospheric images with a minimal prompt to let the image drive the mood.
  • Use the Prompt Enhancer to expand a simple style reference into a detailed music description.

Notes

  • Only prompt is required; image is optional.
  • Please ensure your content complies with Google’s usage policies.

Authentication

For authentication details, please refer to the Authentication Guide.

API Endpoints

Submit Task & Query Result

set -euo pipefail

export WAVESPEED_API_KEY="your-api-key"

REQUEST_BODY=$(cat <<'JSON'
{
  "prompt": "A cinematic ocean wave at sunrise, highly detailed"
}
JSON
)

# 1. Submit the prediction.
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
  -X POST "https://api.wavespeed.ai/api/v3/google/lyria-3-clip/music" \
  -H "Authorization: Bearer ${WAVESPEED_API_KEY}" \
  -H "Content-Type: application/json" \
  -d "${REQUEST_BODY}")

TASK=$(printf '%s' "${SUBMIT_RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
PREDICTION_ID=$(printf '%s' "${TASK}" | jq -r '.id // empty')
if [ -z "${PREDICTION_ID}" ]; then
  printf 'Submission response did not contain a prediction id
' >&2
  exit 1
fi
RESULT_URL="https://api.wavespeed.ai/api/v3/predictions/${PREDICTION_ID}/result"

# 2. Poll until the prediction finishes.
while true; do
  RESPONSE=$(curl --silent --show-error --fail-with-body \
    "${RESULT_URL}" \
    -H "Authorization: Bearer ${WAVESPEED_API_KEY}")
  RESULT=$(printf '%s' "${RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
  STATUS=$(printf '%s' "${RESULT}" | jq -r '.status // empty')

  case "${STATUS}" in
    completed) printf '%s\n' "${RESULT}" | jq '.outputs'; break ;;
    failed|cancelled|timeout|deleted) printf '%s\n' "${RESULT}" | jq . >&2; exit 1 ;;
    *) sleep 2 ;;
  esac
done

Parameters

Task Submission Parameters

Request Parameters

ParameterTypeRequiredDefaultRangeDescription
promptstringYes-The positive prompt for the generation.
imagestringNo-The image for generating the output.

Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
data.idstringUnique identifier for the prediction, Task Id
data.modelstringModel ID used for the prediction
data.outputsarrayOutput values, usually URL strings; some models return text strings or structured result objects (empty when status is not completed)
data.urlsobjectObject containing related API endpoints
data.statusstringTask status. completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses.
data.created_atstringISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”)
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds

Result Request Parameters

ParameterTypeRequiredDefaultDescription
idstringYes-Task ID

Result Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
dataobjectThe prediction data object containing all details
data.idstringUnique identifier for the prediction
data.modelstringModel ID used for the prediction
data.outputsarray<string | object>Array of generated outputs (empty when status is not completed). Items are usually URL strings, but may be text strings or structured result objects, depending on the model.
data.urlsobjectObject containing related API endpoints
data.statusstringStatus: completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses
data.created_atstringISO timestamp of when the request was created
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds
© 2026 WaveSpeedAI. All rights reserved.