EN ▾

Uncensored text API for music pipelines

Get API key

LLM API for Song Lyrics: Setup, Prompts and Costs

An llm api for song lyrics is a text endpoint you call from your own code: you send a brief, you get verses, hooks and bridges back. This one is OpenAI-compatible, writes text only, and makes no sound.

Updated

Staff paper turning into glowing chat bubbles that flow toward a waveform gate, representing lyric writing with an LLM

What an LLM can and cannot do for lyrics

A language model is good at the text side of songwriting. It can draft verses to a given rhyme scheme, rewrite a chorus in five different moods, tighten a bridge, suggest titles, or turn a rough voice memo transcript into clean stanzas. It can also act as a patient co-writer when you are stuck on a single line.

It cannot sing, compose or render a track. This API handles text only: no image, audio or video generation, no embeddings, no fine-tuning. If you build a music pipeline, the model sits in front of it. It writes the lyric sheet and the style prompt, and your music generator, your DAW or a human with a microphone does the rest.

The model is open-weight, run by an independent provider, and tuned to answer without content refusals for lawful adult use. For songwriters that matters in practice. Songs deal with grief, violence, addiction, bitterness and desire, and a model that refuses or lectures when a verse gets dark is no use to a lyricist. The one hard limit is that nothing sexual involving minors is ever produced. Beyond that, you stay in charge of what you publish.

Connect in five minutes

The API follows the OpenAI chat format, so any OpenAI SDK works once you change two settings. Get a key from the API key page, set the base URL to https://api.musicgen.cc/v1, and use the model uncensored. Authentication is a standard Authorization: Bearer header, which the SDKs add for you. The endpoints are POST /v1/chat/completions and GET /v1/models.

Here is a minimal lyric request in Python:

from openai import OpenAI

client = OpenAI(base_url="https://api.musicgen.cc/v1", api_key="YOUR_KEY")

SYSTEM = """You are a lyricist. Write song lyrics only.
Format: [Verse 1], [Chorus], [Verse 2], [Chorus], [Bridge], [Chorus].
Rules: 4 lines per verse, ABAB rhyme in verses, chorus under 6 lines,
concrete images over abstractions, no explanations after the lyrics."""

resp = client.chat.completions.create(
    model="uncensored",
    temperature=0.9,
    messages=[
        {"role": "system", "content": SYSTEM},
        {"role": "user", "content": "Theme: last train home after a night shift. Mood: tired but hopeful. Style: indie folk."},
    ],
)
print(resp.choices[0].message.content)

The same call works from curl if you want to test from a terminal:

curl https://api.musicgen.cc/v1/chat/completions \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"uncensored","temperature":0.9,"messages":[{"role":"user","content":"Write a four-line chorus about a lighthouse keeper. Indie folk."}]}'

The quickstart covers Node and the response headers if you want more detail.

Write a system prompt that fixes the format

Most disappointing lyric output comes from a vague prompt. The model fills gaps with the most average choice, which in lyrics means safe rhymes and generic imagery. The system prompt is where you take those choices away.

A useful system prompt for lyrics has four parts:

  • Structure. Name the sections and their order. If your music tool wants tags such as [Verse] and [Chorus], say so exactly.
  • Line craft. State the rhyme scheme, the syllable range per line, and whether slant rhymes are fine.
  • Voice. Give a point of view, a tense, and a few words you want or ban. A short ban list ("heart", "fire", "tonight") is surprisingly effective.
  • Output rule. Say that the reply is the lyric and nothing else. That keeps greetings and explanations out of the text you paste into your pipeline.

Keep the user message for the part that changes: the theme, the mood and the genre. This split makes your calls repeatable. You can change the theme a hundred times and the format stays put.

Settings that matter

Temperature is the main dial. Around 0.8 to 1.0 gives varied imagery for first drafts. Drop to 0.5 or lower when you are polishing a verse and want small edits, not rewrites. top_p, stop, seed and the frequency and presence penalties are passed through. A presence penalty can discourage the model from circling back to the same words in a long lyric, and a fixed seed helps you compare two prompt versions fairly.

A workflow that produces usable songs

One call rarely gives a finished song. Treat it as a short editing loop instead.

  1. Brief. Send the theme, genre, mood and any lines you already like. Ask for a first draft.
  2. Select. Read the draft, keep the lines that work, and mark the ones that do not.
  3. Revise. Send the draft back as the previous assistant turn, then add a user message such as "Keep verse 1 and the chorus. Rewrite verse 2 with a night-bus image and drop the word 'lonely'."
  4. Variants. Ask for three alternative bridges, each in a different tone, and pick one.
  5. Handoff. Ask for a one-line style description of the finished song to feed into your music generator.

Because the API is stateless, each call carries the whole conversation. That is easy to manage in code: keep a list of messages, append each turn, and send the list. The code below shows a revise step.

history = [
    {"role": "system", "content": SYSTEM},
    {"role": "user", "content": "Theme: last train home. Mood: tired but hopeful. Style: indie folk."},
]

first = client.chat.completions.create(model="uncensored", messages=history, temperature=0.9)
draft = first.choices[0].message.content
history.append({"role": "assistant", "content": draft})

history.append({"role": "user", "content": "Keep the chorus. Rewrite verse 2 around a night bus. Do not use the word lonely."})
second = client.chat.completions.create(model="uncensored", messages=history, temperature=0.7)
print(second.choices[0].message.content)

Using the 100k context for consistency

The context window is 100,000 tokens, counting prompt and completion together. Song lyrics are short, usually a few hundred tokens each, so the window is large for this job. A 400-token lyric means roughly 200 finished songs would fit in the prompt with space left for an answer.

You rarely need that many, but a slice of it is useful. Paste ten or twenty of your own lyrics into the system prompt as a style reference and ask the model to match the diction and line length, not the subject. For a concept album, paste the lyrics written so far and ask for a track that continues the same imagery without repeating lines. For translation work, send the original and ask for a singable version in another language that keeps the stress pattern.

Two cautions apply. First, a long prompt costs input tokens on every call, so keep reference material to what the model actually needs. Second, the model can drift toward copying phrases from references. Ask it explicitly for new images, and check the output yourself. Do not feed in lyrics you do not have the right to use.

What it costs per draft

Pricing is $0.15 per 1M input tokens and $0.50 per 1M output tokens, from prepaid credit. Lyrics are cheap because they are short.

Take a first draft with a 600-token prompt (system prompt plus brief) and a 700-token lyric. Input: 600 × $0.15 / 1,000,000 = $0.00009. Output: 700 × $0.50 / 1,000,000 = $0.00035. The draft costs $0.00044, so 1,000 drafts cost $0.44.

A revision call carries more history. With a 2,000-token prompt (system, brief, first draft, instruction) and a 700-token reply, input is $0.0003 and output is $0.00035, which is $0.00065 per revision. Even a heavy session of 10 drafts and 30 revisions comes to 10 × $0.00044 + 30 × $0.00065 = $0.0044 + $0.0195 = $0.0239, about two and a half cents.

New users can claim $0.50 of trial credit with one click on the key page, valid for 7 days, no card needed. Beyond that, top-ups start at $20 and credit never expires. See the pricing page for bonuses and payment methods, which include crypto only.

Limits and common problems

  • Rhymes that miss. Models count sounds loosely. Ask for the rhyme scheme explicitly and request a final line-by-line check of the end words.
  • Generic imagery. Give a concrete setting, an object and a time of day. Ban the three clichés you see most.
  • Stray commentary. If the reply includes notes, tighten the output rule or add a stop sequence that ends generation at a marker you place.
  • HTTP 429. A full key allows 8 concurrent requests and 300 requests per minute, and a trial key allows 2 and 60. The error code is rate_limited or concurrency. On temporary overload you also get a Retry-After: 5 header, so wait that long and retry.
  • Streaming UI. With stream: true you can show lyrics as they appear. A streamed request holds its concurrency slot until the stream ends.

Prompts are not used for training, which matters when your lyrics are unreleased work.

Questions and answers

Can the API turn lyrics into a song?

No. It is text only, with no audio, image or video generation. Use it to write lyrics and style prompts, then pass them to a music tool.

Which model ID do I use?

Use uncensored with the OpenAI-compatible chat completions endpoint at the base URL shown in your account and docs.

Will it refuse dark or mature themes?

The model is tuned to answer without content refusals for lawful adult use. The hard limit is that it never writes sexual content involving minors.

How much does a lyric cost?

A typical draft of about 700 output tokens with a 600-token prompt costs about $0.00044 at $0.15 and $0.50 per 1M tokens.

Is there a free way to try it?

New users can claim $0.50 of trial credit with one click after sign-up. It needs no card and is valid for 7 days.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

Key points

  • The model writes lyrics, rhymes, structure and style notes as text. It does not produce audio, melodies or vocals.
  • Point any OpenAI client at the base URL, use the model ID uncensored, and send a system prompt that fixes your format.
  • The 100,000-token window holds a whole catalog of reference lyrics plus your brief, so you can keep a consistent voice.
  • A full lyric draft of about 700 output tokens costs roughly $0.00044, so 1,000 drafts come to about $0.44.