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

# Suno API: Generate Music

> Generate AI music using simple text prompts.

### Important Notes

* Supports two generation modes: `simple` and `custom`
* This endpoint generates music based on your text prompts(simple model) or custom lyrics and styles(custom model)
* Each request generates a maximum of two different music variations
* You can control the level of detail through the generation mode and instrumental-only settings

<Tip>
  For new users, it is recommended to start with the simple mode(`mode=simple`).
</Tip>

### Generate Music (Simple Mode)

Generate music with just one text prompt, no other complicated parameters required.

## Response Example

<CodeGroup>
  ```json with lyrics theme={null} theme={null}
  {
  	"model": "suno/music-generate",
  	"callback_url": "",
  	"input": {
          "mode": "simple",
          "model": "v5",
          "instrumental": false,
          "prompt": "A dark and sensual Western R&B song with smooth and breathy female vocals, slow tempo, minimal beat, deep bass, moody atmosphere, about heartbreak and toxic love, late night vibe, intimate and emotional."
      }
  }
  ```

  ```json instrumental music theme={null} theme={null}
  {
  	"model": "suno/music-generate",
  	"callback_url": "",
  	"input": {
          "mode": "simple",
          "model": "v5",
          "instrumental": true,
          "prompt": "Lo-fi chill instrumental hip hop beat with vinyl crackle, relaxing mood, suitable for studying"
      }
  }
  ```
</CodeGroup>

### Generate Music (Custom Mode)

Custom song generation requires a song title, style, and lyrics (unless generating an instrumental), along with optional
advanced parameter settings.

<CodeGroup>
  ```json custom with lyrics theme={null} theme={null}
  {
  	"model": "suno/music-generate",
  	"callback_url": "",
  	"input": {
          "mode": "custom",
          "model": "v5",
          "title": "Midnight Addiction",
          "tags": "Western R&B, female vocal, dark, sensual, slow tempo, moody, emotional",
          "lyrics": "[Verse 1]\nI still taste your words in the dark\nLike a flame leaving invisible scars\nYou pull me close just to let go\nAnd I keep falling into your shadow\n\n[Chorus]\nYou're my midnight addiction\nNo cure for this condition\nEven when it hurts, I stay\nLost in your contradiction\n\n[Verse 2]\nEvery silence feels so loud\nWhen your love ain't around\nI know I should walk away\nBut I'm too deep to escape now",
          "vocal_gender": "f",
          "style_weight": 0.85,
          "weirdness_constraint": 0.2
      }
  }
  ```

  ```json custom instrumental theme={null} theme={null}
  {
  	"model": "suno/music-generate",
  	"callback_url": "",
  	"input": {
          "mode": "custom",
          "model": "v5",
          "instrumental": true,
          "title": "Neon Dreams",
          "tags": "lofi, chill, instrumental, ambient, night, soft piano, relaxing",
          "style_weight": 0.9,
          "weirdness_constraint": 0.2
      }
  }
  ```
</CodeGroup>

### Get Task Result

After submitting a task, use the unified query endpoint to check progress and retrieve results:

<Card title="Get Suno Task Info" icon="magnifying-glass" href="/suno-api/suno-task-info">
  Learn how to query suno task status and retrieve generation results
</Card>


## OpenAPI

````yaml suno-api/generate-music.json post /api/v1/client/job/CreateTask
openapi: 3.0.0
info:
  title: Crun Suno Music Generate API
  description: crun.ai Suno Music Generate API Documentation
  version: 1.0.0
  contact:
    name: Technical Support
    email: support@crun.ai
servers:
  - url: https://api.crun.ai
    description: API Server
security:
  - ApiKeyAuth: []
paths:
  /api/v1/client/job/CreateTask:
    post:
      summary: Suno music generation
      operationId: suno/music-generate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              properties:
                model:
                  type: string
                  enum:
                    - suno/music-generate
                  description: |-
                    The model name to use for generation. Required field.

                    - Must be `suno/music-generate` for this endpoint
                callback_url:
                  type: string
                  format: uri
                  description: >-
                    Optional. Callback URL for receiving task completion
                    notifications.


                    - System will POST task status and results to this URL when
                    generation completes

                    - Callback payloads structure is consistent with the `data`
                    object returned by the task status query

                    - Your callback endpoint should accept POST requests with
                    JSON payload containing results

                    - It returns an HTTP 200 status code upon successful receipt
                  example: https://your-domain.com/api/callback
                input:
                  $ref: '#/components/schemas/SunoMusicGenerateInput'
            example:
              model: suno/music-generate
              callback_url: https://your-domain.com/api/callback
              input:
                mode: custom
                model: v5
                instrumental: false
                title: Midnight Addiction
                tags: Western R&B, female vocal, dark, sensual, slow tempo, moody
                lyrics: |-
                  [Verse 1]
                  I still taste your words in the dark
                  Like a flame leaving invisible scars

                  [Chorus]
                  You're my midnight addiction
                  No cure for this condition
                vocal_gender: f
                style_weight: 0.85
                weirdness_constraint: 0.2
                negative_tags: metal, aggressive
      responses:
        '200':
          description: Request successful
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          task_id:
                            type: string
                            description: >-
                              Task ID, can be used with Get Task Details
                              endpoint to query task status
                            example: task_12345678
              example:
                code: 200
                message: success
                data:
                  task_id: task_12345678
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      errors:
                        type: array
                        description: Detailed validation error messages
                        items:
                          type: string
                        example:
                          - specific error field message
              example:
                code: 422
                message: Missing Params or Type Error
                errors:
                  - specific error field message
        '500':
          $ref: '#/components/responses/Error'
components:
  schemas:
    SunoMusicGenerateInput:
      type: object
      description: |-
        Input parameters for Suno music generation.

        Rules:
        - `mode=simple`: `prompt` is required.
        - `mode=custom`: `title` and `tags` are required.
        - `mode=custom` and `instrumental=false`: `lyrics` is required.
        - `model=v4`: `tags` max length is 200 and `lyrics` max length is 3000.
      properties:
        mode:
          type: string
          enum:
            - simple
            - custom
          description: Music generation mode.
          example: simple
        model:
          type: string
          enum:
            - v5.5
            - v5
            - v4.5plus
            - v4.5
            - v4.5all
            - v4
          description: >-
            Suno music model version.


            - **v5.5**: A tailor-made model crafted to match your unique taste. 

            - **v5**: Superior musical expression, faster generation. 

            - **v4.5plus**: v4.5+ delivers richer sound, new ways to create, max
            8 min. 

            - **v4.5**: enables smarter prompts, faster generations, max 8 min. 

            - **v4.5all**: enables smarter prompts, faster generations, max 8
            min. 

            - **v4**: improves vocal quality, max 4 min.
          example: v5
        instrumental:
          type: boolean
          description: Whether to generate instrumental-only audio (no lyrics).
          example: false
        title:
          type: string
          maxLength: 100
          description: Music title. Required in `custom` mode.
          example: Midnight Addiction
        prompt:
          type: string
          maxLength: 500
          description: >-
            Text prompts for guiding music generation for `simple` mode.
            Required when mode is `simple`.
          example: >-
            Lo-fi chill instrumental hip hop beat with vinyl crackle, relaxing
            mood.
        lyrics:
          type: string
          maxLength: 5000
          description: >-
            Lyrics for custom mode. Required when mode is `custom` and
            `instrumental` is `false`. For model `v4`, max length is 3000,
            others 5000.
          example: |-
            [Verse 1]
            I still taste your words in the dark...
        tags:
          type: string
          maxLength: 1000
          description: >-
            Music style tags. Required in `custom` mode. For model `v4`, max
            length is 200, others 1000.
          example: Western R&B, female vocal, dark, sensual, slow tempo
        vocal_gender:
          type: string
          enum:
            - m
            - f
          description: >-
            Vocal gender preference: `m` for male, `f` for female. Effective
            only in `custom` Mode.
          example: f
        negative_tags:
          type: string
          maxLength: 1000
          description: Music styles to exclude.
          example: metal, aggressive, harsh vocals
        style_weight:
          type: number
          minimum: 0
          maximum: 1
          description: Style reference strength, from 0.0 to 1.0.
          example: 0.85
        weirdness_constraint:
          type: number
          minimum: 0
          maximum: 1
          description: Controls experimental/creative deviation, from 0.0 to 1.0.
          example: 0.2
        persona_id:
          type: string
          description: >-
            Persona ID for the selected persona model. Create via [Suno Persona
            Generate](/suno-api/suno-persona-generate).
          example: persona_123456
        persona_model:
          type: string
          enum:
            - style_persona
            - voice_persona
          description: |-
            Persona model type. Use with `persona_id` to apply a saved persona.

             - **style_persona**: Applies style-focused persona characteristics.
             - **voice_persona**: Applies voice-focused persona characteristics (only available with v5 model).
          default: style_persona
          example: style_persona
      required:
        - mode
        - model
        - instrumental
    ApiResponse:
      type: object
      properties:
        code:
          type: integer
          enum:
            - 200
            - 401
            - 402
            - 404
            - 422
            - 429
            - 455
            - 500
            - 501
            - 505
          description: >-
            Response status code


            - **200**: Success - Request has been processed successfully

            - **401**: Unauthorized - Authentication credentials are missing or
            invalid

            - **402**: Insufficient Credits - Account does not have enough
            credits to perform the operation

            - **404**: Not Found - The requested resource or endpoint does not
            exist

            - **422**: Validation Error - The request parameters failed
            validation checks

            - **429**: Rate Limited - Request limit has been exceeded for this
            resource

            - **455**: Service Unavailable - System is currently undergoing
            maintenance

            - **500**: Server Error - An unexpected error occurred while
            processing the request

            - **501**: Generation Failed - Content generation task failed

            - **505**: Feature Disabled - The requested feature is currently
            disabled
        message:
          type: string
          description: Response message, error description when failed
          example: success
  responses:
    Error:
      description: Server Error
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        All APIs require authentication via API Key.


        Get API Key:

        1. Visit [API Key Management Page](https://crun.ai/user-api-key) to get
        your API Key


        Usage:

        Add to request header:


        x-api-key: YOUR_API_KEY


        Note:

        - Keep your API Key secure and do not share it with others

        - If you suspect your API Key has been compromised, reset it immediately
        in the management page

````