Skip to main content
POST
Create Task

Create Task

Submission-error update — pending production rollout (2026-09-30). The 422 responses and top-level error task_id / retry guidance described below are the upcoming contract, not a claim that production has changed. Until rollout is confirmed, a provider rejection during submission can still return 502 upstream_provider_error without a task_id, even when a failed, refunded task exists. An edge may replace that body with HTML. Do not blindly resubmit: check the signed-in task dashboard or contact support with the request time and X-Request-Id when available. Successful submissions still return 202 with data.task_id.
Submit a new task to an AI model. The task is processed asynchronously — use the Get Task endpoint to poll for results. Sunor validates the JSON body, model, task type, and model-specific input before freezing credits, inserting a task, or calling an upstream provider. Invalid requests therefore fail without creating a task or changing the credit balance. The JSON body may be up to 256 KiB. The serialized input object may be up to 128 KiB, and known text fields may be up to 16,000 Unicode characters. A body over the first limit returns 413 request_body_too_large; an oversized input or text field returns 400 invalid_task_input.

Request

Headers

string
required
Your API key.
string
required
Must be application/json.

Body parameters

string
required
The AI model to use. One of "suno", "udio", or "ace". See the Suno, Udio, and ACE Music model pages for capabilities and pricing.
string
required
The type of task to create. Suno supports: "music", "lyrics", "upload", "concat". Udio and ACE Music support "music" only.
object
required
Task-specific input parameters. See the sections below for each task type.
string
Pin the delivery format of audio_url. Currently the only accepted value is "mp3".Omit it and you get the provider’s own file, in whatever format that provider produces. That is not a fixed format — it changes when a provider changes what it makes, and it changes when we route your request to a different provider to keep the service up. See Audio format.Send "mp3" and audio_url points at MP3. A source that is already MP3 is delivered as-is rather than re-encoded, so you never pay a second lossy pass for a file that was already right.If the conversion fails the task still succeeds — you get our copy of the source file, at our URL and our retention, in the source format. The response echoes back the audio_format you sent either way, because that field records the request rather than the outcome; read Content-Type to know what a file actually is.Applies to task types that return audio. A lyrics task has no audio_url, so the field changes nothing about what you receive — it is still accepted and still echoed back.Any other value is rejected with invalid_audio_format before any credits are charged. The field as a whole can also be refused with audio_format_unavailable, which means conversion is switched off on our side rather than anything being wrong with your request; omit the field to receive the provider’s original file.
Sunor validates the documented model/task fields before charging credits or submitting to a provider. Extra root or input properties are accepted for backward/forward compatibility, but they are not interpreted as provider controls unless a request variant explicitly prohibits them. Use documented fields for provider behavior.

Task types and input schemas

music — Generate music

The music task supports three modes depending on which input fields you provide.
Input fields differ by model. The examples below show Suno input shape (using gpt_description_prompt, make_instrumental, etc.). Udio and ACE Music use different field sets — see the Udio model page and ACE Music model page before adapting a request. Mixing provider-specific fields produces a 400 validation error.
All three Suno modes also accept the model version:
string
default:"v6"
Suno model to generate with: "v6" (the default), "v5.5" or "v5". Suno retired v5.5 and v5 on 2026-09-09; both are still accepted for backward compatibility and generate with V6. Values are case-sensitive, and any other value is rejected with a 400 before any credits are charged. To use the default, omit the field; null is rejected. See Model version.
Generate music from a natural language description. The AI interprets your prompt and creates lyrics, melody, and arrangement.
string
required
A natural language description of the music you want (e.g., “A chill lo-fi beat for studying”).
boolean
default:"false"
Set to true to generate instrumental music without vocals.

lyrics — Generate lyrics

string
required
A description of the lyrics you want (e.g., “A love song about the ocean at sunset”).

upload — Upload audio

string
required
A publicly accessible URL of the audio file to upload.
The upload returns a clip id (at output.result[0].id). Pass it as continue_clip_id in a music task to extend your uploaded audio into a full song (see the Continuation Mode tab under the music task). Generating a new song in a different style from an uploaded reference (an “audio cover”) is not currently supported.

concat — Concatenate clips

string
required
The clip ID to concatenate (obtained from a previous music task output).

Response

Response headers

number
HTTP status code (202 on success).
object
string
Unique identifier for the created task. Use this to poll for results.
string
The task type that was submitted.
string
Initial status, always "pending".
number
Number of credits frozen for this task.
string
ISO 8601 timestamp of when the task was created.
string | null
The delivery format this task was created with — the value you sent, or null if you omitted it. null means audio_url points at the provider’s own file, whose format is not fixed.
202

Code examples

Errors

Errors retain the numeric code and human-readable message, and also include a stable machine-readable error_code. See Error Codes for the full list.

Rejection after a task was created (pending rollout)

After the production rollout, the following contract applies. Some input can only be checked by the provider. If submission is rejected after Sunor created a task and the failure/refund transition commits, the error response includes top-level task_id. When the stored error has classifiable text, retryable, retry_after_seconds, and error_code use the same classification as GET /api/v1/task/{task_id}. A content rejection is an HTTP 422 JSON error, not a gateway failure:
422
Read an error body before throwing for a non-2xx response so you retain the reference. On 202 it is data.task_id; on these errors it is task_id. Query the existing task before deciding to create another. The content-check verdict does not establish whether you own or are entitled to use the audio. retryable is guidance, not a promise; always read it rather than deriving it from 422 or the error code. A numeric wait is also returned as Retry-After; when no wait is known, retry_after_seconds is null and that header is absent. Provider rate limits do not mean your API-key quota was exhausted. If the stored error contains no classifiable text, the HTTP response remains a generic 502 with task_id, but no retry guidance is invented; GET may report null task-level classification fields. Validation/authentication failures before task creation have no task reference. If settlement cannot be confirmed, a 500 may include a task_id without retryable or a refund claim; query it to determine the outcome.
Task creation does not currently support Idempotency-Key. If a network failure or uncertain 5xx leaves the create outcome unknown, do not automatically submit the same payload again. If a task_id was returned, poll that task instead. Genuine upstream failures still return 502; a proxy or edge may replace a 5xx JSON body, so task references are not guaranteed to reach you on infrastructure failures. If none is available, use the signed-in task dashboard or contact support with X-Request-Id and the request time. There is no v1 task-list endpoint.