> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dreamto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate music: Create task

> Creates a Suno task: `model` picks the endpoint, the parameters go in `input`, and the optional `callBackUrl` receives a completion callback. On success `data.taskId` is returned and the task runs asynchronously; poll the query endpoint for the result. Every response has HTTP status 200; check `code`.



## OpenAPI

````yaml /openapi/en/suno-generate.json post /api/v1/jobs/createTask
openapi: 3.1.0
info:
  description: >-
    Create songs from a description or lyrics: simple mode takes one line of
    description, custom mode sets the title, style, lyrics and fine controls;
    each request makes two songs.
  title: Suno Generate music
  version: v1
servers:
  - url: https://api.dreamto.ai
security:
  - bearerAuth: []
tags:
  - name: Suno Generate music
paths:
  /api/v1/jobs/createTask:
    post:
      tags:
        - Suno Generate music
      summary: Create task
      description: >-
        Creates a Suno task: `model` picks the endpoint, the parameters go in
        `input`, and the optional `callBackUrl` receives a completion callback.
        On success `data.taskId` is returned and the task runs asynchronously;
        poll the query endpoint for the result. Every response has HTTP status
        200; check `code`.
      operationId: sunoCreateTask
      requestBody:
        content:
          application/json:
            examples:
              Simple mode:
                description: >-
                  `custom_mode: false`: one line of description; the model
                  writes the lyrics.
                summary: Simple mode
                value:
                  model: ai-music-api/generate
                  input:
                    prompt: An upbeat acoustic song about a summer road trip
                    custom_mode: false
                    instrumental: false
                    model: V6
              Custom lyrics and style:
                description: >-
                  `custom_mode: true` with a title, style, lyrics, a female
                  voice and about two minutes, with a completion callback.
                summary: Custom lyrics and style
                value:
                  model: ai-music-api/generate
                  callBackUrl: https://your-domain.com/api/callback
                  input:
                    lyrics: |-
                      [Verse]
                      Neon lights in the rain tonight
                      Street lamps glowing just for you
                      [Chorus]
                      Take me through the city lights
                      Till the morning breaks through
                    style: synthwave, 80s retro, dreamy female vocals
                    title: Neon City
                    custom_mode: true
                    instrumental: false
                    model: V6
                    negative_tags: heavy metal
                    vocal_gender: f
                    style_weight: 0.65
                    duration: 120
              Instrumental:
                description: >-
                  `instrumental: true` makes music without vocals; `V6_MINI` is
                  faster and `variety: 2` makes the two songs clearly different.
                summary: Instrumental
                value:
                  model: ai-music-api/generate
                  input:
                    style: lo-fi hip hop, mellow piano, vinyl crackle
                    title: Afternoon Café
                    custom_mode: true
                    instrumental: true
                    model: V6_MINI
                    negative_tags: vocals, heavy drums
                    weirdness_constraint: 0.3
                    variety: 2
              References (simple mode):
                description: >-
                  Simple mode can attach images, video, audio and MIDI as
                  references; MIDI is only supported by `V6_WILD`.
                summary: References (simple mode)
                value:
                  model: ai-music-api/generate
                  input:
                    prompt: >-
                      A warm indie folk song inspired by the mood of this beach
                      sunset photo
                    image_urls:
                      - https://your-cdn.example.com/sunset.jpg
                    midi_urls:
                      - https://your-cdn.example.com/melody.mid
                    style: indie folk
                    custom_mode: false
                    instrumental: false
                    model: V6_WILD
            schema:
              $ref: '#/components/schemas/SunoCreateTaskRequestSunoGenerateInput'
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                Created:
                  description: '`data.taskId` is the task ID.'
                  summary: Created
                  value:
                    code: 200
                    msg: success
                    data:
                      taskId: 7d3f0a9c41e85b2f6a1c9e04b8d27f53
                Invalid request (422):
                  description: The request is invalid; no task is created or charged.
                  summary: Invalid request (422)
                  value:
                    code: 422
                    msg: input.title is required.
                    data: null
                Unauthorized (401):
                  description: Missing or invalid API Key.
                  summary: Unauthorized (401)
                  value:
                    code: 401
                    msg: >-
                      Unauthorized - Authentication credentials are missing or
                      invalid
                    data: null
                Insufficient balance (402):
                  description: The balance does not cover the task.
                  summary: Insufficient balance (402)
                  value:
                    code: 402
                    msg: >-
                      Insufficient Credits - Account does not have enough
                      credits to perform the operation
                    data: null
                Rate limited (429):
                  description: Rate limit exceeded; retry later.
                  summary: Rate limited (429)
                  value:
                    code: 429
                    msg: >-
                      Rate Limited - Request limit has been exceeded for this
                      resource
                    data: null
                Server error (500):
                  description: >-
                    The service is temporarily unavailable; retry later. Not
                    charged.
                  summary: Server error (500)
                  value:
                    code: 500
                    msg: >-
                      Server Error - An unexpected error occurred while
                      processing the request
                    data: null
              schema:
                $ref: '#/components/schemas/SunoCreateTaskResponse'
          description: >-
            Always HTTP 200. With `code` `200` the task was created and
            `data.taskId` is its ID; any other `code` is an error with the
            reason in `msg` and `data` `null`.
          headers:
            X-Request-Id:
              description: ID of this request; include it when reporting issues.
              schema:
                type: string
components:
  schemas:
    SunoCreateTaskRequestSunoGenerateInput:
      additionalProperties: false
      description: Request body of createTask.
      properties:
        model:
          default: ai-music-api/generate
          description: |-
            Endpoint name; it decides the fields of `input`.

            **Allowed values:**
            - `ai-music-api/generate`: Suno Generate music
          enum:
            - ai-music-api/generate
          type: string
        callBackUrl:
          description: >-
            Optional URL that receives a callback when the task finishes
            (success or failure); it must be a public `http` / `https` URL.
            Recommended in production; you can also just poll the query
            endpoint. See Task callback for the body and signature.
          type: string
        input:
          $ref: '#/components/schemas/SunoGenerateInput'
          description: Task parameters; the fields depend on `model`.
      required:
        - model
        - input
      type: object
    SunoCreateTaskResponse:
      additionalProperties: false
      description: Response of createTask; always HTTP 200.
      properties:
        code:
          description: >-
            Result code:

            - `200`: success

            - `401`: missing or invalid API Key

            - `402`: insufficient balance

            - `404`: the model does not exist or is not enabled

            - `405`: wrong HTTP method

            - `422`: invalid request, with the reason in `msg`; no task is
            created or charged

            - `429`: too many requests; retry later

            - `455`: service under maintenance

            - `500`: server error; retry later

            - `501`: generation failed

            - `505`: feature disabled
          format: int64
          type: integer
        msg:
          description: 'Message: `success`, or the English reason of an error.'
          type: string
        data:
          $ref: '#/components/schemas/SunoCreateTaskData'
          description: The task on success; `null` on error.
      required:
        - code
        - msg
        - data
      type: object
    SunoGenerateInput:
      additionalProperties: false
      description: >-
        Parameters of `ai-music-api/generate`. `custom_mode`, `instrumental` and
        `model` are required; the other fields depend on the mode.
      properties:
        prompt:
          description: >-
            Optional song description. In simple mode it is the core idea and
            the model writes lyrics from it (not word for word), up to 3,000
            characters; in custom mode it is sung as the lyrics (`lyrics` wins
            when both are given), up to 5,000 characters.
          maxLength: 5000
          type: string
        lyrics:
          description: >-
            Optional lyrics, up to 5,000 characters. In custom mode they are the
            lyrics (`prompt` is used when absent); in simple mode they are a
            lyrics attachment used together with the description in `prompt`.
            Mark sections with `[Verse]`, `[Chorus]` and so on.
          maxLength: 5000
          type: string
        image_urls:
          description: >-
            Optional reference images, simple mode only: 1–5 images of up to 10
            MB each (jpeg, png, webp or bmp) at public `http` / `https` URLs.
          items:
            type: string
          maxItems: 5
          minItems: 1
          type: array
        video_urls:
          description: >-
            Optional reference video, simple mode only: at most one file of up
            to 100 MB and 241 seconds (mp4, mov or webm) at a public `http` /
            `https` URL.
          items:
            type: string
          maxItems: 1
          minItems: 1
          type: array
        audio_urls:
          description: >-
            Optional reference audio, simple mode only: 6 seconds to 30 minutes
            and up to 500 MB per file, at public `http` / `https` URLs.
          items:
            type: string
          minItems: 1
          type: array
        midi_urls:
          description: >-
            Optional reference MIDI, simple mode only: at most one mid / midi
            file of up to 256 KB that starts with the standard `MThd` header, at
            a public `http` / `https` URL. Only `V6_WILD` supports it; with
            another version `V6_WILD` is used.
          items:
            type: string
          maxItems: 1
          minItems: 1
          type: array
        style:
          description: >-
            Optional music style, up to 1,000 characters, such as `Jazz`,
            `Classical`, `Electronic`, `Pop`, `Rock` or `Hip-hop`. In simple
            mode it counts as a reference item.
          maxLength: 1000
          type: string
        title:
          description: >-
            Song title, required in custom mode, up to 80 characters; shown in
            players and file names.
          maxLength: 80
          type: string
        custom_mode:
          description: >-
            Required: whether to use custom mode. `true`: set the title, style,
            lyrics and fine controls yourself; `title` is required and at least
            one of `style`, `lyrics` and `negative_tags`. `false`: simple mode;
            at least one of `prompt`, `style`, `lyrics` or a reference is
            required.
          type: boolean
        instrumental:
          description: >-
            Required: whether to make an instrumental (no vocals). With `false`
            the lyrics are sung (in custom mode `lyrics`, or `prompt` when
            absent).
          type: boolean
        model:
          description: >-
            Required Suno model version: `V6`, `V6_MINI` or `V6_WILD`. The
            discontinued V4–V5_5 are no longer supported.


            **Allowed values:**

            - `V6`: Suno V6: greater musical expression, more natural vocals and
            richer detail

            - `V6_MINI`: Suno V6 Mini: lightweight and fast, balancing quality
            and speed

            - `V6_WILD`: Suno V6 Wild: pushes creative boundaries for bolder,
            more distinctive expression
          enum:
            - V6
            - V6_MINI
            - V6_WILD
          type: string
        negative_tags:
          description: >-
            Optional music styles or traits to avoid, such as `Heavy Metal,
            Upbeat Drums`.
          type: string
        vocal_gender:
          description: >-
            Optional vocal gender preference. It only raises the likelihood of
            that gender and is not guaranteed. Custom mode only.


            **Allowed values:**

            - `m`: Male voice

            - `f`: Female voice
          enum:
            - m
            - f
          type: string
        style_weight:
          description: >-
            Optional strength of adherence to `style`, `0`–`1` with at most 2
            decimal places. Custom mode only.
          format: double
          maximum: 1
          minimum: 0
          multipleOf: 0.01
          type: number
        weirdness_constraint:
          description: >-
            Optional creative / experimental deviation, `0`–`1` with at most 2
            decimal places; higher is bolder. Custom mode only.
          format: double
          maximum: 1
          minimum: 0
          multipleOf: 0.01
          type: number
        audio_weight:
          description: >-
            Optional relative weight of the audio features, `0`–`1` with at most
            2 decimal places. Custom mode only; not supported for instrumentals
            (`instrumental: true`).
          format: double
          maximum: 1
          minimum: 0
          multipleOf: 0.01
          type: number
        variety:
          default: 1
          description: >-
            Optional variety of the results, an integer from `0` to `4`, default
            `1`, custom mode only: `0` off (exact style), `1` normal (balanced),
            `2` high (distinct styles), `3` extra (bold exploration), `4` max
            (results may differ a lot).
          format: double
          maximum: 4
          minimum: 0
          multipleOf: 1
          type: number
        persona_id:
          description: >-
            Optional Persona ID or Voice ID: the music takes on that Persona's
            style or that custom voice. Create a Persona with Generate Persona
            and a voice with the custom-voice endpoints.
          type: string
        persona_model:
          description: >-
            Optional type of `persona_id`.


            **Allowed values:**

            - `style_persona`: Style Persona: takes on the Persona's overall
            musical style

            - `voice_persona`: Voice Persona: takes on the voice of the Persona
            or custom voice
          enum:
            - style_persona
            - voice_persona
          type: string
        duration:
          description: >-
            Optional target length in seconds, `10`–`360`, custom mode only; the
            model decides when omitted.
          format: double
          maximum: 360
          minimum: 10
          type: number
      required:
        - custom_mode
        - instrumental
        - model
      type: object
    SunoCreateTaskData:
      additionalProperties: false
      description: The created task.
      properties:
        taskId:
          description: >-
            Task ID (32 hex digits), used to query the task and as the `task_id`
            of follow-up endpoints.
          type: string
      required:
        - taskId
      type: object
  securitySchemes:
    bearerAuth:
      description: >-
        API Key created in the DreamTo console, sent as `Authorization: Bearer
        <API Key>`.
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.