Skip to main content
POST
Music Generation

Authorizations

Authorization
string
header
required

HTTP: Bearer Auth

Headers

Content-Type
enum<string>
default:application/json
required

The media type of the request body. Must be set to application/json to ensure the data is sent in JSON format.

Available options:
application/json

Body

application/json
model
enum<string>
required

The model name. Options:

  • music-3.0 (recommended): Text-to-music generation. Available to Token Plan and paid users only, with an RPM of 120.
  • music-2.6: Previous-generation text-to-music model. Available to Token Plan and paid users only, with an RPM of 120.
  • music-cover: Cover generation from a reference audio. Available to Token Plan and paid users only, with an RPM of 120.
  • music-3.0-free: Free-tier version of music-3.0. Available to all users via API Key, with an RPM of 3.
  • music-2.6-free: Free-tier version of music-2.6. Available to all users via API Key, with an RPM of 3.
  • music-cover-free: Free-tier version of music-cover. Available to all users via API Key, with an RPM of 3.
Available options:
music-3.0,
music-2.6,
music-cover,
music-3.0-free,
music-2.6-free,
music-cover-free
prompt
string

A description of the music, specifying style, mood, and scenario.

For example: "Pop, melancholic, perfect for a rainy night".
Note:

  • For music-3.0 / music-3.0-free / music-2.6 / music-2.6-free with is_instrumental: true: Required. Length: 1–2000 characters.
  • For music-3.0 / music-3.0-free / music-2.6 / music-2.6-free (non-instrumental): Optional. Length: 0–2000 characters.
  • For music-cover / music-cover-free: Required. Describes the target cover style. Length: 10–300 characters.
Maximum string length: 2000
lyrics
string

Song lyrics, using \n to separate lines. Supports structure tags: [Intro], [Verse], [Pre Chorus], [Chorus], [Interlude], [Bridge], [Outro], [Post Chorus], [Transition], [Break], [Hook], [Build Up], [Inst], [Solo].
Note:

  • For music-3.0 / music-3.0-free / music-2.6 / music-2.6-free with is_instrumental: true: Not required.
  • For music-3.0 / music-3.0-free / music-2.6 / music-2.6-free (non-instrumental): Required. Length: 1–3500 characters.
  • For music-cover / music-cover-free: Optional. If omitted, lyrics are automatically extracted from the reference audio via ASR. Length: 10–1000 characters.
  • When lyrics_optimizer: true and lyrics is empty, the system will auto-generate lyrics from prompt.
Required string length: 1 - 3500
stream
boolean
default:false

Whether to use streaming output.

output_format
enum<string>
default:hex

The output format of the audio. Options: url or hex.

When stream is true, only hex is supported.

⚠️ Note: url links expire after 24 hours, so download promptly.

Available options:
url,
hex
audio_setting
object

Audio output configuration

lyrics_optimizer
boolean
default:false

Whether to automatically generate lyrics based on the prompt description. Only supported on music-3.0 / music-3.0-free / music-2.6 / music-2.6-free.

When set to true and lyrics is empty, the system will automatically generate lyrics from the prompt. Default: false.

is_instrumental
boolean
default:false

Whether to generate instrumental music (no vocals). Only supported on music-3.0 / music-3.0-free / music-2.6 / music-2.6-free.

When set to true, the lyrics field is not required. Default: false.

audio_url
string

URL of the reference audio. Only used with music-cover / music-cover-free model. Exactly one of audio_url or audio_base64 must be provided. Mutually exclusive with cover_feature_id.

Reference audio constraints:

  • Duration: 6 seconds to 6 minutes
  • Size: max 50 MB
  • Format: common audio formats (mp3, wav, flac, etc.)
audio_base64
string

Base64-encoded reference audio. Only used with music-cover / music-cover-free model. Exactly one of audio_url or audio_base64 must be provided. Mutually exclusive with cover_feature_id.

Reference audio constraints:

  • Duration: 6 seconds to 6 minutes
  • Size: max 50 MB
  • Format: common audio formats (mp3, wav, flac, etc.)
cover_feature_id
string

Feature ID returned by the Music Cover Preprocess API. Used in the two-step cover workflow to generate a cover with modified lyrics.

Only used with music-cover / music-cover-free model. Mutually exclusive with audio_url and audio_base64.

  • When provided, lyrics is required (length: 10–1000 characters)
  • The cover_feature_id is valid for 24 hours
  • Same audio content returns the same cover_feature_id

Response

200 - application/json
data
object
base_resp
object

Status code and details