Flow Music
Generate music and lyrics, extend or replace audio segments, and create music videos.
Open the Flow Music playground. Use an Official Group API key with the base URL https://app.apipool.dev. Generate music with Lyria 3.5 or generate lyrics first and include them in a music request.
Generate music
Send JSON to POST /v1/music/generations/generate with Authorization: Bearer YOUR_API_KEY and Content-Type: application/json.
{
"model": "flowmusic",
"version": "lyria-3.5",
"sound_prompt": "A gentle solo piano piece with no vocals",
"title": "Afternoon",
"length": 30
}Provide at least one of sound_prompt or lyrics. The default version is lyria-3.5. Optional length sets a target of 1–240 seconds as an integer. Check the result for the actual duration. Optional bpm is a numeric string of at least 1, such as "120". Use a string for seed.
Generate lyrics
Send the request to POST /v1/music/generations/lyrics.
{
"model": "flowmusic",
"prompt": "Write lyrics about the morning and the sea breeze"
}prompt is required and accepts up to 3,000 characters. Pass lyrics[].text from the result to the lyrics field in a music request.
Get results
Save the returned id and use the same API key to call GET /v1/tasks/{id}. A completed music task returns the track, a playback URL, and the actual duration. A completed lyrics task returns text. Check result_expires_at before downloading.
Keep polling pending tasks. If submission times out or its outcome is uncertain, keep the task or request ID and contact support before retrying.
Edit a completed track
Extend, replace, and video clip requests reference a completed Flow Music task under the same API key and group. The source can be a generate, extend, or replace task. Set audio_index to 1.
Set task_id to the APIPool task ID. The original audio must still be available. Historical tasks that retain only an external URL cannot be used for editing.
Extend
Send the request to POST /v1/music/generations/extend.
{
"model": "flowmusic",
"task_id": "musictask_YOUR_TASK_ID",
"audio_index": 1,
"extend_from_s": 30,
"extend_s": 10,
"instruction": "Continue the piano melody and gradually add strings"
}extend_from_s is the starting point in seconds, from zero through the actual duration. extend_s must be greater than zero and at most 164 seconds. title and the string seed are optional.
Replace a segment
Send the request to POST /v1/music/generations/replace.
{
"model": "flowmusic",
"task_id": "musictask_YOUR_TASK_ID",
"audio_index": 1,
"start_s": 10,
"end_s": 20,
"instruction": "Replace this segment with gentle solo piano",
"seed": 0
}start_s must be zero or greater. end_s must be greater than the start and at most the actual duration. Optional parameters are title and integer seed.
Music video clip
Send the request to POST /v1/music/generations/videoClip.
{
"model": "flowmusic",
"task_id": "musictask_YOUR_TASK_ID",
"audio_index": 1,
"preset": "simple"
}preset supports simple, modern, and player. The default is simple. Use the same task endpoint to get the MP4 URL.
Pricing
Each successful operation incurs one charge regardless of duration, lyrics length, or number of polls. Generation, extension, and replacement cost US$0.06375 per operation. Lyrics and music video clips cost US$0.02125. Check the model page for currently available operations and rates. Each request uses the price locked at submission.