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#
| Field | Type | Required | Description |
|---|
task_type | string | Required | Must be create_music. Other values are retired (HTTP 410). |
sound | string | One of sound or lyrics | Free-form description of the music style, mood, instruments. |
lyrics | string | One of sound or lyrics | Lyrics in plain text. Use [Verse], [Chorus], etc. as section markers. |
mv | string | Optional | Model version. Default FUZZ-2.0. See full list in the overview page. |
title | string | Optional | ≤ 80 chars. |
seed | string | Optional | Numeric seed for reproducibility. |
make_instrumental | boolean | Optional | If true, vocals are suppressed even when lyrics is provided. Default false. |
webhook_url | string | Optional | HTTPS URL ≤ 1024 chars to receive task completion. |
webhook_secret | string | Optional | Shared 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#
| Field | Type | Required | Description |
|---|
prompt | string | Required | ≤ 3000 chars. Plain-English description of the song theme. |
webhook_url | string | Optional | HTTPS URL ≤ 1024 chars. |
webhook_secret | string | Optional | HMAC-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#
| Field | Type | Required | Description |
|---|
clip_id | string | Required | The clip_id of an existing music clip on this account. |
preset | string | Optional | One of simple, modern, player. Default simple. |
webhook_url | string | Optional | HTTPS URL ≤ 1024 chars. |
webhook_secret | string | Optional | HMAC-SHA256 signing secret. |
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#
| Field | Type | Required | Description |
|---|
audio_url | string | Required | Publicly reachable audio URL (mp3/m4a/wav). |
webhook_url | string | Optional | HTTPS URL. |
webhook_secret | string | Optional | HMAC-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#
| Field | Type | Required | Description |
|---|
clip_id | string | Required | A clip owned by this account. |
format | string | Required | mp3 or wav. |
webhook_url | string | Optional | HTTPS URL. |
webhook_secret | string | Optional | HMAC-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#
| HTTP | type | Example body |
|---|
| 400 | validation_error | {"type":"validation_error","error":"The 'mv' field is invalid. Allowed models: FUZZ-3-Demo, ..."} |
| 401 | unauthorized | {"type":"unauthorized","error":"Authorization header is missing"} |
| 402 | insufficient_credits | {"type":"insufficient_credits","error":"Insufficient credits. Please purchase additional credits or subscribe to continue.","remaining_credits":3} |
| 410 | endpoint_retired | See section 7. |
| 429 | rate_limited | {"type":"rate_limited","error":"Too many concurrent tasks. Retry after a short wait."} |
| 500 | internal_error | {"type":"internal_error","error":"Internal Server Error"} |
| 502 | upstream_error | {"type":"upstream_error","error":"Generation provider is temporarily unavailable. Please retry."} |
Support#
Modified at 2026-04-27 16:55:15