Extend Song APIContinue & Lengthen AI Music
Turn a finished AI clip into a longer track with one REST call. Pass a source clip, continue the same musical idea, poll for the result, and download — with API keys, free trial credits, pricing, webhooks, and production-ready docs.
What is the Extend Song API?
Instead of generating from a text prompt, extend continues an existing clip — keeping the same melody, instrumentation, and vibe while making the song longer. It runs through the generation endpoint with a task_type of extend_music, so it inherits the same auth, polling, and download flow you already use.
- Continue Any Clip
Pass a
continue_clip_idfrom a prior generation and the API lengthens it into a seamless, longer track.- One REST Endpoint
Same
/sonic/createendpoint, same bearer auth — just set the task type. Easy to add to an existing integration.- Chain Extensions
Each extension returns a new clip id — feed it back in to keep building longer arrangements.
API Examples
Extend a clip, then poll the task until the longer track is ready.
1curl -X POST 'https://api.musicapi.ai/api/v1/sonic/create' \
2--header 'Authorization: Bearer YOUR_API_KEY' \
3--header 'Content-Type: application/json' \
4--data '{
5 "task_type": "extend_music",
6 "continue_clip_id": "YOUR_CLIP_ID",
7 "mv": "sonic-v5"
8}'Why Build Extension on MusicAPI?
Async + Fast
Returns a task id instantly; tracks finish in 1-3 min.
Seamless Continuity
Keeps the original melody, key, and instrumentation.
Auto-Refunds
Failed upstream tasks are refunded; polling is free.
One Integration
Same endpoint as create, cover, and stems.
Extend Song API: Pricing, Free Access & API Keys
Developers integrating song extension usually want three answers: how to test for free, how to get an API key, and how cost scales after the prototype works.
Free trial
Use free credits to test extend, polling, and downloads before choosing a paid plan.
Pricing
Credit-based, same as generation. Estimate per-extension cost on the pricing page.
API keys
Generate a bearer token in your account, keep it server-side, and call the extend endpoint.
Ready to Extend Your AI Music?
Add longer tracks to your app with a single endpoint. Start free, then scale with predictable credit pricing.
Frequently Asked Questions
Everything you need to know about extending songs with the API.
What is an extend song API?
An extend song API takes a finished AI music clip and continues it into a longer track instead of starting from a text prompt. With MusicAPI you call the generation endpoint with task_type 'extend_music' and the source clip id, then poll the task for the lengthened result.
How do I extend an existing AI song with the API?
POST to https://api.musicapi.ai/api/v1/sonic/create with task_type 'extend_music', a continue_clip_id from a prior generation, and the model version (mv). The call returns a task_id; poll GET /api/v1/sonic/task/{id} until the extended track is ready, then download the audio.
Do I need to generate the original song with MusicAPI first?
Yes — extend continues an existing clip, so you pass the continue_clip_id returned by a prior create or generation call. The original and the extension share the same musical idea, so the result feels like one continuous song.
How much does extending a song cost?
Extend runs on the same credit-based pricing as generation. You can test with free trial credits, estimate per-task cost on the pricing page, and upgrade as volume grows. Failed upstream tasks are auto-refunded and polling task status is free.
Is extension synchronous or asynchronous?
Asynchronous. The create call returns a task_id immediately and the extended track is produced in the background, typically within 1-3 minutes. Use polling on the task endpoint or webhooks to detect completion.
Can I extend a song multiple times?
Yes. Each extension returns a new clip id, so you can chain extensions — feed the new clip id back in as the continue_clip_id to keep lengthening the track.
Do extended songs include commercial rights?
Yes, audio generated through the API comes with commercial rights included. You own the generated content and can use it for commercial purposes.