Generate a complete song from a short audio sample or hummed melody. This endpoint uses a clip segment as inspiration to create a full-length track.Credits cost: 15 (older models) / 20 (newer models) — older = sonic-v3-5, sonic-v4; newer = sonic-v4-5, sonic-v4-5-plus, sonic-v5, sonic-v5-5.
Request
Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Body Params application/json
Examples
{"sample_clip_id":"abc123-def456-sample","chop_sample_start_s":0,"chop_sample_end_s":30,"custom_mode":true,"mv":"chirp-v4-5-plus","make_instrumental":false,"prompt":"[Verse 1]\nInspired by this melody\nCreating something beautiful\n\n[Chorus]\nFrom a simple hum\nA full song has come","title":"Melody Dreams","tags":"pop, melodic, uplifting","style_weight":0.7}
Request Code Samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
cURL
curl--location'https://api.musicapi.ai/api/v1/sonic/sample' \
--header'Authorization: Bearer <token>' \
--header'Content-Type: application/json' \
--data'{
"sample_clip_id": "abc123-def456-sample",
"chop_sample_start_s": 0,
"chop_sample_end_s": 30,
"custom_mode": true,
"mv": "chirp-v4-5-plus",
"make_instrumental": false,
"prompt": "[Verse 1]\nInspired by this melody\nCreating something beautiful\n\n[Chorus]\nFrom a simple hum\nA full song has come",
"title": "Melody Dreams",
"tags": "pop, melodic, uplifting",
"style_weight": 0.7
}'