Skip to content

Lyrics Generation API

POST /api/v1/lyrics/generate creates a structured lyrics package for music, MV, and editorial workflows. It can return synchronously when generation finishes quickly, or return 202 with a pollUrl while the task continues.

Use Producer lyrics when you only need a simple task-shaped lyric asset inside the Producer flow. Use this endpoint when you need a richer package: title, lyrics, language plan, hook, Suno-ready tags, Producer-ready sound prompt, notes, and token usage when available.

Terminal window
curl -X POST https://api.omnapi.com/api/v1/lyrics/generate \
-H "x-api-key: $OMNAPI_KEY" \
-H "Idempotency-Key: lyrics-demo-001" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Write a bilingual romantic pop song about meeting again on a rainy neon street.",
"language": "Chinese",
"languages": ["Chinese", "English"],
"multilingualMode": "sectioned",
"genre": "mandopop, synthpop",
"mood": "romantic and cinematic",
"vocalStyle": "airy female vocal",
"durationSec": 140,
"themeKeywords": ["rain", "neon", "reunion"],
"extraGuidance": "Keep the chorus simple and memorable.",
"config": {
"metadata": {
"orderId": "ord_123"
}
}
}'
FieldTypeRequiredNotes
promptstringyesCore brief, story, scene, or hook idea. Max 2000 chars.
mode"grok" | "gpt"Optional generation mode. Omit for the default.
languagestringPrimary lyric language, or auto.
languagesstring[]Additional languages for multilingual lyrics.
multilingualModestringauto, sectioned, blended, or call_and_response.
genre, mood, vocalStylestringMusical direction.
perspectivestringfirst_person, second_person, third_person, or mixed.
themeKeywordsstring[]Short anchors for imagery and subject matter.
structurestring[]Requested section order, such as Verse 1, Chorus, Bridge.
durationSecnumberTarget duration, 30-480 seconds.
explicitbooleanWhether explicit language is acceptable.
negativeConstraintsstring[]Styles, topics, or tropes to avoid.
extraGuidancestringAdditional constraints. Max 2000 chars.
configobjectStandard task config: priority, tags, metadata, webhookUrl.
{
"taskId": "task_01J...",
"status": "COMPLETED",
"modelPath": "grok/grok-4.20-beta-latest-non-reasoning/lyrics-generation",
"creditsCharged": 12,
"title": "Neon Rain",
"lyrics": "[Verse 1]\n...",
"languagePlan": {
"primaryLanguage": "Chinese",
"secondaryLanguages": ["English"],
"mixStrategy": "Chinese verses with an English chorus hook.",
"transliteration": null
},
"sectionOrder": ["Verse 1", "Chorus"],
"hook": "Stay with me in the neon rain tonight",
"suno": {
"title": "Neon Rain",
"prompt": "[Verse 1]\n...",
"tags": "mandopop, synthpop, romantic, cinematic",
"negativeTags": "heavy metal, aggressive rap"
},
"producer": {
"title": "Neon Rain",
"lyrics": "[Verse 1]\n...",
"soundPrompt": "Romantic mandopop with synthpop sheen, airy female vocal..."
},
"notes": []
}

When generation needs more time, the endpoint returns 202:

{
"taskId": "task_01J...",
"status": "PROCESSING",
"modelPath": "grok/grok-4.20-beta-latest-non-reasoning/lyrics-generation",
"creditsRequired": 12,
"message": "Lyrics task is still processing. Query the task endpoint for the final result.",
"pollUrl": "/api/v1/tasks/task_01J..."
}

Poll the pollUrl or receive task.* webhooks when config.webhookUrl is set.

EndpointUse when
POST /api/v1/lyrics/generateYou need a full structured lyric package and music-ready prompt fields.
POST /api/v1/producer/generate/lyricsYou want a simple Producer task result inside the Producer workflow.
POST /api/v1/subtitlesYou already have audio and need timed lyrics or subtitle files.