Skip to main content

Endpoint

POST /api/v1/lyrics/generate
Asynchronous. Returns a task_id. Poll Get Task for results. Generates song lyrics based on a text prompt, topic, mood, or keyword. The result is a completed lyrics text (not an audio file). Supports Chinese and English.

Request body

FieldTypeRequiredDescription
promptstringSee noteFree-form description of the song or desired lyrics content. Supports Chinese and English.
topicsstringSee noteTopic(s) for the song (e.g. "love, summer" or "爱情, 思念").
moodsstringNoEmotional tone (e.g. "happy, nostalgic" or "悲伤, 治愈").
stylestringNoMusical style (e.g. "country ballad" or "流行抒情").
keywordstringSee noteKey words or phrases to include in the lyrics.
callback_urlstringNoWebhook URL for completion notification. See Webhooks.
retention_daysintegerNoDays to retain result. Default 7.
At least one of prompt, topics, or keyword is required.

Response

The task result contains generated lyrics in the music result’s prompt field.
{
  "code": 0,
  "message": "ok",
  "request_id": "req-1710000000000",
  "data": {
    "task_id": "64f3a1b2c8d9e0f1a2b3c4d5",
    "status": "queuing"
  }
}

Examples

English:
curl -X POST https://api.example.com/api/v1/lyrics/generate \
  -H "Authorization: Bearer sk-mm-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "topics": "heartbreak, rain, moving on",
    "moods": "melancholic, hopeful",
    "style": "indie folk"
  }'
Chinese:
curl -X POST https://api.example.com/api/v1/lyrics/generate \
  -H "Authorization: Bearer sk-mm-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "topics": "思念, 离别, 重逢",
    "moods": "感伤, 温暖",
    "style": "流行抒情"
  }'