Skip to main content
POST
Create Task

Create Task

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.

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" or "udio". See the Suno and Udio model pages for capabilities and pricing.
string
required
The type of task to create. Suno supports: "music", "lyrics", "upload", "concat". Udio supports "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 uses a different field set — see the Udio model page for the Udio-specific shape. Mixing them 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.
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.