Docs / Music Series / Suno / Utilities
Submit a Lyrics Generation Task
Submit a LYRICS task that generates one set of lyrics from a prompt.
Purpose#
Submit a lyrics generation (LYRICS) task. This endpoint invokes Suno's standalone lyrics capability to generate a piece of lyric text from a prompt, and is often used to polish the lyrics before composing the song.
The endpoint is asynchronous: once validation passes, the service immediately returns a public task_id and does not wait for the task to finish. Poll the task status and result afterwards with GET /v1/tasks/:id.
LYRICS only cares about a single field: prompt. Each task returns one set of lyrics: in the query result, data is a single object, not a list of candidates.
Request Fields#
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | Yes | — | The lyric generation prompt describing the theme, mood, or style. Leaving it empty or whitespace-only returns 400 with error.message set to prompt_empty |
callback_url | string | No | — | Callback URL notified when the task reaches a terminal state |
model | string | No | suno_lyrics | Model name. It does not need to be sent; if sent it must be suno_lyrics, and any other model is rejected |
prompt is required. If the request body is missing prompt or its value is an empty or whitespace-only string, the endpoint returns 400 (with error.message set to prompt_empty) and no task is created.
callback_url must be a publicly accessible HTTPS URL no longer than 2048 characters. Local, intranet, loopback, and link-local addresses are prohibited, as are domains that resolve to such addresses. An invalid URL does not fail the submission, but the task receives no callback.
When the task completes or fails, the service sends a POST with a JSON payload to this URL. The receiving endpoint must return any 2xx status code within 10 seconds; timeouts, network errors, and non-2xx responses are all treated as failures.
After a failure, the service retries after 1, 2, and 4 seconds respectively, sending the request at most 4 times including the first attempt. The receiver should use the task ID for idempotent processing to avoid handling duplicates.
Example callback payload (note that the callback status is the uppercase SUCCESS / FAILURE, unlike the query endpoint's completed / failed):
{
"task_id": "task_9ZVk0sGXDUQ3nOE8hS3t679E8YnwoG0E",
"status": "SUCCESS",
"data": {
"id": "f6a26010-7745-40b7-ab43-f104a5073305",
"status": "complete",
"title": "漫长的季节",
"text": "[Verse 1]\n秋风吹过老街\n..."
},
"platform": "suno",
"model": "suno_lyrics",
"progress": "100%",
"created": 1795400785,
"finished_at": 1795400796,
"timestamp": 1795400800
}Request Example#
curl --request POST \
--url https://api.apimax.ai/v1/music/lyrics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "Write Chinese pop lyrics about a summer-night city walk, with a gentle, slightly nostalgic mood"
}'Success Response#
{
"id": "task_9ZVk0sGXDUQ3nOE8hS3t679E8YnwoG0E",
"task_id": "task_9ZVk0sGXDUQ3nOE8hS3t679E8YnwoG0E",
"status": "queued",
"model": "suno_lyrics",
"created_at": 1795400785
}Response Fields#
| Field | Type | Description |
|---|---|---|
task_id | string | Public task ID, used for subsequent queries and callbacks |
id | string | Same value as task_id |
status | string | Always queued right after submission |
model | string | Model name, always suno_lyrics |
created_at | integer | Task creation time (Unix seconds) |
Error Response#
Errors use the structure below, where error.code is the error code and error.message is the specific reason:
{
"error": {
"code": "plugin_request_invalid",
"message": "prompt_empty",
"type": "max_api_error"
}
}| HTTP | error.code | error.message | Scenario |
|---|---|---|---|
| 400 | plugin_request_invalid | prompt_empty | prompt is missing, empty, or whitespace-only |
| 400 | plugin_request_invalid | model_action_mismatch: ... | model is set to a model other than suno_lyrics |
| 400 | invalid_request | The parse error | The request body is not a valid JSON object |
| 503 | model_not_found | No available channel (includes group and model name) | model does not exist, or no channel is currently available |
| 502 | plugin_submit_response_failed | The message returned upstream | The upstream task service rejected the submission |
Querying the Task Result#
After a successful submission, poll with the returned task_id:
- Single task query:
GET /v1/tasks/:id
status Enum#
| Value | Description |
|---|---|
queued | Task created, waiting to be processed |
in_progress | Task is being processed |
completed | Task finished; data is readable |
failed | Task failed; error is readable |
completed and failed are terminal states; keep polling for any other status.
When a task fails, error.message is the reason. Some prompts are rejected upstream (in testing, very short prompts beginning with “write one line of…”): the task turns failed about 10 seconds after submission with error set to {"code": "upstream_error", "message": "Prompt likely malformed"}, and the charge is refunded.
Response Fields#
| Field | Type | Description |
|---|---|---|
id | string | Public task ID |
object | string | Always task |
model | string | Model name, always suno_lyrics |
platform / type | string | Always suno |
status | string | Task status; see the enum above |
progress | integer | Progress percentage, 0–100 |
created_at | integer | Submission time (Unix seconds) |
started_at | integer | Processing start time (Unix seconds); omitted until the task starts |
finished_at | integer | Finish time (Unix seconds); omitted until the task finishes |
data | object | Lyrics result; returned only when completed |
error | object | Failure details; returned only when failed, with code and message |
Lyrics Result Fields (data)#
data is a single object, not an array:
| Field | Type | Description |
|---|---|---|
id | string | Lyric record ID (a UUID generated upstream, not the task ID) |
status | string | Lyrics generation status; complete when finished |
title | string | Lyrics title |
text | string | Generated lyrics body, with structure markers such as [Verse] and [Chorus] |
Below is a complete query response example of a successful task (text truncated):
{
"id": "task_9ZVk0sGXDUQ3nOE8hS3t679E8YnwoG0E",
"object": "task",
"type": "suno",
"platform": "suno",
"status": "completed",
"progress": 100,
"model": "suno_lyrics",
"created_at": 1795400785,
"started_at": 1795400785,
"finished_at": 1795400796,
"data": {
"id": "f6a26010-7745-40b7-ab43-f104a5073305",
"status": "complete",
"title": "漫长的季节",
"text": "[Verse 1]\n秋风吹过老街\n枯叶跳舞不停歇\n老照片泛黄了边\n故事讲了一整夜\n\n[Chorus]\n漫长的季节啊\n心里的雪花\n不融化\n..."
}
}The generated lyrics body (data.text) can be passed as the lyrics field of the music generation task (custom-lyrics mode, which also requires title and style) to enter the formal composition flow.

