TokenLab

Music

Create Music

Creates a music generation task using Suno

POST
/v1/music/generations

Use GET /v1/models?recommended_for=music to get current music models.

Generate music and lyrics using AI. This is an asynchronous API. Create responses return a task identity, and may also return a preferred poll_url for status checks.

Request Body

modelstringdefault: suno_music

Music model ID, such as suno-music. For lyrics only, choose a model whose current public operations include lyrics.

promptstring

Music description or replacement text. Required for music, lyrics, upload-cover, upload-extend, and replace-section; optional for add-instrumental and stem separation.

titlestring

Title for the generated song.

tagsstring

Style tags (e.g., "pop, upbeat, electronic").

negative_tagsstring

Styles to avoid. Required when audio_operation is add-instrumental.

actionstring

Optional MUSIC or LYRICS value. Choose a model that supports the corresponding public operation; this field does not add lyrics support to a music-only model.

mvstring

Suno version selector. Required for generation, upload-cover, upload-extend, add-instrumental, and replacement from audio_url. Omit it for lyrics, replacement from task_id + audio_id, and stem separation. Accepted values: chirp-v3-5, chirp-v4, chirp-v4-5, chirp-v4.5, chirp-v4-5plus, chirp-v4.5plus, chirp-v4-5all, chirp-v4.5all, chirp-v5, chirp-v5-5, chirp-v5.5.

make_instrumentalboolean

Set to true to generate instrumental output without vocals.

audio_urlstring

Publicly reachable reference or uploaded audio URL. When provided without audio_operation, TokenLab uses the upload-cover flow.

audio_operationstring

Audio operation: upload-cover, upload-extend, add-instrumental, replace-section, vocal-separate, multi-stem-separation, advanced-split.

vocal-separate, multi-stem-separation, and advanced-split require task_id + audio_id; advanced-split also requires stem_name. upload-extend requires continue_at greater than 0. add-instrumental requires audio_url, title, tags, and negative_tags.

For replace-section, send prompt, tags, title, infill_start_s, infill_end_s, and full_lyrics. Choose exactly one source: task_id + audio_id, or audio_url + mv. The replacement interval must be 6–60 seconds.

task_idstring

Source task ID belonging to your organization, for generated-audio replacement or stem separation.

audio_idstring

Source audio ID returned in the source task result. Required with task_id for generated-audio replacement and stem separation.

infill_start_snumber

Replacement start time in seconds, at least 0. Required for replace-section.

infill_end_snumber

Replacement end time in seconds. Required for replace-section; it must be 6–60 seconds after infill_start_s.

full_lyricsstring

Full lyrics for the resulting song. Required for replace-section.

stem_namestring

Stem name. Required for advanced-split.

continue_clip_idstring

ID of a previous clip to continue from.

continue_atnumber

Time in seconds from which to continue. Required and greater than 0 for upload-extend.

prompt accepts up to 5000 characters; tags and negative_tags accept up to 1000 characters each. Supported operations and parameters depend on the selected model's current details.

Response

idstring

Task ID for polling status.

task_idstring

Alias of the same asynchronous task ID, when returned.

poll_urlstring

Preferred polling URL for this task when provided.

statusstring

Task status: pending, processing, completed, or failed.

createdinteger

Task creation time as a Unix timestamp, when returned.

Request

curl -X POST "https://api.tokenlab.sh/v1/music/generations" \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "suno-music",
    "mv": "chirp-v4",
    "prompt": "An upbeat electronic dance track with heavy bass",
    "title": "Night Drive",
    "tags": "electronic, EDM, energetic"
  }'

Response

Response
{
  "id": "ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "task_id": "ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "poll_url": "/v1/tasks/ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "status": "pending",
  "model": "suno-music"
}

Authorization

BearerAuth
AuthorizationBearer <token>

API Key authentication. Create or manage API keys in Dashboard > API > API Keys.

In: header

Headers

X-TokenLab-Delivery-Policy?string

Per-request Delivery policy. Overrides the API key and Workspace defaults. Auto tries TokenLab Verified first and may switch once to Official only before output, request acceptance, or persistent resource creation.

Value in

  • "auto"
  • "verified"
  • "official"

Request Body

application/json

Response

application/json

application/json