Meta's MusicGen via Replicate. Generates music from a text prompt or a reference melody (stereo / melody / large variants), can continue an input clip, and outputs MP3 or WAV. Billed per second of requested duration.
Test this model instantly in the Console Playground — no code required
Copy usage instructions for Claude, ChatGPT, or other AI
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: cdt_your_api_key" \
-d '{
"model": "meta/musicgen",
"input": {
"prompt": "Upbeat K-pop electro-pop company jingle instrumental, 128 BPM, synth brass stabs, punchy drums, bright synth lead, catchy hook, fun and playful",
"model_version": "stereo-melody-large",
"duration": 30,
"output_format": "mp3"
}
}'| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | Yes | - | A description of the music you want to generate |
model_version | string | No | stereo-melody-large | Model variant. stereo-* produce stereo; melody-* accept input_audio as a melody reference stereo-melody-largestereo-largemelody-largelarge |
duration | integer | No | 8 | Duration of the generated audio in seconds (1-30). Billed per second |
input_audio | string | No | - | Audio file that influences the output: continued when continuation is true, otherwise its melody is mimicked (melody models) |
continuation | boolean | No | false | If true, generated music continues from input_audio |
continuation_start | integer | No | 0 | Start time (s) of input_audio for continuation |
continuation_end | integer | No | - | End time (s) of input_audio for continuation. Omit for the end of the clip |
multi_band_diffusion | boolean | No | false | Decode EnCodec tokens with MultiBand Diffusion (non-stereo models only) |
normalization_strategy | string | No | loudness | Strategy for normalizing audio loudnessclippeakrms |
top_k | integer | No | 250 | Reduces sampling to the k most likely tokens |
top_p | number | No | 0 | Nucleus sampling probability. 0 uses top_k sampling |
temperature | number | No | 1 | Sampling temperature. Higher means more diversity |
classifier_free_guidance | integer | No | 3 | Influence of inputs on the output. Higher adheres more to the prompt |
output_format | string | No | wav | Output format for generated audio wavmp3 |
seed | integer | No | - | Seed for the random number generator. Omit or -1 for random |
There are 3 ways to provide files for the input_audio parameter:
Pass a publicly accessible URL directly. With the Storage API (POST /v1/files/upload-url) the file uploads straight to S3 (50MB per file) and you pass the returned file_url.
{
"model": "meta/musicgen",
"input": {
"prompt": "your prompt here",
"input_audio": "https://example.com/image.jpg"
}
}Attach files directly to POST /v1/predictions/upload. No separate upload step, but the bytes pass through the API server so the whole request is capped at 10MB.
curl -X POST "https://api.core.today/v1/predictions/upload" \
-H "X-API-Key: cdt_your_api_key" \
-F "model=meta/musicgen" \
-F 'input={"prompt":"your prompt here"}' \
-F "file:input_audio=@your_file.png"Common parameters used when calling POST /v1/predictions.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | - | Model identifier |
input | object | Yes | - | Object containing the model-specific parameters from the table above |
output_folder | string | No | - | Folder path for output files (max 256 chars, '..' not allowed) |
webhook_url | string | No | - | Webhook URL to call on completion |
is_public | boolean | No | false | If true, output files are also available via permanent public URLs |
The same company-theme prompt given to every instrumental model — compare the results side by side
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: cdt_your_api_key" \
-d '{
"model": "meta/musicgen",
"input": {
"prompt": "Upbeat K-pop electro-pop company jingle instrumental, 128 BPM, synth brass stabs, punchy drums, bright synth lead, catchy hook, fun and playful",
"model_version": "stereo-melody-large",
"duration": 30,
"output_format": "mp3"
}
}'Default duration with the stereo-large variant and MP3 output
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: cdt_your_api_key" \
-d '{
"model": "meta/musicgen",
"input": {
"prompt": "Triumphant cinematic orchestral melody in G major leading to a crescendo",
"model_version": "stereo-large",
"duration": 8,
"output_format": "mp3"
}
}'Maximum duration with the mono large variant — about 270 credits
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: cdt_your_api_key" \
-d '{
"model": "meta/musicgen",
"input": {
"prompt": "Acoustic guitar folk melody, gentle and warm",
"model_version": "large",
"duration": 30,
"output_format": "mp3"
}
}'POST /v1/predictions