Generate Music
Generate music with or without lyrics using AI models.
Usage Guide
- This endpoint creates music based on your text prompt
- Multiple variations will be generated for each request
- You can control detail level with custom mode and instrumental settings
Parameter Details
-
In Custom Mode (
customMode: true):- If
instrumental: true:styleandtitleare required - If
instrumental: false:style,prompt, andtitleare required - Character limits vary by model:
- V4:
prompt3000 characters,style200 characters - V4_5, V4_5PLUS, V5, V5_5 & V4_5ALL:
prompt5000 characters,style1000 characters (V5_5: Unleash Your Voice: Custom Models Tailored to Your Unique Taste — same limits as V5)
- V4:
titlelength limit: 80 characters (all models)
- If
-
In Non-custom Mode (
customMode: false):- Only
promptis required regardless ofinstrumentalsetting promptlength limit: 500 characters- Other parameters should be left empty
- Only
Optional parameters
- vocalGender (string): Preferred vocal gender. Allowed values:
m(male),f(female) - styleWeight (number): Style adherence weight in range 0–1 (recommended two decimals)
- weirdnessConstraint (number): Creativity/novelty constraint in range 0–1 (recommended two decimals)
- audioWeight (number): Relative weight of audio consistency in range 0–1 (recommended two decimals)
- personaId (string): Persona ID or Suno Voice
voiceIdto apply in Custom Mode. If you use a Voice-generated ID, setpersonaModeltovoice_persona. - personaModel (string): Persona type. Use
style_personafor Generate Persona IDs, orvoice_personafor Suno Voice IDs.
Developer Notes
- Recommendation for new users: Start with
customMode: falsefor simpler usage - Generated files are retained for 14 days
- Callback process has three stages:
text(text generation),first(first track complete),complete(all tracks complete)
Authorizations
🔑 API Authentication
All endpoints require authentication using Bearer Token.
Get API Key
- Visit the API Key Management Page to obtain your API Key
Usage
Add to request headers:
Authorization: Bearer YOUR_API_KEY⚠️ Note:
- Keep your API Key secure and do not share it with others
- If you suspect your API Key has been compromised, reset it immediately from the management page
Body
Enables Custom Mode for advanced audio generation settings.
- Set to
trueto use Custom Mode (requiresstyleandtitle;promptrequired ifinstrumentalisfalse). The prompt will be strictly used as lyrics ifinstrumentalisfalse. - Set to
falsefor Non-custom Mode (onlypromptis required). Lyrics will be auto-generated based on the prompt.
true
Determines if the audio should be instrumental (no lyrics).
- In Custom Mode (
customMode: true):- If
true: Onlystyleandtitleare required. - If
false:style,title, andpromptare required (withpromptused as the exact lyrics).
- If
- In Non-custom Mode (
customMode: false): No impact on required fields (promptonly). Lyrics are auto-generated ifinstrumentalisfalse.
true
The AI model version to use for generation.
- Required for all requests.
- Available options:
V5: Superior musical expression, faster generation.V5_5: Unleash Your Voice: Custom Models Tailored to Your Unique Taste. Same custom-modepromptandstylecharacter limits as V5 (5000 / 1000).V4_5PLUS: V4.5+ is richer sound, new waysto create, max 8 min.V4_5: V4.5 is smarter prompts, fastergenerations, max 8 min.V4: V4 is improved vocal quality,max 4 min.V4_5ALL: V4.5-all is better song structure,max 8 min.
V4_5ALL, V4, V4_5, V4_5PLUS, V5, V5_5 "V4_5ALL"
The URL to receive task completion notifications when music generation is complete. The callback process has three stages: text (text generation), first (first track complete), complete (all tracks complete). Note: In some cases, text and first stages may be skipped, directly returning complete.
- For detailed callback format and implementation guide, see Music Generation Callbacks
- Alternatively, you can use the Get Music Generation Details interface to poll task status
"https://api.example.com/callback"
A description of the desired audio content.
- In Custom Mode (
customMode: true): Required ifinstrumentalisfalse. The prompt will be strictly used as the lyrics and sung in the generated track. Character limits by model:- V4: Maximum 3000 characters
- V4_5, V4_5PLUS, V5, V5_5 & V4_5ALL: Maximum 5000 characters
Example: "A calm and relaxing piano track with soft melodies"
- In Non-custom Mode (
customMode: false): Always required. The prompt serves as the core idea, and lyrics will be automatically generated based on it (not strictly matching the input). Max length: 500 characters.
Example: "A short relaxing piano tune"
"A calm and relaxing piano track with soft melodies"
The music style or genre for the audio.
- Required in Custom Mode (
customMode: true). Examples: "Jazz", "Classical", "Electronic".- For V4 model: Max length: 200 characters.
- For V4_5, V4_5PLUS, V5, V5_5 and V4_5ALL models: Max length: 1000 characters.
Example: "Classical"
- In Non-custom Mode (
customMode: false): Leave empty.
"Classical"
The title of the generated music track.
- Required in Custom Mode (
customMode: true). Character limits by model:- V4 and V4_5ALL: Max length: 80 characters
- V4_5, V4_5PLUS, V5 & V5_5: Max length: 100 characters
Example: "Peaceful Piano Meditation"
- In Non-custom Mode (
customMode: false): Leave empty.
"Peaceful Piano Meditation"
Only available when custom parameters are enabled. Persona ID to apply to the generated music. Optional. You can use either:
- A Persona ID generated by the Generate Persona endpoint. Use
personaModel: style_personaor omitpersonaModelto use the default. - A
voiceIdgenerated by the Suno Voice workflow. When using a voice-generated ID, you must setpersonaModel: voice_persona.
"persona_123"
Persona model type to apply when using personaId. Optional.
style_persona(default): Use this for Persona IDs generated by the Generate Persona endpoint.voice_persona: Use this whenpersonaIdis avoiceIdgenerated by Suno Voice. This option is only available with V5 and V5_5 models.
style_persona, voice_persona "style_persona"
Music styles or traits to exclude from the generated audio.
- Optional. Use to avoid specific styles.
Example: "Heavy Metal, Upbeat Drums"
"Heavy Metal, Upbeat Drums"
Preferred vocal gender. Optional. Allowed values: 'm' (male), 'f' (female).
m, f "m"
Style adherence weight. Optional. Range: 0-1. Two decimal places recommended.
0 <= x <= 1Must be a multiple of 0.010.65
Creativity/novelty constraint. Optional. Range: 0-1. Two decimal places recommended.
0 <= x <= 1Must be a multiple of 0.010.65
Relative weight of audio consistency versus other controls. Optional. Range: 0-1. Two decimal places recommended.
0 <= x <= 1Must be a multiple of 0.010.65
Callbacks
Response
Request successful
Status Codes
- ✅ 200 - Request successful
- ⚠️ 400 - Invalid parameters
- ⚠️ 401 - Unauthorized access
- ⚠️ 404 - Invalid request method or path
- ⚠️ 405 - Rate limit exceeded
- ⚠️ 413 - Theme or prompt too long
- ⚠️ 429 - Insufficient credits
- ⚠️ 430 - Your call frequency is too high. Please try again later.
- ⚠️ 455 - System maintenance
- ❌ 500 - Server error
200, 400, 401, 404, 405, 413, 429, 430, 455, 500 200
Error message when code != 200
"success"
