curl --request POST \
--url https://api.apimart.ai/v1/music/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "flowmusic",
"version": "lyria-3.5",
"title": "My Song",
"sound_prompt": "upbeat pop music with piano",
"bpm": "120",
"length": 60
}'
import requests
url = "https://api.apimart.ai/v1/music/generations"
payload = {
"model": "flowmusic",
"version": "lyria-3.5",
"title": "My Song",
"sound_prompt": "upbeat pop music with piano",
"bpm": "120",
"length": 60
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/music/generations";
const payload = {
model: "flowmusic",
version: "lyria-3.5",
title: "My Song",
sound_prompt: "upbeat pop music with piano",
bpm: "120",
length: 60
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01K8AYYM6R03TGZ3Q2P0TZVNPX"
}
]
}
{
"error": {
"message": "sound_prompt and lyrics cannot both be empty",
"type": "invalid_request",
"param": "",
"code": "invalid_request"
}
}
{
"error": {
"message": "Insufficient balance",
"type": "invalid_request",
"param": "",
"code": "quota_not_enough"
}
}
{
"error": {
"message": "Current group capacity is saturated, please retry later",
"type": "rate_limit_error",
"param": "",
"code": "rate_limit_error"
}
}
Flow Music
Lyria 3.5 Generate Music
Use Lyria 3.5 for Flow Music text-to-music generation with style prompts, lyrics, BPM, and duration control
POST
/
v1
/
music
/
generations
curl --request POST \
--url https://api.apimart.ai/v1/music/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "flowmusic",
"version": "lyria-3.5",
"title": "My Song",
"sound_prompt": "upbeat pop music with piano",
"bpm": "120",
"length": 60
}'
import requests
url = "https://api.apimart.ai/v1/music/generations"
payload = {
"model": "flowmusic",
"version": "lyria-3.5",
"title": "My Song",
"sound_prompt": "upbeat pop music with piano",
"bpm": "120",
"length": 60
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/music/generations";
const payload = {
model: "flowmusic",
version: "lyria-3.5",
title: "My Song",
sound_prompt: "upbeat pop music with piano",
bpm: "120",
length: 60
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01K8AYYM6R03TGZ3Q2P0TZVNPX"
}
]
}
{
"error": {
"message": "sound_prompt and lyrics cannot both be empty",
"type": "invalid_request",
"param": "",
"code": "invalid_request"
}
}
{
"error": {
"message": "Insufficient balance",
"type": "invalid_request",
"param": "",
"code": "quota_not_enough"
}
}
{
"error": {
"message": "Current group capacity is saturated, please retry later",
"type": "rate_limit_error",
"param": "",
"code": "rate_limit_error"
}
}
curl --request POST \
--url https://api.apimart.ai/v1/music/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "flowmusic",
"version": "lyria-3.5",
"title": "My Song",
"sound_prompt": "upbeat pop music with piano",
"bpm": "120",
"length": 60
}'
import requests
url = "https://api.apimart.ai/v1/music/generations"
payload = {
"model": "flowmusic",
"version": "lyria-3.5",
"title": "My Song",
"sound_prompt": "upbeat pop music with piano",
"bpm": "120",
"length": 60
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/music/generations";
const payload = {
model: "flowmusic",
version: "lyria-3.5",
title: "My Song",
sound_prompt: "upbeat pop music with piano",
bpm: "120",
length: 60
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01K8AYYM6R03TGZ3Q2P0TZVNPX"
}
]
}
{
"error": {
"message": "sound_prompt and lyrics cannot both be empty",
"type": "invalid_request",
"param": "",
"code": "invalid_request"
}
}
{
"error": {
"message": "Insufficient balance",
"type": "invalid_request",
"param": "",
"code": "quota_not_enough"
}
}
{
"error": {
"message": "Current group capacity is saturated, please retry later",
"type": "rate_limit_error",
"param": "",
"code": "rate_limit_error"
}
}
Authentication
All endpoints require Bearer Token authenticationGet your API Key:Visit the API Key management page to get your API KeyAdd it to the request header:
Authorization: Bearer YOUR_API_KEY
Request Parameters
Model version, must be
"lyria-3.5"Lyria 3.5 still uses
flowmusic as the model name. Do not change model to lyria-3.5 or flowmusic-lyria-3.5.Music style or sound description promptExample:
"upbeat pop music with piano"sound_prompt and lyrics cannot both be empty (at least one is required). Each request generates only one track.Lyrics text; you can first obtain lyrics from the Generate Lyrics endpoint and fill them in hereExample:
"[Verse 1]\nEven the longest night turns to dawn\n..."Random seed, used to reproduce results
Passing the same seed value with the same request produces similar results, but exact reproducibility is not guaranteed.
Response
Use Cases
Scenario 1: Generate from a style prompt only
{
"model": "flowmusic",
"version": "lyria-3.5",
"title": "My Song",
"sound_prompt": "upbeat pop music with piano",
"bpm": "120",
"length": 60
}
Scenario 2: Lyrics + style to a full song
{
"model": "flowmusic",
"version": "lyria-3.5",
"title": "Perseverance",
"lyrics": "[Verse 1]\nEven the longest night turns to dawn\n...",
"sound_prompt": "energetic rock with electric guitar",
"length": 120
}
Query Task ResultsMusic generation is an asynchronous task; a
task_id is returned after submission. Use the Get Task Status endpoint to query generation progress and results.Completed Task Result Example
Query response example (GET /v1/music/tasks/{task_id}):
{
"code": 200,
"data": {
"id": "task_01KWXVB61E28THHFBSYXWA4FAJ",
"status": "completed",
"progress": 100,
"created": 1783413184,
"completed": 1783413236,
"actual_time": 52,
"cost": 0.048,
"credits_cost": 0.48,
"result": {
"music": [
{
"clip_id": "a41aade4-993e-4d28-b56f-d97e7ef7167c",
"title": "Regression Song",
"duration_seconds": "181.70666667",
"create_time": "2026-07-07T08:33:32.854073Z",
"lyrics": "[Verse 1]\nWaking up to the morning light,\n...",
"lyrics_id": "c302d603-81b6-552f-8122-e512928d6aa1",
"lyrics_timing_markers": [[10, 12], [212, 36]],
"audio_url": "https://cdn.apimart.ai/audio/flowmusic_a41aade4.m4a",
"wav_url": "https://cdn.apimart.ai/audio/flowmusic_a41aade4.wav",
"image_url": "https://cdn.apimart.ai/image/flowmusic_a41aade4_cover.jpg"
}
]
}
}
}