Suno API Integration: From API Key to Your First Song
Get an API Key, submit a generation request, poll task status, and fetch the audio URL: the full Suno API integration flow, step by step.
The integration flow itself is not complicated. The key is understanding that it is an asynchronous task: a successful submission does not mean generation is finished, so you must query the status again. Here is the whole process in order.
Step 1: Get your API Key
After registering an account, get your API Key from the console. Put it in the request headers when calling:
Authorization: Bearer <API_KEY>
Content-Type: application/json
Keep the API Key on your own server only. Do not put it in frontend code, mobile app packages, or public repositories.
Step 2: Submit a generation request
Inspiration mode only needs a description:
POST /api/music/create
{
"description": "bright Chinese pop, piano intro, warm female vocal",
"model": "suno-v6"
}
Custom mode lets you specify lyrics, style, and title:
POST /api/music/create/custom
{
"lyrics": "[Verse]\nNight falls outside the window",
"style_tags": "mandopop, piano, warm",
"song_title": "Walking Toward the Light",
"model": "suno-v6"
}
Step 3: Poll the task status
After submitting, you get a song ID. Use the query endpoint to check the status. Check every 3 to 5 seconds; do not retry at high frequency.
POST /api/music/query
{ "song_ids": ["your song ID"] }
| Status | Meaning |
|---|---|
| pending / processing | Accepted or generating, keep waiting |
| completed | Finished, you can fetch the audio URL |
| failed | Terminal failure, read the error message |
Step 4: Get the audio URL
Once the task is complete, call the download URL endpoint and request MP3, WAV, or video as needed:
POST /api/music/download-url
{ "song_id": "your song ID", "kind": "mp3" }
Use the URL returned by the API. Do not construct it yourself or cache old links.
Common pitfalls
- Treating a successful submission as finished generation and reading the audio URL right away, which returns an empty value.
- Using a temporary placeholder ID from the page to call the API instead of the real song ID.
- Forgetting to handle the failed terminal state, leaving the task stuck in polling.
- Exposing the API Key on the client side.
For the full field reference, see the API documentation. If you need help with integration, contact support.
¥0.6 per generation, 2 tracks, unlimited downloads
Runs on the Suno V6 engine. Download MP3 or WAV as often as you like. Signing up needs an email address, not a phone number.
Start creating Read the API docs