Generate a song
June 3, 2026 (November 16, 2026)
Table of contents
Generate a complete song from a text prompt with Google’s Lyria models. Pick lyria-3.5, the current flagship, or lyria-3-pro, the default (see model below). The model decides from your prompt whether the song has vocals. Describe vocals to get a sung track with lyrics the model writes, or send your own lyrics. Set instrumental: true to force an instrumental. Each request returns up to two clips (an A/B pair) and spends credits from your account balance.
https://api.useapi.net/v1/flowmusic/music
Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
# Or send the same fields as multipart/form-data:
# Content-Type: multipart/form-data
API tokenis required. Setup useapi.net shows where to get it.
Request Body
{
"prompt": "lo-fi hip hop, mellow piano, 80 bpm"
}
promptis required. The song: style, mood, genre, instruments, BPM and any vocal direction.
Maximum length:10000characters.emailis optional. The Google Flow Music account. Left out, an account with a free slot within its maxJobs is used.instrumentalis optional. true forces an instrumental. false lets the model decide from the prompt whether to sing.
Default:false.lyricsis optional. Your own lyrics, ideally [Verse] / [Chorus] tagged: a sung song of these words. Not used when instrumental is true.
Maximum length:10000characters.ghostwriteris optional. The lyrics writer, when the model writes the lyrics. It has no effect when you send your own lyrics.
Supported values:standard,pro.modelis optional. lyria-3.5 is Google’s current flagship. Leave model out to keep lyria-3-pro, so older integrations sound the same.
Supported values:lyria-3.5,lyria-3-pro(default).modeis optional. sync waits for the result. async answers 201 with the jobid at once.
Supported values:sync(default),async.replyUrlis optional. An http or https URL, up to 2048 characters, that receives one POST of the job record when the job completes or fails.replyRefis optional. Your own reference, echoed back in the webhook.
Maximum length:1024characters.refImage1torefImage10are optional. An image asset id from POST /files or POST /files/generate: passed to the model only as a hint.refAudio1torefAudio10are optional. An audio asset id from POST /files: a hint only, with limited effect on either model.
The model decides from your prompt whether the song has vocals. Describe vocals, or send your own lyrics, to get a sung track. instrumental: true adds an [Instrumental] tag to the prompt and forces an instrumental. Without lyrics, the model writes lyrics only when the prompt asks for vocals.
lyria-3.5 is Google’s current flagship. Google Flow Music calls it its top-performing model, with more dynamic vocals and richer musicality. lyria-3-pro is the model every song made through this API used before model existed. Leave model out and your songs sound the same as before.
The reference uploads (refImage1 to refImage10, refAudio1 to refAudio10) are hints only. An image may nudge the style a little. Neither Lyria model really follows an uploaded song, so an audio reference may change nothing.
replyUrl gets the same job record that GET /jobs/jobid answers.
Sync and async
A request takes about 25 to 140 seconds.
The call answers with the result when it is ready. It waits up to 420 seconds. If the result isn’t ready by then, it answers 202 with a job to poll. With mode async, the call answers at once with a job to poll. Poll GET /v1/flowmusic/jobs/{jobid} about every 10 seconds.
A job still pending 20 minutes after it started fails with error.code timeout when you read it.
A song keeps rendering on our side even if your connection drops, and it still lands in the job record and the webhook. On a platform with a short request timeout, use async or replyUrl, so you always have the jobid.
References must come from one account. A
refImage1orrefAudio1ID belongs to the account it was uploaded to. If you pass any, they must all come from that one account, and the song is made there. If you also pass400.
Responses
-
The song is finished. You get the job record. Its
clipshold one or two songs, each with an m4a and a wav link.{ "jobid": "job:2b11b3cd-e5c9-4abf-b63e-9a6311ce099b-user:[email protected]:flowmusic", "email": "[email protected]", "status": "completed", "created_at": "2026-11-28T22:53:30.383Z", "completed_at": "2026-11-28T22:55:44.041Z", "duration_ms": 133658, "clips": [ { "clip": "user:[email protected]:6e6d7abd-2a7f-4f4a-8390-b2a158ac10ec", "title": "Home Again (Classic Take)", "duration_s": 181.90933333333334, "lyrics": "[Verse 1]\nRain on the window,\nTea's in the cup,\nWatching the gray sky,\nJust waking up.\nOld photographs in a box on the floor,\nTaking me back to the places I've known before.\n\n[Chorus]\nHome again,\nWhere my heart wants to be,\nSafe in the memories,\nHolding onto me.\nHome again,\nLight in the hall,\nFinding my peace here,\nAfter it all.\n\n[Verse 2]\nDust on the bookshelf,\nBooks that I've read,\nStories and dreams that still live in my head.\nClock on the mantle is ticking so slow,\nSinging a song of the long, long ago.\nThe fire's just an ember, the shadows are tall,\nBut I feel so safe here, inside of these walls.\n\n[Chorus]\nHome again,\nWhere my heart wants to be,\nSafe in the memories,\nHolding onto me.\nHome again,\nLight in the hall,\nFinding my peace here,\nAfter it all.\n\n[Chorus]\nHome again,\nWhere my heart wants to be,\nSafe in the memories,\nHolding onto me.\nHome again,\nLight in the hall,\nFinding my peace here,\nAfter it all.\n\n[Outro]\nHome again,\n(Home again),\n(Ooh, ooh).", "seed": null, "lyrics_timing": null, "created_at": "2026-11-28T22:53:56.722450Z", "audio_url": "https://storage.googleapis.com/producer-app-public/clips/6e6d7abd-2a7f-4f4a-8390-b2a158ac10ec.m4a", "wav_url": "https://storage.googleapis.com/producer-app-public/clips/6e6d7abd-2a7f-4f4a-8390-b2a158ac10ec.wav", "image_url": "https://storage.googleapis.com/producer-app-public/assets/a98870b9-c77e-5fdc-95c2-f14cecdb5c17.jpg" } ], "request": { "prompt": "calm acoustic pop", "lyrics": "[Verse]\nRain on the window\n[Chorus]\nHome again", "model": "lyria-3.5" } } -
You sent
modeasync, so you get the job record at once, withstatuspending. Poll GET /jobs/jobiduntilstatusiscompletedorfailed, or wait for thereplyUrlwebhook.{ "jobid": "job:d0a58b8d-37f6-4267-85a0-e94f335ea0d8-user:[email protected]:flowmusic", "email": "[email protected]", "status": "pending", "created_at": "2026-11-28T23:01:34.940Z", "request": { "prompt": "calm piano", "instrumental": true, "model": "lyria-3.5", "mode": "async" } } -
The song was not finished after 7 minutes. You get the job record with
statuspending, and the job keeps running. Poll GET /jobs/jobiduntilstatusiscompletedorfailed, or wait for thereplyUrlwebhook.{ "jobid": "job:aaaabbbb-cccc-4ddd-8eee-ffff99990000-user:[email protected]:flowmusic", "email": "[email protected]", "status": "pending", "created_at": "2026-06-01T18:40:42.412Z", "request": { "prompt": "upbeat funk groove, 110 bpm", "instrumental": true } } -
The request itself is wrong, or no usable Google Flow Music account is added. The error text says what to change.
{ "error": "No healthy Google Flow Music accounts available", "code": 400 }{ "error": "Please configure at least one account at https://useapi.net/docs/api-flowmusic-v1/post-flowmusic-accounts", "code": 400 }{ "error": "refImage1 (2c9a1e3f-6b8d-4f0a-9e7c-1d2b3c4d5e6f) was not found in Google Flow Music storage. Upload it via POST /files or create it via POST /files/generate first.", "code": 400 }{ "error": "Invalid JSON: Unexpected token 'o', \"not json\" is not valid JSON", "code": 400 } -
The useapi.net API token is missing or wrong.
A step at Google Flow Music failed with 401: it refused the account’s sign-in. The error text names the step.
{ "error": "Google Flow Music conversation failed (401): {\"detail\":\"Unauthorized\"}", "code": 401 }{ "error": "useapi.net ⁝ Unauthorized", "code": 401 } -
The useapi.net subscription is not active.
The Google Flow Music account has too few credits. Top it up, or send the request to an account with credits.
{ "error": "Google Flow Music conversation failed (402): {\"detail\":\"User has insufficient credits\"}", "code": 402 }{ "error": "useapi.net ⁝ Your account has no subscription, please subscribe to our services before submitting requests", "code": 402 } -
The id belongs to another API token.
{ "error": "asset ID does not belong to authenticated operator (parsed user:12346, calling user:12345)", "code": 403 } -
The account, job or clip does not exist, or is no longer there.
{ "error": "Account [email protected] not found", "code": 404 } -
The failed job
The job was cancelled with DELETE /jobs/
jobidwhile the request waited. You get the job record withstatusfailed anderror.codeuser_cancelled.{ "jobid": "job:5d3c9e1a-7b2f-4c8d-9a6e-3f1b2c4d5e6a-user:[email protected]:flowmusic", "email": "[email protected]", "status": "failed", "created_at": "2026-11-28T23:20:04.512Z", "request": { "prompt": "lo-fi hip hop, mellow piano, 80 bpm" }, "error": { "code": "user_cancelled", "message": "Cancelled by user, slot freed" }, "cancelled_at": "2026-11-28T23:20:41.207Z" } -
The failed job
Google Flow Music made no song, most likely because the model refused the request. You get the job record with
statusfailed anderror.codemoderation_reject. Change the prompt before you send it again.{ "jobid": "job:8e2f4a6b-1c3d-4e5f-8a7b-9c0d1e2f3a4b-user:[email protected]:flowmusic", "email": "[email protected]", "status": "failed", "created_at": "2026-11-28T23:24:10.031Z", "completed_at": "2026-11-28T23:24:38.774Z", "error": { "code": "moderation_reject", "message": "Agent did not emit audio__create_song — likely a moderation refusal", "raw": "" }, "request": { "prompt": "lo-fi hip hop, mellow piano, 80 bpm" } } -
Every account already runs its maxJobs jobs. Retry once a running job finishes.
Google Flow Music refused the request because this account sent too many at once. Retry once a running generation finishes, or a little later.
{ "error": "All 2 Google Flow Music accounts are at their maxJobs concurrency limit — retry shortly", "code": 429 }{ "error": "Google Flow Music conversation failed (429): {\"detail\":\"Too Many Requests\"}", "code": 429 } -
Something failed on our side.
A step at Google Flow Music failed with 500. The error text names the step.
{ "error": "Cannot read properties of undefined (reading 'email')", "code": 500 }{ "error": "Async mode unavailable — no system proxy configured. Contact [email protected]", "code": 500 }{ "error": "Google Flow Music conversation failed (500): \"Internal Server Error\"", "code": 500 } -
Google Flow Music answered with an error, or did not answer. The error text says what happened.
{ "error": "Upstream network failure after 4 attempts: Network connection lost.", "code": 502 }{ "error": "Upstream fetch produced no response", "code": 502 }{ "error": "Google Flow Music returned no job_id", "code": 502 } -
The Google Flow Music sign-in service did not answer, or another request is renewing the account’s sign-in right now. The account is unchanged. Retry in a minute, or after Retry-After when it is sent. On any call, it can also mean our service was busy for a moment.
{ "error": "Another request is refreshing the Google Flow Music sign-in of [email protected] right now. Retry in a few seconds.", "code": 503 }{ "error": "Google Flow Music's sign-in service did not answer (500). Retry in a minute.", "code": 503 } -
The failed job
The song did not finish in time, so the job failed. You get the job record with
statusfailed anderror.codetimeout. Check GET /music before you send it again.{ "jobid": "job:1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d-user:[email protected]:flowmusic", "email": "[email protected]", "status": "failed", "created_at": "2026-11-28T23:30:00.118Z", "completed_at": "2026-11-28T23:36:01.452Z", "error": { "code": "timeout", "message": "No audio produced before the SSE budget elapsed", "raw": "" }, "request": { "prompt": "lo-fi hip hop, mellow piano, 80 bpm" } } -
596 Account Error
The account is in an error state. Add it again with POST /accounts.
{ "error": "Account [email protected] in error state: Google Flow Music signed out [email protected]: its sign-in can no longer be refreshed (refresh_token_already_used), usually because it was refreshed somewhere else. Add the account again: https://useapi.net/docs/start-here/setup-flowmusic", "code": 596 }{ "error": "Google Flow Music signed out [email protected]: its sign-in can no longer be refreshed (refresh_token_already_used), usually because it was refreshed somewhere else. Add the account again: https://useapi.net/docs/start-here/setup-flowmusic", "code": 596 }
Model
The job record, either completed with its clips or still pending: poll a pending job with GET /jobs/jobid until it finishes.
The song job record and the types it uses (Clip, SongRequest)
{ // TypeScript, fields marked ? may be absent
jobid: string // the job's id, `job:<uuid>-user:[email protected]:flowmusic`. Read the job with GET /jobs/{jobid}
email: string // the Google Flow Music account the job runs on
status: "pending" | "completed" | "failed" // pending: Google Flow Music is still making it. completed: the clips are ready. failed: error says why
created_at: string // when the job started, ISO 8601
completed_at?: string // when the job ended, ISO 8601. Present once the job has completed or failed. A cancelled job has none
duration_ms?: number // how long the job took, in milliseconds. Present once it is completed
cancelled_at?: string // when DELETE /jobs/{jobid} cancelled the job, ISO 8601
clips?: Clip[] // the result clips. Present once the job is completed
error?: {
code: string // why the job failed, such as `user_cancelled` or `timeout`
message: string // the failure in words
detail?: string // more on the failure, when there is more
raw?: string // the start of Google Flow Music's own reply, when it made no audio
} // why the job failed. Present when status is failed
request: SongRequest // the request body you sent, echoed back
}
Clip:
{ // TypeScript, fields marked ? may be absent
clip: string // the encoded clip id, `user:[email protected]:<uuid>`: use it with GET /music/download and POST /music/edit
title: string | null // the song title Google Flow Music gave the clip
duration_s: number | null // the clip length in seconds, or null while Google Flow Music has not finished measuring it
lyrics: string | null // the lyrics, [Verse] / [Chorus] tagged, or "[Instrumental]" for an instrumental
seed: number | null // the seed the clip was made with, when Google Flow Music states one
lyrics_timing: number[][] | null // the timing markers of the sung lyrics, each [start, end] in seconds, or null when Google Flow Music sends none, which also happens for sung songs
created_at: string // when Google Flow Music made the clip, ISO 8601
audio_url: string // the m4a file, a public link (no token needed)
wav_url: string // the wav file, a public link (no token needed)
image_url: string | null // the artwork Google Flow Music made for the clip, when there is one
}
SongRequest:
{ // TypeScript, fields marked ? may be absent
prompt: string // the song description, as sent
email?: string // the account, as sent
instrumental?: boolean // true when an instrumental was asked for
lyrics?: string // your own lyrics, as sent
ghostwriter?: "standard" | "pro" // the lyrics writer, as sent
model?: "lyria-3.5" | "lyria-3-pro" // the model the request named
mode?: "sync" | "async" // sync or async, as sent
replyUrl?: string // the webhook URL, as sent
replyRef?: string // the webhook reference, as sent
refImage1?: string // an image asset id from POST /files or POST /files/generate, as sent
refImage2?: string // an image asset id from POST /files or POST /files/generate, as sent
refImage3?: string // an image asset id from POST /files or POST /files/generate, as sent
refImage4?: string // an image asset id from POST /files or POST /files/generate, as sent
refImage5?: string // an image asset id from POST /files or POST /files/generate, as sent
refImage6?: string // an image asset id from POST /files or POST /files/generate, as sent
refImage7?: string // an image asset id from POST /files or POST /files/generate, as sent
refImage8?: string // an image asset id from POST /files or POST /files/generate, as sent
refImage9?: string // an image asset id from POST /files or POST /files/generate, as sent
refImage10?: string // an image asset id from POST /files or POST /files/generate, as sent
refAudio1?: string // an audio asset id from POST /files, as sent
refAudio2?: string // an audio asset id from POST /files, as sent
refAudio3?: string // an audio asset id from POST /files, as sent
refAudio4?: string // an audio asset id from POST /files, as sent
refAudio5?: string // an audio asset id from POST /files, as sent
refAudio6?: string // an audio asset id from POST /files, as sent
refAudio7?: string // an audio asset id from POST /files, as sent
refAudio8?: string // an audio asset id from POST /files, as sent
refAudio9?: string // an audio asset id from POST /files, as sent
refAudio10?: string // an audio asset id from POST /files, as sent
}
Examples
-
curl -X POST "https://api.useapi.net/v1/flowmusic/music" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"prompt":"lo-fi hip hop, mellow piano, 80 bpm"}' -
const response = await fetch('https://api.useapi.net/v1/flowmusic/music', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ "prompt": "lo-fi hip hop, mellow piano, 80 bpm" }) }) console.log(response.status, await response.json()) -
import requests response = requests.post( 'https://api.useapi.net/v1/flowmusic/music', headers={'Authorization': 'Bearer YOUR_API_TOKEN'}, json={ 'prompt': 'lo-fi hip hop, mellow piano, 80 bpm' }, ) print(response.status_code, response.json())