MusicAPI
HomeDocs
HomeDocs
  1. Docs
  • Introduction
  • Credits Usage Guide
  • Music API FAQ & Troubleshooting
  • Special Scenarios
  • Error handling
  • Webhook Integration Guide
  • sonic
    • Sonic Instructions
    • create / extend / cover music
      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
    • concat music
      POST
    • stems basic
      POST
    • stems full
      POST
    • upload music
      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
    • download
    • 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
    • 记录不存在
    • 参数不正确
HomeDocs
HomeDocs
  1. Docs

Introduction

Introduction#

Welcome to MusicAPI - the unified API platform for AI music generation. Create professional-quality music with simple API calls.

What is MusicAPI?#

MusicAPI provides a single, unified interface to access multiple AI music generation models. Whether you need vocal songs, instrumental tracks, or audio processing tools, MusicAPI has you covered.

Key Benefits#

FeatureDescription
Multiple ModelsAccess Sonic, Producer, and Nuro models through one API
No WatermarksAll generated audio is watermark-free and ready for commercial use
Full FeaturesCreate, extend, cover, remix, stem separation, and more
MultilingualGenerate songs in multiple languages
Simple IntegrationRESTful API with straightforward authentication

Sonic Model Versions#

VersionDescription
sonic-v3-5Legacy model
sonic-v4Improved audio quality
sonic-v4-5Enhanced vocals, supports vocal gender control
sonic-v4-5-plusPremium quality
sonic-v5Latest model with best quality

Quick Start#

1. Get Your API Key#

1.
Sign up at musicapi.ai
2.
Subscribe to a plan
3.
Go to Dashboard → API Keys
4.
Copy your API key

2. Make Your First Request#

3. Poll for Results#

Poll every 15-25 seconds until state is succeeded.

Generation Modes#

Custom Mode (custom_mode: true)#

Full control over your music:
Write your own lyrics with structure tags ([Verse], [Chorus], etc.)
Specify exact style tags
Set title and other parameters
{
  "custom_mode": true,
  "mv": "sonic-v4-5",
  "title": "My Song",
  "tags": "pop, rock",
  "prompt": "[Verse]\nYour lyrics here..."
}

AI Description Mode (custom_mode: false)#

Let AI handle the creativity:
Describe what you want in natural language
AI generates lyrics and composition
{
  "custom_mode": false,
  "mv": "sonic-v4-5",
  "title": "Summer Vibes",
  "tags": "pop, summer",
  "gpt_description_prompt": "An upbeat summer song about beach parties and good times"
}

Credits System#

MusicAPI uses a credit-based system. Each operation costs a specific number of credits:
OperationCredits
Create music15
Extend music15
Cover music15
Concat music2
Upload + Extend15
Upload + Cover15
Create persona1
Get BPM1
Get VOX1
Upsample tags1
Stems (basic)15
Stems (full)75
Check your remaining credits:

Authentication#

All API requests require Bearer token authentication.

Important Notes#

HTTPS Required: All requests must use HTTPS. HTTP requests will fail.
Keep Secret: Never expose your API key in client-side code or public repositories.
One Key Per Project: We recommend using separate API keys for different projects.

Rate Limits#

PlanRate Limit
Standard1 request per 3 seconds
Custom/EnterpriseHigher concurrency available
If you need higher rate limits, contact us for custom plans.

Core Endpoints#

Sonic API#

EndpointMethodDescription
/api/v1/sonic/createPOSTCreate, extend, cover, or concat music
/api/v1/sonic/task/{task_id}GETPoll task results
/api/v1/sonic/uploadPOSTUpload audio file
/api/v1/sonic/upload-extendPOSTUpload and extend in one request
/api/v1/sonic/upload-coverPOSTUpload and cover in one request
/api/v1/sonic/personaPOSTCreate virtual singer
/api/v1/sonic/lyricsPOSTGenerate lyrics
/api/v1/sonic/bpmPOSTGet BPM information
/api/v1/sonic/voxPOSTExtract vocals
/api/v1/sonic/upsample-tagsPOSTEnhance style tags
/api/v1/sonic/stems/basicPOSTBasic stem separation
/api/v1/sonic/stems/fullPOSTFull stem separation
/api/v1/sonic/wavPOSTGet WAV format
/api/v1/sonic/midiPOSTGet MIDI data
/api/v1/sonic/aligned-lyricsPOSTGet lyrics timeline

Other Models#

ModelCreate EndpointTask Endpoint
Producer/api/v1/producer/create/api/v1/producer/task/{task_id}
Nuro/api/v1/nuro/create/api/v1/nuro/task/{task_id}

Response Format#

All successful responses follow this format:
{
  "code": 200,
  "message": "success",
  "task_id": "uuid-string",
  "data": { ... }
}

Task States#

StateDescription
pendingTask is queued
runningTask is processing
succeededTask completed successfully
failedTask failed

Error Handling#

HTTP CodeTypeDescription
400validation_errorInvalid parameters
401unauthorizedInvalid or missing API key
403forbiddenInsufficient credits
404not_foundResource not found
429rate_limitToo many requests
500server_errorInternal server error
Example error response:
{
  "type": "validation_error",
  "error": "The 'mv' field is invalid. The model should be 'sonic-v3-5', 'sonic-v4', 'sonic-v4-5', 'sonic-v4-5-plus', or 'sonic-v5'."
}

Webhooks#

Instead of polling, receive notifications when tasks complete:
{
  "webhook_url": "https://your-server.com/webhook",
  "webhook_secret": "your-secret-for-verification"
}

SDKs & Libraries#

Official and community SDKs:
LanguageRepository
PythonComing soon
Node.jsComing soon
GoComing soon

Support#

Documentation: docs.musicapi.ai
Telegram: Join our channel for updates, examples, and support
Email: Contact us for enterprise inquiries:support@musicapi.ai

Next Steps#

1.
Get your API key
2.
Read the Sonic API instructions
3.
Try creating your first song
4.
Explore all endpoints
Modified at 2026-01-24 13:28:07
Next
Credits Usage Guide
Built with