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
| Name | Type | Details |
|---|---|---|
prompt | string | A description of the music you want to generate. |
reference_audios | array 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_seconds | number | Duration of the generated audio in seconds. Default: |
seed | number | Seed for random number generator. If None or -1, a random seed will be used. |
guidance | number | Increases the influence of inputs on the output. Higher values produce lower-varience outputs that adhere more closely to inputs. Default: |
output_format | string | Default: One of: wav, mp3 |
continuation | boolean | If `True`, generated music will continue from `input_audio`. Otherwise, generated music will mimic `input_audio`'s melody. Default: |
continuation_end | number | 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_start | number | Start time of the audio file to use for continuation. Default: Min 0 |
model_version | string | Default: One of: stereo-melody-large, stereo-large, melody-large, large |
multi_band_diffusion | boolean | If `True`, the EnCodec tokens will be decoded with MultiBand Diffusion. Only works with non-stereo models. Default: |
normalization_strategy | string | Default: One of: loudness, clip, peak, rms |
temperature | number | Controls the 'conservativeness' of the sampling process. Higher temperature means more diversity. Default: |
top_k | number | Reduces sampling to the k most likely tokens. Default: |
top_p | number | Reduces sampling to tokens with cumulative probability of p. When set to `0` (default), top_k sampling is used. Default: |