AI Music API
Home
Home
  1. producer
  • Introduction
  • Credits Usage Guide
  • AI 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(Unavailable)
      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
      POST
    • upload
      POST
    • download
      POST
    • get task / poll result
      GET
  • nuro
    • Nuro Instruction
    • Error handling
    • create vocal music
    • create instrument music
    • get music
  • lyrics generation
    • Make Lyrics
  • get-credits
    GET
  • Schemas
    • 记录不存在
    • ExtendMusicRequest
    • ReplaceMusicRequest
    • 参数不正确
    • CreateTaskAccepted
    • ErrorResponse
  1. producer

Complete Request Example

Producer API — Complete Request Examples#

End-to-end request and response examples for every Producer endpoint. All examples use the production base URL https://api.aimusicapi.ai. Replace <YOUR_API_KEY> with your actual API key.

1. Generate music — POST /api/v1/producer/create#

Cost: 10 credits per call.

1.1 Minimum request — sound prompt only#

{
  "message": "success",
  "task_id": "6d7253ac-916e-49a8-b288-91ffa7f8a8cd"
}
mv is optional — if omitted, FUZZ-2.0 is used.

1.2 Lyrics + sound prompt with title and seed#

1.3 Instrumental (skip vocals)#

1.4 With webhook callback#

1.5 Request body fields — /producer/create#

FieldTypeRequiredDescription
task_typestringRequiredMust be create_music. Other values are retired (HTTP 410).
soundstringOne of sound or lyricsFree-form description of the music style, mood, instruments.
lyricsstringOne of sound or lyricsLyrics in plain text. Use [Verse], [Chorus], etc. as section markers.
mvstringOptionalModel version. Default FUZZ-2.0. See full list in the overview page.
titlestringOptional≤ 80 chars.
seedstringOptionalNumeric seed for reproducibility.
make_instrumentalbooleanOptionalIf true, vocals are suppressed even when lyrics is provided. Default false.
webhook_urlstringOptionalHTTPS URL ≤ 1024 chars to receive task completion.
webhook_secretstringOptionalShared secret used to HMAC-SHA256 sign webhook payloads.

1.6 Polling response — create_music task#

{
  "code": 200,
  "status": "SUCCESS",
  "message": "success",
  "data": [
    {
      "clip_id": "ac78601b-bd05-48dd-b5c6-89195561de36",
      "title": "Back to You",
      "sound": null,
      "lyrics": "[Verse 1]\nLate night drives across the city\n...",
      "audio_url": "https://musicapi-cdn.b-cdn.net/producer/ac78601b-bd05-48dd-b5c6-89195561de36.m4a",
      "wav_url": "https://musicapi-cdn.b-cdn.net/producer/ac78601b-bd05-48dd-b5c6-89195561de36-wav.wav",
      "image_url": "https://musicapi-cdn.b-cdn.net/producer/ac78601b-bd05-48dd-b5c6-89195561de36-img.jpg",
      "video_url": null,
      "duration": 57.536,
      "mv": "FUZZ-2.0 Pro",
      "seed": "12345",
      "state": "succeeded",
      "created_at": "2026-04-27T14:00:53.030544Z"
    }
  ]
}
While the task is still running, status will be PENDING or RUNNING and data may be empty.

2. Generate lyrics — POST /api/v1/producer/lyrics-create#

Cost: 1 credit per call. Generates structured lyrics from a short prompt — useful for two-step flows (generate lyrics → review → call /create with the lyrics).

2.1 Request#

{
  "message": "success",
  "task_id": "f1a3c2d5-7e89-4b21-9a4f-0d6b3c8e1f12"
}

2.2 Request body fields#

FieldTypeRequiredDescription
promptstringRequired≤ 3000 chars. Plain-English description of the song theme.
webhook_urlstringOptionalHTTPS URL ≤ 1024 chars.
webhook_secretstringOptionalHMAC-SHA256 signing secret.

2.3 Polling response — make_lyrics task#

{
  "code": 200,
  "status": "SUCCESS",
  "message": "success",
  "data": [
    {
      "lyrics_id": "lyr_3f9b7a4d2c1e",
      "lyrics": "[Verse 1]\nGravel road and a fading sign\n...\n[Chorus]\nGoodbye small town, I'll write you a song\n...",
      "title": "Goodbye Small Town",
      "sound": "bittersweet folk-pop with acoustic guitar",
      "created_at": "2026-04-27T14:05:11.901234Z"
    }
  ]
}
You can pass the returned lyrics straight into POST /api/v1/producer/create as the lyrics field.

3. Generate music video — POST /api/v1/producer/video-clip#

Cost: 5 credits per call. Renders an MP4 music video for an existing music clip. The clip must already exist on this account (it must come from a prior create_music task).

3.1 Request#

{
  "message": "success",
  "task_id": "9329c1ad-c5b2-4d41-a3b6-842d7c2674b1"
}

3.2 Request body fields#

FieldTypeRequiredDescription
clip_idstringRequiredThe clip_id of an existing music clip on this account.
presetstringOptionalOne of simple, modern, player. Default simple.
webhook_urlstringOptionalHTTPS URL ≤ 1024 chars.
webhook_secretstringOptionalHMAC-SHA256 signing secret.
Preset behavior:
simple — minimal animated visualizer over the cover art.
modern — animated abstract visuals synced to the track's energy.
player — stylized "audio player" frame, suitable for social-media share clips.

3.3 Polling response — video_clip task#

{
  "code": 200,
  "status": "SUCCESS",
  "message": "success",
  "data": [
    {
      "clip_id": "ac78601b-bd05-48dd-b5c6-89195561de36",
      "title": "Back to You",
      "audio_url": "https://musicapi-cdn.b-cdn.net/producer/ac78601b-bd05-48dd-b5c6-89195561de36.m4a",
      "video_url": "https://musicapi-cdn.b-cdn.net/producer/ac78601b-bd05-48dd-b5c6-89195561de36-video.mp4",
      "image_url": "https://musicapi-cdn.b-cdn.net/producer/ac78601b-bd05-48dd-b5c6-89195561de36-img.jpg",
      "duration": 57.536,
      "state": "succeeded",
      "created_at": "2026-04-27T14:08:32.114002Z"
    }
  ]
}

4. Upload audio reference — POST /api/v1/producer/upload#

Cost: 2 credits per call. Registers an external public audio URL so it can be referenced by clip_id in subsequent operations.

4.1 Request#

{
  "message": "success",
  "task_id": "29906f02-2366-4218-b25a-41458e1d60e0"
}

4.2 Request body fields#

FieldTypeRequiredDescription
audio_urlstringRequiredPublicly reachable audio URL (mp3/m4a/wav).
webhook_urlstringOptionalHTTPS URL.
webhook_secretstringOptionalHMAC-SHA256 signing secret.

4.3 Polling response — upload task#

{
  "code": 200,
  "status": "SUCCESS",
  "message": "success",
  "data": [
    {
      "clip_id": "5f17a9b3-2c8d-4e7a-bd1e-3f0a9c2d1b4e",
      "audio_url": "https://musicapi-cdn.b-cdn.net/producer/5f17a9b3-2c8d-4e7a-bd1e-3f0a9c2d1b4e.m4a",
      "duration": 184.73,
      "state": "succeeded",
      "created_at": "2026-04-27T14:11:52.557123Z"
    }
  ]
}
The returned clip_id can now be passed to /video-clip.

5. Download / re-encode — POST /api/v1/producer/download#

Cost: 2 credits per call. Produces an mp3 or wav download of an existing clip.

5.1 Request#

{
  "message": "success",
  "task_id": "84a02e4c-1f7d-4a9b-bf30-12c6e8a3d7f1"
}

5.2 Request body fields#

FieldTypeRequiredDescription
clip_idstringRequiredA clip owned by this account.
formatstringRequiredmp3 or wav.
webhook_urlstringOptionalHTTPS URL.
webhook_secretstringOptionalHMAC-SHA256 signing secret.

5.3 Polling response — download task#

{
  "code": 200,
  "status": "SUCCESS",
  "message": "success",
  "data": [
    {
      "clip_id": "ac78601b-bd05-48dd-b5c6-89195561de36",
      "format": "wav",
      "audio_url": "https://musicapi-cdn.b-cdn.net/producer/ac78601b-bd05-48dd-b5c6-89195561de36-wav.wav",
      "state": "succeeded",
      "created_at": "2026-04-27T14:13:08.882910Z"
    }
  ]
}

6. Polling — GET /api/v1/producer/task/{task_id}#

The same poll endpoint is used regardless of which submit endpoint started the task. Continue polling while status is PENDING or RUNNING. Recommended polling cadence: every 5–10 seconds; tasks normally complete within 30–120 seconds.

6.1 Pending / running response#

{
  "code": 200,
  "status": "RUNNING",
  "message": "task is still processing",
  "data": []
}

6.2 Failed response (auto-refunded)#

{
  "code": 200,
  "status": "FAILED",
  "type": "failed",
  "message": "Task failed. Credits have been refunded.",
  "data": []
}
When status is FAILED, the credits charged at submit time have already been returned to your account. You can safely retry the task.

7. Retired endpoints — HTTP 410 Gone#

The following task_type values were available on a previous version of this API and are now permanently retired:
cover_music, cover_upload_music,
extend_music, extend_upload_music,
replace_music, replace_upload_music,
swap_music_vocals, swap_upload_music_vocals,
swap_music_sound, swap_upload_music_sound,
music_variation
Submitting any of these via POST /api/v1/producer/create returns:
No credits are deducted on a 410 response. The recommended replacement is to call create_music with a new prompt.

8. Error responses#

HTTPtypeExample body
400validation_error{"type":"validation_error","error":"The 'mv' field is invalid. Allowed models: FUZZ-3-Demo, ..."}
401unauthorized{"type":"unauthorized","error":"Authorization header is missing"}
402insufficient_credits{"type":"insufficient_credits","error":"Insufficient credits. Please purchase additional credits or subscribe to continue.","remaining_credits":3}
410endpoint_retiredSee section 7.
429rate_limited{"type":"rate_limited","error":"Too many concurrent tasks. Retry after a short wait."}
500internal_error{"type":"internal_error","error":"Internal Server Error"}
502upstream_error{"type":"upstream_error","error":"Generation provider is temporarily unavailable. Please retry."}

Support#

join our discord channel : https://discord.gg/UFT2J2XK7d
Modified at 2026-04-27 16:55:15
Previous
Producer Instructions
Next
create music
Built with