Skip to main content
POST
/
music
/
generate
Generate music
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    model: '<string>',
    prompt: '<string>',
    duration: 123,
    format: 'mp3',
    provider: {
      order: ['<string>'],
      only: ['<string>'],
      ignore: ['<string>'],
      include_alpha: true
    },
    suno: {
      prompt: '<string>',
      style: '<string>',
      title: '<string>',
      customMode: true,
      instrumental: true,
      personaId: '<string>',
      model: '<string>',
      negativeTags: '<string>',
      vocalGender: 'm',
      styleWeight: 0.5,
      weirdnessConstraint: 0.5,
      audioWeight: 0.5,
      callBackUrl: '<string>'
    },
    elevenlabs: {
      prompt: '<string>',
      composition_plan: {},
      music_length_ms: 123,
      model_id: '<string>',
      force_instrumental: true,
      store_for_inpainting: true,
      with_timestamps: true,
      sign_with_c2pa: true,
      output_format: '<string>'
    },
    echo_upstream_request: true,
    debug: {
      enabled: true,
      return_upstream_request: true,
      return_upstream_response: true,
      trace: true,
      trace_level: 'summary'
    }
  })
};

fetch('https://api.phaseo.app/v1/music/generate', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{}
Creates an asynchronous music generation job. Poll completion with GET /music/generate/{music_id}.

Request Shape

{
  "model": "suno/v4.5plus",
  "prompt": "Warm jazz trio with brushed drums",
  "duration": 8,
  "provider": { "only": ["suno"] },
  "suno": {
    "customMode": false,
    "instrumental": false
  }
}

Suno Options

  • suno.customMode (boolean, default false)
  • suno.instrumental (boolean, default false)
  • suno.prompt (optional override for top-level prompt)
  • suno.style, suno.title (required when customMode = true)
  • suno.personaId, suno.personaModel
  • suno.negativeTags, suno.vocalGender
  • suno.styleWeight, suno.weirdnessConstraint, suno.audioWeight

Validation Rules

  • When customMode = false, prompt is required.
  • When customMode = true, both style and title are required.
  • When customMode = true and instrumental = false, prompt is required.
Validation errors return 400 with:
{
  "error": "validation_error",
  "reason": "..."
}

Response

{
  "id": "task_123",
  "object": "music",
  "status": "in_progress",
  "provider": "suno",
  "model": "V4_5PLUS",
  "nativeResponseId": "task_123",
  "usage": {
    "requests": 1
  }
}
usage can include output_audio_seconds when duration is provided and pricing is computed against seconds.

Authorizations

Authorization
string
header
required

Bearer token authentication

Body

application/json
model
string
required
prompt
string
duration
integer
format
enum<string>
Available options:
mp3,
wav,
ogg,
aac
provider
object

Provider routing preferences for gateway selection.

suno
object
elevenlabs
object
echo_upstream_request
boolean
debug
object

Gateway debug controls. These flags are never forwarded upstream.

Response

200 - application/json

Music generation response

The response is of type object.

Last modified on February 25, 2026