v2026.5.3: Music generation with Google Lyria 3

Generate music through osmAPI. Two Google Lyria 3 models (Clip and Pro) are live behind a new synchronous /v1/music API — text-to-music with optional reference images, custom lyrics, and an instrumental toggle. Flat per-track billing, a dedicated Music Studio in the Playground with history, and 30-day media storage that auto-expires (your chat and usage history are untouched).

At a glance

Category What's new
New API POST /v1/music (synchronous), GET /v1/music (history), GET /v1/music/:id/content
Models lyria-3-clip-preview, lyria-3-pro-preview
Inputs Text-to-music, reference images (Pro, ×10), custom lyrics, instrumental toggle
Output MP3
Playground New Music Studio at /music with a history of recent tracks
Billing Flat per-track metering ($0.05 Clip / $0.08 Pro)
Storage Generated audio stored 30 days, then auto-deleted — logs/usage kept forever

Music generation API

Unlike video, music is synchronous — one request returns the audio inline (or a hosted URL when object storage is configured). No polling, no job IDs:

curl https://api.osmapi.com/v1/music \
-H "Authorization: Bearer $OSM_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "lyria-3-clip-preview",
"prompt": "Upbeat lo-fi hip hop, 85 BPM, instrumental, mellow piano"
}'
# → 200 { "audio": { "url": "/v1/music/req_…/content", "storage": "s3", "expires_in_days": 30 }, ... }

When object storage is configured the response carries audio.url (a gateway-proxied download path); otherwise — or when an organization opts out of retention — it carries audio.base64 inline.

Capabilities

  • Text-to-music — prompt only. Name the genre, mood, instruments, tempo, and structure (intro / verse / chorus).
  • Reference images — up to 10 inline images on Lyria 3 Pro for visual inspiration.
  • Instrumental toggle — drop vocals with one flag.
  • Custom lyrics — supply your own [Verse]/[Chorus] lyrics.
  • Output format — MP3.
  • Lyrics & structure — returned in the text field alongside the audio.

Prompts that name real artists or copyrighted lyrics are blocked by the safety filter — and blocked generations are not charged.

Pricing

Lyria is metered per track (flat, regardless of length):

Model Typical length Price / track
Lyria 3 Clip ~30 s $0.05
Lyria 3 Pro ~2–3 min $0.08

Playground

A dedicated Music Studio is live in the Playground — pick a Lyria model, write a prompt, attach reference images (Pro), add custom lyrics or toggle instrumental, and play the result inline. A scrollable history of your recent tracks lets you replay, and a live cost estimate is shown before you generate.

Storage & retention

Generated audio and video are now stored for 30 days and then auto-deleted by a background sweep — surfaced clearly in the Studio sidebar. This is governed by a dedicated ENABLE_MEDIA_CLEANUP switch that is fully independent of log retention: deleting a media file never touches your chat history, prompts, usage metrics, or billing records, which are retained as before. Organizations set to "no retention" have media removed immediately.

Open the Music Studio | Read the docs