Skip to main content
POST
Create a music job

Authorizations

Authorization
string
header
required

Your Deepshi API key, sent as Authorization: Bearer <key>.

Body

application/json

Music generation request. model and prompt are required; lyrics_prompt is required by some models. The remaining fields are optional, model-specific options; call GET /v1/models for the parameters each model accepts. Additional parameters not listed here may also be sent and are forwarded to the model.

model
string
required

The music model id. See GET /v1/models.

Example:

"minimax-music-v2"

prompt
string
required

The music style: genre, mood, instruments, tempo. Up to the model's prompt_max_length.

Example:

"a warm lofi hip hop beat with mellow piano and vinyl crackle"

lyrics_prompt
string

The lyrics to sing, with [Verse] / [Chorus] structure tags on their own lines (separate lines with \n). 10 to 3000 characters. Required by some models.

Example:

"[Verse]\ncity lights fade slow\nin the quiet night we go\n[Chorus]\nhold on to the glow"

is_instrumental
boolean

Generate a vocal-free track, where supported.

music_length_ms
integer

Output length in milliseconds, where the model supports duration control.

seconds_total
integer

Output length in seconds, where the model supports duration control.

duration
integer

Output length in seconds, where the model supports duration control.

sample_rate
integer

Output sample rate in Hz; one of the model's allowed values, where supported.

Example:

44100

bitrate
integer

Output bitrate in bits per second; one of the model's allowed values, where supported.

Example:

256000

format
string

Output container, where supported.

Example:

"mp3"

Response

The created music job.

A music generation job.

id
string

The job id. Pass it to the retrieve and content endpoints.

object
string

Object type, always audio.

Example:

"audio"

model
string

The music model id you requested.

status
enum<string>

Lifecycle state of the job.

Available options:
in_progress,
completed,
failed
seconds
string

Length of the generated track in seconds, present when status is completed.

created_at
integer<int64>

Unix timestamp when the job was created.

completed_at
integer<int64> | null

Unix timestamp when the job completed.

audio
object[]

The generated song, present when status is completed.

error
object | null

Present when status is failed. Explains the failure; the job is not charged.