Request example
curl --request POST \
--url https://api.openveer.com/v1/music/generations/lyricsFlowMusic \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "flowmusic",
"prompt": "A rock song about perseverance"
}'import requests
url = "https://api.openveer.com/v1/music/generations/lyricsFlowMusic"
payload = {
"model": "flowmusic",
"prompt": "A rock song about perseverance"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())const url = "https://api.openveer.com/v1/music/generations/lyricsFlowMusic";
const payload = {
model: "flowmusic",
prompt: "A rock song about perseverance"
};
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));Response example
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01KWXVCX91HYHSTHZ0NC1SRFW1"
}
]
}{
"error": {
"message": "model is required",
"type": "invalid_request",
"param": "",
"code": "model_required"
}
}{
"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
Authorization stringAll endpoints require Bearer Token authentication
Get your API Key:
Visit the API Key management page to get your API Key
Add it to the request header:
Authorization: Bearer YOUR_API_KEYRequest Parameters
model stringModel name, must be "flowmusic" (case-insensitive)
prompt stringPrompt for generating lyrics, ≤ 3000 characters
It is recommended to describe the song's theme, style, and mood to get better-fitting lyrics
Example: "A rock song about perseverance"
Response
code integerResponse status code, 200 on success
data arraystatus stringTask status, submitted upon initial submission
task_id stringUnique task identifier, used to query task status and results
Use Cases
Scenario 1: Generate lyrics by theme
{
"model": "flowmusic",
"prompt": "A rock song about perseverance"
}Scenario 2: Fill generated lyrics into a song
First generate lyrics; once done, take the title and lyrics from result.lyrics[0] and fill them into the Generate Music endpoint:
{
"model": "flowmusic",
"title": "Perseverance",
"lyrics": "[Verse 1]\nEven the longest night turns to dawn\n...",
"sound_prompt": "energetic rock with electric guitar"
}Query Task Results
Lyrics 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_01KWXVCX91HYHSTHZ0NC1SRFW1",
"status": "completed",
"progress": 100,
"created": 1783413241,
"completed": 1783413284,
"actual_time": 43,
"cost": 0.016,
"credits_cost": 0.16,
"result": {
"lyrics": [
{
"title": "Bleached",
"lyrics": "[Intro]\n(Check)\n(One two)\n\n[Verse 1]\nThe birds are..."
}
]
}
}
}This documentation is built and hosted on Mintlify, a developer documentation platform.