Skip to main content
POST
/
api
/
v1
/
lyrics
Generate Lyrics
curl --request POST \
  --url https://api.kie.ai/api/v1/lyrics \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "prompt": "A nostalgic song about childhood memories and growing up in a small town",
  "callBackUrl": "https://api.example.com/callback"
}'
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "5c79****be8e"
  }
}

Usage Guide

  • Use this endpoint to create lyrics for music composition
  • Multiple variations of lyrics will be generated for each request
  • Each generated lyric set includes title and structured verse/chorus sections

Parameter Details

  • prompt should describe the theme, style, or subject of the desired lyrics
  • A detailed prompt yields more targeted and relevant lyrics

Developer Notes

  • Generated lyrics are retained for 14 days
  • Callback occurs once with all generated variations when complete
  • Typically returns 2-3 different lyric variations per request
  • Each lyric set is formatted with standard section markers ([Verse], [Chorus], etc.)

Authorizations

Authorization
string
header
required

All APIs require authentication via Bearer Token.

Get API Key:

  1. Visit API Key Management Page to get your API Key

Usage: Add to request header: Authorization: Bearer YOUR_API_KEY

Note:

  • Keep your API Key secure and do not share it with others
  • If you suspect your API Key has been compromised, reset it immediately in the management page

Body

application/json
prompt
string
required

Description of the desired lyrics content. Be specific about theme, mood, style, or story elements you want in the lyrics. More detailed prompts yield better results. The maximum word limit is 200 words.

Example:

"A nostalgic song about childhood memories and growing up in a small town"

callBackUrl
string<uri>
required

The URL to receive lyrics generation task completion updates. Required for all lyrics generation requests.

  • System will POST task status and results to this URL when lyrics generation completes
  • Callback includes all generated lyrics variations with titles and structured content
  • Your callback endpoint should accept POST requests with JSON payload containing lyrics data
  • For detailed callback format and implementation guide, see Lyrics Generation Callbacks
  • Alternatively, use the Get Lyrics Details endpoint to poll task status
Example:

"https://api.example.com/callback"

Response

Request successful

code
enum<integer>

Response status code

  • 200: Request successful
  • 400: Invalid parameters
  • 401: Unauthorized access
  • 404: Invalid request method or path
  • 405: Rate limit exceeded
  • 413: Theme or prompt too long
  • 429: Insufficient credits
  • 430: Your call frequency is too high. Please try again later.
  • 455: System maintenance
  • 500: Server error
Available options:
200,
400,
401,
404,
405,
413,
429,
430,
455,
500
msg
string

Error message when code != 200

Example:

"success"

data
object
I