AI Music API
HomeGet API key
HomeGet API key
  1. sonic
  • Introduction
  • Credits Usage Guide
  • AI Music API FAQ & Troubleshooting
  • Special Scenarios
  • Error handling
  • Webhook Integration Guide
  • sonic
    • Sonic Instructions
    • download (mp3 / m4a / wav)
      POST
    • 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
    • remaster
      POST
    • replace section
      POST
    • add vocal
      POST
    • add instrumental
      POST
    • upload music
      POST
    • create voice
      POST
    • get music
      GET
  • riffusion(Deprecated)
    • Riffusion instructions
    • create music (with lyrics)
    • create music (with description)
    • cover music
    • extend music
    • replace music section
    • swap music sound
    • swap music vocals
    • upload
    • get music
  • producer
    • Producer Instructions
    • Complete Request Example
    • create music
    • upload
    • download
    • get task / poll result
  • nuro
    • Nuro Instruction
    • Error handling
    • create vocal music
    • create instrument music
    • get music
  • lyrics generation
    • Make Lyrics
  • get-credits
    GET
  1. sonic

get music

GET
https://api.aimusicapi.ai/api/v1/sonic/task/{task_id}
Use the obtained task ID to poll song data. Recommended polling interval: 15s-25s.

Supported Task Types#

Task TypeDescriptionResponse Format
create_musicStandard music creationArray of songs
extend_musicExtend existing songArray of songs
cover_musicCreate cover versionArray of songs
upload-extendUpload + ExtendArray of songs, or paired objects if auto_concat
upload-coverUpload + CoverArray of songs
concat_musicConcatenate songsArray of songs

Response Format#

Standard tasks: data is an array of song objects
Tasks with auto_concat: true: data is an array of paired objects [{extended, full}, ...]
For detailed auto_concat response examples, see:
upload-extend-music
upload-cover-music

State Values#

pending - Task queued
running - Processing
succeeded - Completed successfully
failed - Task failed

Early playback while a song is still rendering#

While a clip is still being generated the response is HTTP 202 with
message: "streaming". Clips in that state carry a live stream you can play
immediately, under its own field:
FieldMeaning
stream_audio_urlPlayable live stream, available before the song finishes. Also emitted as streamAudioUrl.
audio_urlnull until a final file exists. Never holds the stream.
staterunning for any clip without a final file — never succeeded.
Example of a clip in that state:
{
  "code": 200,
  "message": "streaming",
  "data": [
    {
      "clip_id": "238b157e-ab69-4b93-938f-c468be8934f9",
      "state": "running",
      "audio_url": null,
      "stream_audio_url": "https://audiopipe.suno.ai/?item_id=238b157e-..."
    }
  ]
}
Notes:
Keep polling. The stream is a preview, not the deliverable. audio_url
is populated once the final file exists and the clip reaches succeeded.
state is never succeeded while audio_url is null, so a client that
stops polling on succeeded can never walk away without audio.
The stream URL is transient and stops serving once rendering completes. Do
not store it; store audio_url.
This field is optional to use. Clients that ignore it are unaffected.

Request

Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Path Params

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 'https://api.aimusicapi.ai/api/v1/sonic/task/' \
--header 'Authorization: Bearer <token>'

Responses

🟢200OK
application/json
Success
Bodyapplication/json

Example
{
    "code": 200,
    "data": [
        {
            "clip_id": "26c9c592-0566-46cf-bb71-91ac1deaa7b5",
            "state": "succeeded",
            "title": "Starry Night",
            "tags": "pop",
            "lyrics": "[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",
            "image_url": "https://cdn2.suno.ai/image_26c9c592-0566-46cf-bb71-91ac1deaa7b5.jpeg",
            "audio_url": "https://cdn1.suno.ai/26c9c592-0566-46cf-bb71-91ac1deaa7b5.mp3",
            "video_url": "https://cdn1.suno.ai/26c9c592-0566-46cf-bb71-91ac1deaa7b5.mp4",
            "created_at": "2024-11-27T10:26:46.552Z",
            "mv": "sonic-v4-5",
            "gpt_description_prompt": null,
            "duration": 179
        },
        {
            "clip_id": "626f2fb1-b1cb-43e3-aabd-7ef64e1ab6b0",
            "state": "succeeded",
            "title": "Starry Night",
            "tags": "pop",
            "lyrics": "[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",
            "image_url": "https://cdn2.suno.ai/image_626f2fb1-b1cb-43e3-aabd-7ef64e1ab6b0.jpeg",
            "audio_url": "https://cdn1.suno.ai/626f2fb1-b1cb-43e3-aabd-7ef64e1ab6b0.mp3",
            "video_url": "https://cdn1.suno.ai/626f2fb1-b1cb-43e3-aabd-7ef64e1ab6b0.mp4",
            "created_at": "2024-11-27T10:26:46.552Z",
            "mv": "sonic-v4-5",
            "gpt_description_prompt": null,
            "duration": 208
        }
    ],
    "message": "success"
}
Modified at 2026-09-04 07:10:47
Previous
create voice
Next
Riffusion instructions
Built with