MusicAPI
HomeDocs
HomeDocs
  1. Docs
  • Introduction
  • Credits Usage Guide
  • Music API FAQ & Troubleshooting
  • Special Scenarios
  • Error handling
  • Webhook Integration Guide
  • Get Your Suno API Key
  • API Changelog
  • sonic
    • Sonic Instructions
    • create / extend / cover / remaster / add vocals / add instrumental
      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
    • stems basic
      POST
    • stems full
      POST
    • replace section
      POST
    • upload music
      POST
    • create voice
      POST
    • get music
      GET
    • download (mp3 / m4a / wav)
      POST
  • producer
    • Producer instructions
    • Complete Request Examples
    • create music
    • upload
    • download
    • get music
    • Extend an existing music track
    • Replace a section of an existing music track
    • Cover an existing music track
  • 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
  1. Docs

Error handling

โš ๏ธ Error Handling Guide#

๐Ÿ”น Error Types#

Error TypeError CodeError Message
Validation Error400"The 'mv' field is invalid. The model should be one of: sonic-v6, ..." (lists every valid model)
Validation Error400"The 'persona_id' field is required when task_type = persona_music."
Validation Error400"The 'make_instrumental' field should be boolean."
Validation Error400"The 'custom_mode' field should be boolean."
Validation Error400"The prompt character length should be less than 3000."
Validation Error400"The 'gpt_description_prompt' character length should be less than 200."
Validation Error400"The tags character length should be less than 200."
Validation Error400"The title character length should be less than 80."
Validation Error400"description is required."
Validation Error400"The description character length should be less than 120."
Validation Error400"name and continue_clip_id are required fields."
Validation Error400"The name character length should be less than 80."
Validation Error400"The description character length should be less than 200."
Validation Error400"task not found."
Validation Error400"missing task id."
Unauthorized401"Authorization header is missing."
Unauthorized401"Invalid authorization format."
Forbidden403"The remaining credits are not enough. You can buy more one-time credit packs or subscribe."
Forbidden403"You do not have an active subscription. Please check whether your renewal was successful."
Task rejected / failed200 (polling) ยท 400 (create)Content rejections (copyright, artist names, moderation) and generation failures. The HTTP status is not the signal โ€” read reason_code below. On GET /api/v1/sonic/task/{task_id} every task failure answers 200 with type "forbidden", "api_error" or "failed".
Not Found400"task not found."
Timeout200"Task failed due to timeout. Credits have been refunded." with reason_code: "timeout"
Server Error500"Internal Server Error."

๐Ÿ”น Rejection reason codes (reason_code)#

Added 2026-10-12. Every task that is rejected or fails during generation now carries two extra fields, so you can tell a content rejection from a temporary problem without parsing the message text:
reason_code: one of the values below
retriable: true if the same request may succeed when sent again
reason_codeMeaningretriableWhat to do
copyrightCopyrighted lyrics, or uploaded audio that matches an existing recordingfalseChange the input
artist_nameAn artist or producer name in the tags, lyrics or promptfalseChange the input
moderationContent flagged as inappropriatefalseChange the input
invalid_inputThe request can't be used as given (missing or invalid field, prompt needs rephrasing)falseChange the input
upstream_busyTemporary capacity issuetrueRetry after a short wait
timeoutGeneration timed outtrueRetry
unknownAny other failurefalseCredits are refunded; a single retry is reasonable
Use reason_code, not the HTTP status, to detect a content rejection. The status depends on where the task was rejected:
At create (POST /api/v1/sonic/create): HTTP 400, type: "validation_error", message in error. No credits are charged.
During generation (GET /api/v1/sonic/task/{task_id}): content rejections return type: "forbidden" with the message in message; other failures return type: "api_error" or "failed". Credits are refunded automatically.
Webhooks: song.failed events carry the same two fields.
The human-readable message is still included and can be shown to your users as is. Example:
{"type": "forbidden", "message": "Your lyrics contain copyrighted material. Please change it and try again.", "reason_code": "copyright", "retriable": false}
Our own request validation (field lengths, invalid values), authentication (401) and credit checks (403) are not task rejections and do not carry reason_code.
A 202 with type: "not_ready" is not a failure: the task is still in progress, so keep polling.

๐Ÿ“ Notes#

1.
The generated Sonic CDN URL does not have an expiration time.
2.
A song can only create one persona.
3.
Service Stability:
Sonic v3.5 is less stable than Sonic v4.
However, in terms of generation quality, Sonic v4 is less stable than Sonic v3.5.

๐Ÿ“Œ Ensure to handle these errors properly in your integration for a smooth user experience.
Modified atย 2026-10-12 13:18:54
Previous
Special Scenarios
Next
Webhook Integration Guide
Built with