docs.api.box
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
Support
Suno API
Common APIFile Upload API
Suno API
Common APIFile Upload API
  1. Generate Music
  • API.box Documentation
  • Quick Start
  • Generate Music
    • Music Generation Callbacks
    • Music Extension Callbacks
    • Upload and Cover Audio Callbacks
    • Upload and Extend Audio Callbacks
    • Add Instrumental Callbacks
    • Add Vocals Callbacks
    • Music Cover Generation Callbacks
    • Replace Music Section Callbacks
    • Generate Music
      POST
    • Extend Music
      POST
    • Upload And Cover Audio
      POST
    • Upload And Extend Audio
      POST
    • Add Instrumental
      POST
    • Add Vocals
      POST
    • Get Music Generation Details
      GET
    • Recovery Audio
      POST
    • Get Recovery Audio Details
      GET
    • Get Timestamped Lyrics
      POST
    • Boost Music Style
      POST
    • Generate Music Cover
      POST
    • Replace Music Section
      POST
    • Get Music Cover Details
      GET
    • Generate Persona
      POST
    • Generate Mashup
      POST
  • Suno Voice
    • Suno Voice Validation Phrase Callbacks
    • Suno Voice Generation Callbacks
    • Suno Voice Regenerate Phrase Callbacks
    • Suno Voice Generate Verification Phrase
      POST
    • Suno Voice Get Verification Phrase
      GET
    • Suno Voice Create Custom Voice
      POST
    • Suno Voice Get Custom Voice Record
      GET
    • Suno Voice Regenerate Verification Phrase
      POST
    • Suno Voice Check Availability
      POST
  • Lyrics Generation
    • Lyrics Generation Callbacks
    • Generate Lyrics
    • Get Lyrics Generation Details
  • Generate Sounds
    • Generate Sounds
  • WAV Conversion
    • WAV Format Conversion Callbacks
    • Convert to WAV Format
    • Get WAV Conversion Details
  • Vocal Removal
    • Audio Separation Callbacks
    • MIDI Generation Callbacks
    • Vocal and Instrument Separation
    • Get Audio Separation Details
    • Generate MIDI from Audio
    • Get MIDI Generation Details
  • Music Video Generation
    • Music Video Generation Callbacks
    • Create Music Video
    • Get Music Video Details
  • Generate Speech
    • Generate Speech
  1. Generate Music

Generate Music

POST
/api/v1/generate
Generate music with or without lyrics using AI models.

Model Versions#

Current models: V6 (default), V6_WILD, V6_MINI
Deprecated models: V5_5, V5, V4_5PLUS, V4_5ALL, V4_5, V4
Deprecated values remain available only for backward compatibility. New integrations should use a V6-series model.

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#

Always required: customMode, instrumental, model
In Custom Mode (customMode: true):
title is optional, maximum 80 characters. Only available in this mode
prompt is optional; when provided, it is used strictly as lyrics and sung in the generated track. If lyrics is also provided, lyrics takes priority
At least one of style, lyrics, or negativeTags must be provided; generation is rejected if all are empty
If instrumental: true: generate instrumental music (no vocals)
If instrumental: false: use lyrics as lyrics (fall back to prompt if lyrics is not provided)
Optional: duration, negativeTags, vocalGender, styleWeight, weirdnessConstraint, audioWeight, variety, personaId, personaModel
Character limits by model:
V4 (Deprecated): prompt 3000 characters, style 200 characters
V4_5, V4_5PLUS, V4_5ALL, V5, V5_5 (Deprecated): prompt 5000 characters, style 1000 characters
V6, V6_MINI, V6_WILD: style 1000 characters; lyrics 5000 characters; negativeTags 1000 characters
title length limit: 80 characters (all models)
In Non-custom Mode (customMode: false):
prompt is optional; it serves as the core idea, and lyrics are generated automatically (not a strict match), maximum 3000 characters
lyrics can be used as a lyrics attachment together with prompt
At least one of imageUrls, videoUrls, audioUrls, midiUrls, style, or lyrics must be provided; generation is rejected if all are empty
imageUrls, videoUrls, audioUrls, and midiUrls are only valid in this mode
Do not pass parameters that are only available in custom mode: title, negativeTags, duration, vocalGender, styleWeight, weirdnessConstraint, audioWeight, variety, personaId, personaModel
Total attachments must not exceed 10: style + lyrics + imageUrls + videoUrls + audioUrls + midiUrls

Optional Parameters#

The following fields are optional controls available for this endpoint:
prompt (string): Description of the desired audio content. Optional. Used as lyrics in custom mode; used as the core idea in non-custom mode (maximum 3000 characters).
lyrics (string): Lyrics content. Optional. V6 series maximum 5000 characters. In custom mode, takes priority over prompt as lyrics; in non-custom mode, can be used as a lyrics attachment together with prompt.
imageUrls (array): Image references. Only effective when customMode is false. Up to 5 images, each no more than 10 MB. Supported formats: jpeg, png, webp, bmp.
videoUrls (array): Video references. Only effective when customMode is false. Up to 1 file, each no more than 100 MB, duration no more than 241 seconds. Supported formats: mp4, mov, webm.
audioUrls (array): Audio references. Only effective when customMode is false. Duration must be between 6 seconds and 30 minutes; each file no more than 500 MB.
midiUrls (array): MIDI references. Only effective when customMode is false. Currently up to 1 file, each no more than 256 KB, and must start with the standard MThd\x00\x00\x00\x06 header. Supported formats: mid, midi. Only supported by V6_WILD; other models will be switched to V6_WILD.
style (string): Music style specification. See character limits in Parameter Details above.
title (string): Track title. Optional. Only available when customMode is true. Maximum 80 characters. Displayed in player interfaces and filenames.
negativeTags (string): Music styles or traits to exclude from the generated audio. Only available when customMode is true. For V6, V6_MINI, and V6_WILD: maximum 1000 characters.
vocalGender (string): Vocal gender preference. m for male, f for female. Only available when customMode is true. In practice, this only increases probability and cannot guarantee the instruction is followed.
styleWeight (number): Strength of adherence to the specified style. Range 0–1, up to 2 decimal places. Only effective when customMode is true.
weirdnessConstraint (number): Creative/experimental deviation. Range 0–1, up to 2 decimal places. Only effective when customMode is true.
audioWeight (number): Relative weight of audio features. Range 0–1, up to 2 decimal places. Only effective when customMode is true. Not supported when there are no vocals.
variety (integer): Diversity of generated results. Integer from 0–4, default 1. Only effective when customMode is true. 0 off (exact style), 1 normal (default, balanced), 2 high (distinct styles), 3 extra (bold exploration), 4 max (maximum variation).
personaId (string): Persona ID or Voice ID. Optional. Only available when customMode is true. To generate a Persona ID, see Generate Persona.
personaModel (string): Persona model, style_persona or voice_persona. Only available when customMode is true. Only available for V5 (Discontinued), V5_5 (Discontinued), V6, V6_MINI, and V6_WILD.
duration (number): Audio duration in seconds. Range 10–360, default 20. Only available when customMode is true, and only valid when the model is V5_5, V6, V6_MINI, or V6_WILD.
Request Example
Non-custom mode
Custom mode
{
  "customMode": false,
  "instrumental": false,
  "prompt": "A chill lo-fi beat with soft vocals",
  "lyrics": "[Verse] Night city lights shining bright",
  "style": "lo-fi, chill",
  "imageUrls": [
    "https://example.com/reference-image.png"
  ],
  "videoUrls": [
    "https://example.com/reference-video.mp4"
  ],
  "audioUrls": [
    "https://example.com/reference-audio.mp3"
  ],
  "midiUrls": [
    "https://example.com/midi/reference.mid"
  ],
  "model": "V6",
  "callBackUrl": "https://example.com/callback"
}

Developer Notes#

Recommendation for new users: Start with customMode: false for 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)

Callbacks

audioGenerated

Request

Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Body Params application/jsonRequired

Examples

Responses

🟢200Success
application/json
Request successful
Bodyapplication/json

🔴500Server Error
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://apibox.erweima.ai/api/v1/generate' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "prompt": "A calm and relaxing piano track with soft melodies",
    "lyrics": "[Verse] Night city lights shining bright",
    "imageUrls": [
        "https://example.com/reference-image.png"
    ],
    "videoUrls": [
        "https://example.com/reference-video.mp4"
    ],
    "audioUrls": [
        "https://example.com/reference-audio.mp3"
    ],
    "midiUrls": [
        "https://example.com/midi/reference.mid"
    ],
    "style": "Classical",
    "title": "Peaceful Piano Meditation",
    "customMode": true,
    "instrumental": true,
    "model": "V6",
    "callBackUrl": "https://api.example.com/callback",
    "negativeTags": "Heavy Metal, Upbeat Drums",
    "vocalGender": "m",
    "styleWeight": 0.65,
    "weirdnessConstraint": 0.65,
    "audioWeight": 0.65,
    "variety": 1,
    "personaId": "persona_123",
    "personaModel": "style_persona",
    "duration": 20
}'
Response Response Example
{
    "code": 200,
    "msg": "success",
    "data": {
        "taskId": "5c79****be8e"
    }
}
Previous
Replace Music Section Callbacks
Next
Extend Music
Built with