Basic generation
Send aPOST request to /api/generate with a plain-language description of the music you want. Suno always produces two variations per request.
Request fields
A natural-language description of the music you want to generate. Suno uses this to write lyrics and choose a style automatically.
When
true, the generated track has no vocals. Defaults to false.The Suno model to use. Defaults to
chirp-v3-5 (the DEFAULT_MODEL constant). Pass a different model string to target a specific version.When
false (default), the request returns immediately with status "submitted". When true, the server waits up to 100 seconds for generation to finish before responding. See Polling for completion below.The AudioInfo response
Both/api/generate and /api/get return an array of AudioInfo objects — one per clip.
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the clip. Use this to poll for status or extend the track. |
title | string | null | Title assigned by Suno. |
image_url | string | null | URL to the generated cover art. |
lyric | string | null | The full lyrics text. |
audio_url | string | null | Direct URL to the MP3 audio file. Populated once status is "streaming" or "complete". |
video_url | string | null | URL to a video version of the clip. |
created_at | string | ISO 8601 timestamp of when the clip was created. |
model_name | string | The model used, e.g. chirp-v3-5. |
gpt_description_prompt | string | null | The original natural-language prompt sent to the generation API. |
prompt | string | null | The lyric text used in the final generation. |
status | string | Current state of the clip. See status values below. |
type | string | null | Internal clip type (e.g. "gen"). |
tags | string | null | Genre and style tags applied to the generation. |
negative_tags | string | null | Styles that were excluded from the generation. |
duration | string | null | Duration of the audio in seconds. |
error_message | string | null | Human-readable error detail when status is "error". |
Status values
| Status | Meaning |
|---|---|
submitted | Request accepted; generation has not started yet. |
queued | Clip is waiting in Suno’s generation queue. |
streaming | Audio is being written; the file is already playable via audio_url. |
complete | Generation finished; the full audio file is available. |
error | Generation failed. Check error_message for details. |
Polling for completion
By default (wait_audio: false) the API returns immediately. The status will be "submitted" and audio_url will be empty. You need to poll /api/get until the audio is ready.
- Async (recommended)
- Synchronous
Pass Poll every 3–5 seconds. Stop when
wait_audio: false and poll manually. This is the recommended approach because generation can take 30–90 seconds and you avoid holding a connection open.status is "streaming" or "complete". If status becomes "error", read error_message from the response.Default model
When you omit themodel field, the API uses chirp-v3-5 — the value of the DEFAULT_MODEL constant defined in src/lib/SunoApi.ts. Pass a different string to target another model version.
Error handling
| HTTP status | Meaning | What to do |
|---|---|---|
200 | Success | Read the AudioInfo array. |
402 | Payment required — account is out of credits | Top up your Suno credits or rotate to another account. |
503 | Network error — could not reach Suno’s API | Check your internet connection and retry with exponential back-off. |
500 | Internal server error | Check the server logs. The response body includes an error field with details. |
When a 402 is returned, the response body is
{"error": "Payment required"} or a detail string from Suno. Use GET /api/get_limit to check remaining credits before generating in bulk.