Skip to main content
The audio API turns a style prompt and lyrics into a full song. Generation takes from several seconds to a few minutes, so the API is asynchronous: you create a job, poll it until it finishes, then read the result URL. New here? The three steps below take you from a prompt to a saved .mp3.

Step 1: Create a job

A request needs a model and a prompt that describes the style. Add lyrics_prompt with the words to sing on models that take lyrics. Browse the ids on the music models page.
curl
You get back a job object with status: "in_progress". Save the id so you can poll it in Step 2.

Step 2: Poll for completion

Call GET /v1/audio/generations/{id} on an interval (every few seconds is plenty) until status is completed or failed. A completed job carries the result under audio[].

Step 3: Get the file

Use audio[].url directly, or call GET /v1/audio/generations/{id}/content to be redirected to the same file. The full loop looks like this:
An audio id is scoped to the key that created it. Another key cannot poll or download it. Download anything you want to keep as soon as the job completes.

Writing the prompt and lyrics

A song comes from two fields that do different jobs:
  • prompt describes the style: genre, mood, instruments, tempo. Up to the model’s prompt_max_length.
  • lyrics_prompt is the words to sing, with structure tags like [Verse], [Chorus], [Bridge], [Intro], and [Outro] on their own lines. Separate lines with \n. On minimax-music-v2 the lyrics run from 10 to 3000 characters.
Lyrics support is model-specific: some models require lyrics for vocal songs, some can generate instrumental-only tracks, and some write their own lyrics from the prompt. See the music models page. A failed job is not charged.

Choosing a model

Each music model accepts a style prompt plus its own set of options, such as lyrics, instrumental toggles, duration, and output format. There are two ways to see what a model supports:
  • The music models page, with a card per model showing its prompt limit and output options.
  • GET /v1/models, the same facts as JSON, scoped to your key.
Each audio entry lists the parameters it accepts (with type, allowed values, and default), plus prompt_max_length and its modalities:
Example music model entry

Common parameters

Availability of each option is model-specific; call GET /v1/models for the exact set a model accepts.
string
required
The music model id. Take it from GET /v1/models.
string
required
The music style: genre, mood, instruments. Over the model’s prompt_max_length returns 400.
string
The lyrics to sing, with [Verse] / [Chorus] structure tags. Required by some models (for example minimax-music-v2).
boolean
Generate a vocal-free track, where supported.
integer
Output length, where the model supports duration control.
enum
Output options, where supported. format is mp3 on minimax-music-v2; minimax-music-v2.5 and minimax-music-v2.6 also accept wav and pcm.

Pricing

Music is priced per track (a flat rate per song) or per minute of output, depending on the model. Per-model rates are on deepshi.ai. You are billed only for delivered output. A job is charged once, when it completes. A job that fails is not charged. Like video, music responses do not carry an inline usage.cost; check your balance and per-model rates on deepshi.ai.

Next steps

Audio models

Browse audio models, their prompt limits, and output options.

Credits & billing

How billing and your prepaid balance work.