Unified endpoint for creating, extending, and covering music. The operation is determined by the task_type parameter.Credits cost: 15 (older models) / 20 (newer models) per generation call. Older = sonic-v3-5, sonic-v4; newer = sonic-v4-5, sonic-v4-5-plus, sonic-v5, sonic-v5-5. Extend-type task types (extend_music) stay at 15 on every model, and concat_music costs 2.
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
{"task_type":"create_music","custom_mode":true,"mv":"sonic-v4-5","prompt":"[Verse]\nStars they shine above me\nMoonlight softly glows\nWhispers in the night sky\nDreams that only grow\n\n[Chorus]\nStarry night starry night\nLet your light ignite ignite","title":"Starry Night","tags":"pop, dreamy, emotional"}
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/create' \
--header'Authorization: Bearer <token>' \
--header'Content-Type: application/json' \
--data'{
"task_type": "create_music",
"custom_mode": true,
"mv": "sonic-v4-5",
"prompt": "[Verse]\nStars they shine above me\nMoonlight softly glows\nWhispers in the night sky\nDreams that only grow\n\n[Chorus]\nStarry night starry night\nLet your light ignite ignite",
"title": "Starry Night",
"tags": "pop, dreamy, emotional"
}'