Suno Music API Guide: Generate, Extend, Cover and Lyrics
How to call Suno on DreamTo: generate songs, extend them, cover uploaded audio and write lyrics, with the async task flow, parameters, limits and prices.

On this page
Suno on DreamTo runs through one task API. You create a task, get a task ID back, and either poll for the result or have DreamTo call your server when it is ready. The same pattern generates a song from a one-line description, continues it, covers an uploaded recording in a new style, or writes lyrics before any audio exists.
This guide covers four endpoints: generate, extend, upload-and-cover and lyrics. The request shapes and limits come from the Suno docs, including the rules that return a 422 when broken. Stem separation, MIDI, WAV conversion, music videos and custom voices go through the same createTask call and are not covered here.
Create a task, then poll for the result#
Every Suno endpoint is called with POST /api/v1/jobs/createTask, where model names the endpoint (for example ai-music-api/generate) and the parameters go in input. The four endpoints in this guide are asynchronous: the create call returns data.taskId, and you read the result with GET /api/v1/jobs/recordInfo?taskId=<taskId>. The base URL is https://api.dreamto.ai and the key goes in an Authorization: Bearer header (see authentication). A few endpoints outside this guide, such as timestamped lyrics, return their result in the create response with nothing to poll.
Three things to know before the first request:
- Every response has HTTP status 200. The outcome is the
codefield in the body:200is success and anything else is an error, with the reason inmsg.422means the request broke a rule,401a missing or invalid key,402a balance below the price when the task is created, and429a rate limit. Invalid requests and failed tasks are not charged. - Poll about every 10 seconds.
data.stateiswaiting,queuingorgeneratinguntil it becomessuccessorfail. Onsuccess, read the result fromdata.response. Onfail,data.failCodeanddata.failMsggive the reason. - The body accepts only
model,callBackUrlandinput. Undeclaredinputfields are rejected with422and an English reason inmsg, so a misspelled parameter name fails at creation.
The model field inside input is separate: it selects the Suno version. Three are available: V6 (greater musical expression, more natural vocals), V6_MINI (lightweight and fast) and V6_WILD (bolder, more distinctive expression). The discontinued V4 to V5_5 versions are not supported.
A create-and-poll helper in Python#
The examples below differ only in the payload, so one helper does the create-and-poll work. Save it as suno_helper.py and set DREAMTO_API_KEY; the Python examples that follow import run_task from it.
import osimport timeimport requestsBASE_URL = "https://api.dreamto.ai"HEADERS = {"Authorization": f"Bearer {os.environ['DREAMTO_API_KEY']}"}def run_task(endpoint: str, task_input: dict) -> dict: payload = {"model": f"ai-music-api/{endpoint}", "input": task_input} created = requests.post( f"{BASE_URL}/api/v1/jobs/createTask", headers=HEADERS, json=payload, timeout=60 ).json() if created["code"] != 200: raise SystemExit(f"{created['code']}: {created['msg']}") task_id = created["data"]["taskId"] while True: record = requests.get( f"{BASE_URL}/api/v1/jobs/recordInfo", headers=HEADERS, params={"taskId": task_id}, timeout=60, ).json()["data"] if record["state"] in ("success", "fail"): break time.sleep(10) if record["state"] == "fail": raise SystemExit(f"{record['failCode']}: {record['failMsg']}") return recordGenerate a song#
ai-music-api/generate turns a description or lyrics into songs, with vocals or as instrumentals. Each request makes two songs, listed in response.data. Each song has its own id, an audio_url (MP3), a stream_audio_url, an image_url for the cover, the lyrics in prompt, style tags and a duration in seconds.
The required custom_mode field switches between two modes.
Simple mode#
With custom_mode: false you describe the song in prompt (up to 3,000 characters) and the model writes the lyrics from it. At least one of prompt, style, lyrics or a reference file is required.
Reference files are accepted in simple mode only, as public http or https URLs:
| Field | Limit |
|---|---|
image_urls | 1 to 5 images, up to 10 MB each (jpeg, png, webp or bmp) |
video_urls | 1 video, up to 100 MB and 241 seconds (mp4, mov or webm) |
audio_urls | 6 seconds to 30 minutes and up to 500 MB per file |
midi_urls | 1 mid or midi file, up to 256 KB |
Reference files, style and lyrics together may total at most 10 items.
curl -X POST "https://api.dreamto.ai/api/v1/jobs/createTask" \ -H "Authorization: Bearer $DREAMTO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "ai-music-api/generate", "input": { "prompt": "A slow synth-pop song about the last train home, sung softly", "custom_mode": false, "instrumental": false, "model": "V6" } }'Custom mode#
With custom_mode: true you set the song yourself. title is required (up to 80 characters), along with at least one of style (up to 1,000 characters), lyrics (up to 5,000) and negative_tags. In this mode prompt is not a description: it is sung as the lyrics when lyrics is absent, and lyrics wins when both are present. Six fine controls work in custom mode only:
| Field | Values |
|---|---|
duration | 10 to 360 seconds; the model decides when omitted |
vocal_gender | m or f |
style_weight | 0 to 1: how strongly to follow style |
weirdness_constraint | 0 to 1: creative deviation, higher is bolder |
audio_weight | 0 to 1: relative weight of the audio features |
variety | integer 0 (exact style) to 4 (results may differ a lot), default 1 |
negative_tags lists styles or traits to avoid, and persona_id with persona_model (style_persona or voice_persona) applies a Persona or a custom voice.
{ "model": "ai-music-api/generate", "input": { "custom_mode": true, "instrumental": false, "model": "V6", "title": "Last Train Home", "style": "Slow synth-pop, warm analog pads, soft female vocal", "negative_tags": "Heavy Metal, Screaming", "lyrics": "[Verse]\nPlatform lights are fading out\nI count the stations one by one\n[Chorus]\nCarry me home, carry me home\nBefore the last train is gone", "vocal_gender": "f", "duration": 180, "variety": 2 }}Validation rules for generate#
- The two modes reject each other's fields. Simple mode rejects
duration,vocal_gender,style_weight,weirdness_constraint,audio_weightandvariety. Custom mode rejectsimage_urls,video_urls,audio_urlsandmidi_urls. - The three
0to1weights take at most 2 decimals, andaudio_weightcannot be used wheninstrumentalistrue. midi_urlsis only supported byV6_WILD. With another version,V6_WILDis used.vocal_genderraises the likelihood of that voice but does not guarantee it.
Extend a song#
ai-music-api/extend continues a song from a chosen point in the same style and returns two extended versions. Only audio_id and model are required. audio_id is the id of one song in response.data of a generate, extend, upload-and-cover or upload-and-extend result, and model must match the version of the source song.
This endpoint takes no task_id: audio_id names the song directly. continue_at is the second to continue from, greater than 0 and less than the source song's duration. A value past the end of the song makes the task fail. When you omit it, the model chooses where to continue.
from suno_helper import run_taskrecord = run_task( "extend", { "audio_id": "f924248f-e765-48fd-9ea9-c64290225e4e", # an id from a previous result "model": "V6", "continue_at": 30, "style": "Cheerful acoustic folk-pop", "title": "Good Morning, Coffee Extended", "lyrics": "[Verse]\nSteam curls up into the light\n[Chorus]\nGood morning, coffee, hold me tight", },)for track in record["response"]["data"]: print(track["id"], track["duration"], track["audio_url"])Lyrics, title and style are optional; without them the model follows the original. lyrics (up to 5,000 characters) takes priority over prompt, and title may be up to 100 characters here instead of 80. With instrumental: true the endpoint rejects lyrics, prompt and vocal_gender. Each extended song gets a new id, so you can extend an extension.
To continue audio you uploaded instead of a generated song, use ai-music-api/upload-and-extend-audio, documented under upload and extend.
Cover an uploaded or generated song#
ai-music-api/upload-and-cover-audio rearranges existing audio in a new style, with new lyrics or as an instrumental, while keeping its melody. It returns two covers per request.
Give it exactly one source:
upload_url: a publichttporhttpsURL of audio no longer than 8 minutes, ortask_idplusaudio_id, always together: a Suno song task of your account that succeeded within the last 14 days, and one of its songs.
Both or neither returns 422. instrumental and model are required.
curl -X POST "https://api.dreamto.ai/api/v1/jobs/createTask" \ -H "Authorization: Bearer $DREAMTO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "ai-music-api/upload-and-cover-audio", "input": { "upload_url": "https://your-cdn.example.com/original.mp3", "instrumental": false, "model": "V6", "style": "Classical, soft piano", "title": "Peaceful Piano Meditation", "lyrics": "[Verse]\nKeep the melody flowing\n[Chorus]\nLet the piano rise and fall", "negative_tags": "Heavy Metal, Upbeat Drums", "vocal_gender": "f", "style_weight": 0.65 } }'Everything else is optional; the source audio alone is enough. The optional fields follow custom-mode generate: style up to 1,000 characters, title up to 80, lyrics or prompt up to 5,000 each (lyrics wins), an integer duration from 10 to 360, and the same style_weight, weirdness_constraint, audio_weight and variety ranges. With instrumental: true, lyrics, prompt and vocal_gender are rejected. With persona_model: "voice_persona", persona_id must be a ready custom voice of your account, otherwise you get a 422.
Write lyrics first#
ai-music-api/generate-lyrics takes one field, the required prompt: a description of the theme, mood, style or story, up to 200 characters. Each request usually returns two or three sets of lyrics in response.resultObject.lyricsData. Each set has a title, the lyrics in text with section markers such as [Verse] and [Chorus], a status (complete or failed), an error_message and, when present, a list of suggested styles in tags.
from suno_helper import run_taskrecord = run_task( "generate-lyrics", {"prompt": "A nostalgic song about childhood memories and growing up in a small town"},)for lyrics in record["response"]["resultObject"]["lyricsData"]: print(lyrics["title"]) print(lyrics.get("tags", [])) print(lyrics["text"])Keep artist names out of prompt: a description that names an artist, or that moderation flags, makes the task fail. Lyrics are plain text with no file links.
From there, pick the set you like and pass its text as lyrics to a custom-mode generate request, using its tags as a reference when you write style. That settles the words before you pay for a song request.
Chaining tasks and keeping result files#
Extension, covers, section replacement, stem separation, WAV conversion, music videos and timestamped lyrics all work on a song generated earlier. Where an endpoint takes them, set input.task_id to the earlier task's taskId and input.audio_id to one song's id. Extend is the exception described above. The source must be a Suno task of your account that succeeded on DreamTo within the last 14 days, and of a kind the endpoint accepts. Otherwise you get code: 422 and nothing is created or charged.
Result files are DreamTo download links of the form https://api.dreamto.ai/v1/tasks/{task_id}/artifacts/.... They work without an API key and support Range requests. Querying a task again returns the same links. Files are kept for 14 days after the task is created. After that the links expire and the task can no longer be the source of a chained task, so download what you need.
Two details of the query response:
paramechoes your create request, withinputas a JSON string that needs a second parse.taskIdis a 32-hex-digit ID that only the same account can query. An unknown or expired one returnscode: 422withmsg: recordInfo is null.
Callbacks instead of polling#
Pass a public http or https URL as callBackUrl when creating the task and DreamTo POSTs the result there once, when the task succeeds or fails. No intermediate-stage callbacks are sent. On success code is 200, data.callbackType is complete, data.task_id is the task ID and data.data is the result. On failure code is the failure code, msg is the reason, and data has only callbackType and task_id.
The request carries X-DreamTo-Event: task.completed, X-DreamTo-Timestamp and, when you have generated a signing secret in the console, X-DreamTo-Signature:
X-DreamTo-Signature = hex( HMAC-SHA256( secret, X-DreamTo-Timestamp + "." + data.task_id + "." + status ) )status is success for a succeeded task and failed for a failed one. Answer with any 2xx. On a timeout (10 seconds) or another status, DreamTo retries after 1, 5 and 30 minutes, for at most 4 deliveries. The signing secret and delivery rules are described in the task callback docs; the body shown on that page is the video task format, not the Suno one above.
What each request costs#
Suno is billed per request: each succeeded task is charged once. As of December 2026 the list prices on /prices are:
| Endpoint | Price per request |
|---|---|
ai-music-api/generate | $0.06 |
ai-music-api/extend | $0.06 |
ai-music-api/upload-and-cover-audio | $0.06 |
ai-music-api/generate-lyrics | $0.002 |
Generate, extend and upload-and-cover return two songs per request, and the per-request price covers both. Failed tasks and invalid requests are not charged. The other Suno endpoints are listed with the rest of the catalog on /models.
Which endpoint to call#
| You have | Use |
|---|---|
| A description or lyrics, no audio | generate |
| A generated song that ends too early | extend |
| A recording, or a song you generated, that you want in another style | upload-and-cover-audio |
| Only an idea for a theme | generate-lyrics, then custom-mode generate |
To hear a result before writing code, try the generate playground. For voice-over to go with a track, see the text-to-speech API guide. The video models use a different task API; its tasks and webhooks are covered in the image-to-video guide.
FAQ#
How do I generate a song with the Suno API?#
Send POST https://api.dreamto.ai/api/v1/jobs/createTask with model set to ai-music-api/generate and your parameters in input, then poll GET /api/v1/jobs/recordInfo?taskId=... about every 10 seconds. When state is success, the two songs are in response.data. custom_mode, instrumental and the Suno version in input.model are required.
How many songs does one request return?#
Generate, extend and upload-and-cover each return two versions per request, and the price is per request. Lyrics requests usually return two or three sets of lyrics.
Which Suno versions can I use?#
V6, V6_MINI and V6_WILD, set in input.model. The discontinued V4 to V5_5 versions are not supported, and extend requires the same version as the source song.
How long are the generated files available?#
Files are kept for 14 days after the task is created. After that the download links expire and the task can no longer be the source of a cover or another chained task, so download the audio promptly.
Can I make an instrumental with no vocals?#
Yes. Set instrumental: true on generate, extend or upload-and-cover. With it set, extend and upload-and-cover reject lyrics, prompt and vocal_gender, and generate rejects audio_weight.
How much does the Suno API cost?#
As of December 2026, generate, extend and upload-and-cover are each $0.06 per request and generate-lyrics is $0.002 per request. See /prices for current rates.


