API docs / Audio models

musicgen API

Generate music from text prompts or audio inputs. Supports two model versions: Melody (1.5B parameters) for text and audio prompting, and Large (3.3B parameters) for text-only prompting. Can create music continuations from existing audio files or generate new compositions that mimic the melody of input audio. Offers multiple model variants including stereo-melody-large, stereo-large, melody-large, and large for different use cases and output formats.

Model id
meta/musicgen
Provider
meta
Output
Audio
Price
From 21 credits per run, the same as on voor.ai. Options such as length or resolution can change it.

Request

POST https://voor.ai/v1/generations with "model": "meta/musicgen". Poll GET /v1/tasks/{id} or receive the signed webhook. See the overview for keys, idempotency, webhooks and errors.

curl https://voor.ai/v1/generations \
  -H "Authorization: Bearer $VOOR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "model": "meta/musicgen",
  "input": {
    "prompt": "A red fox standing in fresh snow at golden hour, soft light"
  },
  "callback_url": "https://example.com/webhooks/voor"
}'

# Then poll the task (or wait for the webhook):
curl https://voor.ai/v1/tasks/TASK_ID \
  -H "Authorization: Bearer $VOOR_API_KEY"

Input parameters

NameTypeDetails
promptstring

A description of the music you want to generate.

reference_audiosarray of URLs

An audio file that will influence the generated music. If `continuation` is `True`, the generated music will be a continuation of the audio file. Otherwise, the generated music will mimic the audio file's melody.

Up to 1 files · Accepts audio/*

duration_secondsnumber

Duration of the generated audio in seconds.

Default: 8

seednumber

Seed for random number generator. If None or -1, a random seed will be used.

guidancenumber

Increases the influence of inputs on the output. Higher values produce lower-varience outputs that adhere more closely to inputs.

Default: 3

output_formatstring

Default: wav

One of: wav, mp3

continuationboolean

If `True`, generated music will continue from `input_audio`. Otherwise, generated music will mimic `input_audio`'s melody.

Default: false

continuation_endnumber

End time of the audio file to use for continuation. If -1 or None, will default to the end of the audio clip.

Min 0

continuation_startnumber

Start time of the audio file to use for continuation.

Default: 0

Min 0

model_versionstring

Default: stereo-melody-large

One of: stereo-melody-large, stereo-large, melody-large, large

multi_band_diffusionboolean

If `True`, the EnCodec tokens will be decoded with MultiBand Diffusion. Only works with non-stereo models.

Default: false

normalization_strategystring

Default: loudness

One of: loudness, clip, peak, rms

temperaturenumber

Controls the 'conservativeness' of the sampling process. Higher temperature means more diversity.

Default: 1

top_knumber

Reduces sampling to the k most likely tokens.

Default: 250

top_pnumber

Reduces sampling to tokens with cumulative probability of p. When set to `0` (default), top_k sampling is used.

Default: 0