MusicAPI
HomeDocs
HomeDocs
  1. sonic
  • Introduction
  • Credits Usage Guide
  • Music API FAQ & Troubleshooting
  • Special Scenarios
  • Error handling
  • Webhook Integration Guide
  • sonic
    • Sonic Instructions
    • create / extend / cover / remaster / add vocals / add instrumental
      POST
    • upload and extend music
      POST
    • upload and cover music
      POST
    • create persona
      POST
    • sample
      POST
    • mashup
      POST
    • get BPM
      POST
    • get VOX
      POST
    • get wav
      POST
    • get midi
      POST
    • get lyrics timeline
      POST
    • upsample tags
      POST
    • stems basic
      POST
    • stems full
      POST
    • replace section
      POST
    • upload music
      POST
    • create voice
      POST
    • get music
      GET
  • riffusion(Deprecated)
    • Riffusion instructions
    • create music (with lyrics)
      POST
    • create music (with description)
      POST
    • cover music
      POST
    • extend music
      POST
    • replace music section
      POST
    • swap music sound
      POST
    • swap music vocals
      POST
    • upload
      POST
    • get music
      GET
  • producer
    • Producer instructions
    • Complete Request Examples
    • create music
    • upload(Unavailable)
    • download(Unavailable)
    • get music
  • studio(Unavailable)
    • Studio Instructions
    • description mode (Use case1)
    • extend mode (Use case2)
    • custom mode (Use case3)
    • instrumental mode (Use case4)
    • get music
  • lyrics generation
    • Make Lyrics
  • nuro
    • Nuro Instruction
    • Error handling
    • create vocal music
    • create instrument music
    • get music
  • get-credits
    GET
  • Schemas
    • 记录不存在
    • 参数不正确
  1. sonic

create voice

POST
https://api.musicapi.ai/api/v1/sonic/create-voice
Create a custom voice persona from an audio file containing clear vocals. This is an async endpoint — submit the audio URL, receive a task_id, then poll for the result.
Credits cost: 4
Workflow:
1.
Submit a publicly accessible audio URL (MP3 or WAV, >10s, single clear speaker)
2.
Receive a task_id in the response
3.
Poll GET /api/v1/sonic/task/{task_id} until the task completes
4.
The completed task returns a persona_id
5.
Use the persona_id with POST /api/v1/sonic/create (task_type: persona_music) to generate music with that voice

Polling Result
Use GET /api/v1/sonic/task/{task_id} to poll the result.
{
  "code": 200,
  "data": {
    "persona_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "name": "Voice Name"
  },
  "message": "success"
}

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

Example
{
  "audio_url": "https://example.com/my-vocal-recording.mp3",
  "webhook_url": "https://myapp.com/api/voice-callback",
  "webhook_secret": "my-secret-key"
}

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 --location --request POST 'https://api.musicapi.ai/api/v1/sonic/create-voice' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "audio_url": "https://example.com/my-vocal-recording.mp3",
  "webhook_url": "https://myapp.com/api/voice-callback",
  "webhook_secret": "my-secret-key"
}'

Responses

🟢200OK
application/json
Body

Example
{
    "code": "string",
    "message": "string",
    "task_id": "string"
}
Modified at 2026-03-31 16:24:15
Previous
upload music
Next
get music
Built with