Generate Lyrics
Flow Music generates lyrics from a prompt. The result can be filled into the lyrics field of the Generate Music endpoint
全部文档/v1/music/generations/lyricsFlowMusic请求示例
curl --request POST \
--url https://api.apisea.ai/v1/music/generations/lyricsFlowMusic \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "flowmusic",
"prompt": "A rock song about perseverance"
}'Authentication
AuthorizationstringrequiredAll 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
modelstringrequiredModel name, must be "flowmusic" (case-insensitive)
promptstringrequiredPrompt 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
codeintegerResponse status code, 200 on success
dataarrayArray of returned data
Array elements
statusstringTask status, submitted upon initial submission
task_idstringUnique 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"
}Note
Query Task Results
Lyrics generation is an asynchronous task; a
task_idis 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..."
}
]
}
}
}响应
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01KWXVCX91HYHSTHZ0NC1SRFW1"
}
]
}使用此 endpoint 的模型
发现文档中的问题?请发送邮件至 support@apisea.ai。