Developer API

AI Music Generator API

Send lyrics in, get a sung, mixed and arranged track out. The same lyrics-first workflow you know from Lyrics Into Song, available as a JSON API for your own product.

  • Your lyrics, sung with a matching melody and arrangement
  • Up to two versions per request, so users can choose
  • Webhook callbacks, so no long-running connections
  • Billed per request, failed generations are free

The API is offered through APIstable, the API platform we recommend for developers.

create-song.mjs
// Node.js 18+ (built-in fetch)
const BASE = "https://apistable.ai/api/v1/tasks";
const headers = {
  Authorization: `Bearer ${process.env.APISTABLE_API_KEY}`,
  "Content-Type": "application/json",
};

const created = await fetch(`${BASE}/create_task`, {
  method: "POST",
  headers,
  body: JSON.stringify({
    model: "<MUSIC_MODEL_ID>",
    input: {
      custom_mode: true,
      instrumental: false,
      title: "Paper Boats",
      style: "indie folk, soft male vocals, acoustic guitar",
      lyrics: "[Verse]\nWe folded wishes into paper boats\n[Chorus]\nSail on, sail on",
    },
  }),
}).then((r) => r.json());

const taskId = created.data.task_id;

let task;
do {
  await new Promise((r) => setTimeout(r, 8000));
  task = await fetch(`${BASE}/${taskId}`, { headers }).then((r) => r.json());
} while (task.data.status === "processing");

console.log(task.data.status, task.data.result);

What goes into a request

A song request is one small JSON object. These are the fields you will use most:

lyrics

The words to sing. Mark sections with tags like [Verse], [Chorus] and [Bridge] so the song follows your structure.

style

Genre, mood, instruments, vocal type and tempo as short comma-separated tags.

title

The song title that is returned with the generated tracks.

instrumental

Set to true to ignore vocals and get backing music only.

custom_mode

Set to true to use your own lyrics, style and title. Leave it off to describe the song in a single prompt instead.

callback_url

Optional HTTPS endpoint that is notified as soon as the task finishes.

Swap <MUSIC_MODEL_ID> for the identifier listed on the model page, and only send this request from your backend.

Writing lyrics the API sings well

Most quality problems come from the input, not the model. These habits from our own users carry over directly to the API:

01

Always tag your sections

A clear [Verse] / [Chorus] / [Verse] / [Chorus] / [Bridge] layout gives the melody room to repeat and build.

02

Keep lines short and singable

Six to ten syllables per line usually sounds natural. Very long lines get rushed.

03

Let style tags carry the sound

Put genre and instruments in style, not in the lyrics. Words inside lyrics will be sung.

04

Generate twice, keep the best

Each request returns more than one take. Let your users pick, or score them automatically.

Built for teams turning words into music

Songwriting apps

Let writers hear a draft of their lyrics in minutes.

Gift and greeting songs

Sell personalized songs for birthdays, weddings and anniversaries.

Education

Turn lessons, vocabulary and poems into songs students remember.

Creator tools

Add custom theme songs and jingles to video and podcast workflows.

Just want to turn your own lyrics into a song, without code? Use the Lyrics Into Song app

AI Music Generator API: developer Q&A

Does Lyrics Into Song have an API?

Yes. Developer access to song generation is offered through APIstable, our recommended API platform. You sign up there, create a key and follow its documentation.

What does one request cost?

There is no subscription; every request draws from a prepaid balance. Expect up to two tracks per request, and a generation that fails costs nothing. The model page lists today's rate.

Can I use my Lyrics Into Song credits for the API?

No. App credits and subscriptions only apply to the Lyrics Into Song website. API usage is billed separately on your API account.

How do I know when a song is ready?

Creating a task returns a task ID immediately. Either check that task every few seconds, or add a callback URL and you will be notified when it succeeds or fails.

How long are generated files kept?

Generated audio is stored for a limited time, so download the tracks to your own storage as soon as the task succeeds.

Can I make instrumentals as well as vocal songs?

Yes. Set instrumental to true to get music without vocals, which works well for intros, background beds and loops.

Put your lyrics engine behind an API

Create a key, send your first lyrics and hear the result in a few minutes.

Start with the API