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,
    provider: {
      order: ['<string>'],
      only: ['<string>'],
      ignore: ['<string>'],
      include_alpha: true,
      allow_fallbacks: true,
      require_parameters: true,
      required_execution_region: '<string>',
      required_data_region: '<string>',
      require_zero_data_retention: true,
      zdr: true,
      enforce_distillable_text: true,
      quantizations: ['<string>'],
      sort: '<string>',
      max_price: {prompt: 123, completion: 123, image: 123, audio: 123, request: 123},
      preferred_min_throughput: 123,
      preferred_max_latency: 123
    },
    suno: {
      prompt: '<string>',
      style: '<string>',
      title: '<string>',
      customMode: true,
      instrumental: true,
      personaId: '<string>',
      model: '<string>',
      negativeTags: '<string>',
      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
    }
  })
};

fetch('https://api.phaseo.app/v1/music/generate', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{}

Documentation Index

Fetch the complete documentation index at: https://docs.ai-stats.phaseo.app/llms.txt

Use this file to discover all available pages before exploring further.

Creates an asynchronous music generation job.
The public music routes are currently mounted but temporarily disabled, so requests currently return 501 not_implemented.
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 May 19, 2026