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

# 提交 Suno 任务

> POST Suno V6 音乐生成任务（灵感模式或自定义模式）

## 提交任务

灵感模式（`custom: false`，默认）下 `prompt` 为必填的歌曲描述。自定义模式（`custom: true`）下 `prompt` 填写歌词，并可添加 `title`、`style`、`negative_tags`、`max_mode` 与 `duration`。一个请求通常返回两首，任务成功后请从 `result_urls` 读取全部曲目。

```bash theme={null}
curl --fail-with-body --silent --show-error \
  -X POST https://api.wizzx.ai/api/v1/task/submit/suno \
  -H "Authorization: Bearer <api_key>" \
  -H "Content-Type: application/json" \
  --data '{
    "prompt": "深夜城市 lo-fi 钢琴，伴着雨声",
    "instrumental": true
  }'
```

网关每次请求收取 60 积分，开启 `max_mode: true`（仅自定义模式）为 120 积分，价格覆盖返回的所有曲目。具体积分以 `/pricing` 为准。


## OpenAPI

````yaml POST /api/v1/task/submit/suno
openapi: 3.0.3
info:
  title: Wizzx AI API
  version: 1.2.0
  description: >-
    Wizzx asynchronous image, video, and audio generation API. Model keys are
    placed in the submit URL. Submit returns a Wizzx task_id; poll that ID
    through /api/v1/task/status. Authentication uses a Wizzx API key in the
    Authorization: Bearer <key> header.
  license:
    name: MIT
    url: https://github.com/tonyljx/documentation/blob/main/LICENSE
servers:
  - url: https://api.wizzx.ai
    description: Production API
security: []
tags:
  - name: Discovery
    description: Public model and pricing discovery.
  - name: Credits
    description: Authenticated credit balance.
  - name: Image generation
    description: Asynchronous image tasks.
  - name: Video generation
    description: Asynchronous video tasks.
  - name: Audio generation
    description: Asynchronous music and audio tasks.
  - name: Tasks
    description: Asynchronous task status.
  - name: Legacy models
    description: >-
      Compatibility-only models hidden from /pricing. Do not select these
      automatically.
paths:
  /api/v1/task/submit/suno:
    post:
      tags:
        - Audio generation
      summary: Submit Suno task
      description: >-
        Creates one asynchronous paid task. Save data.task_id and poll the
        status endpoint. Do not automatically retry an ambiguous submit.
      operationId: submitSunoTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SunoSubmitRequest'
            example:
              prompt: Late-night city lo-fi piano with the sound of rain
              instrumental: true
      responses:
        '200':
          description: Task accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskSubmitResponse'
        '400':
          description: Malformed JSON or binding validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing, invalid, or revoked API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Insufficient credits
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '413':
          description: Request body exceeds the configured limit
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Model-specific validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          headers:
            X-Retry-After:
              description: Retry delay in seconds.
              schema:
                type: integer
                minimum: 0
        '500':
          description: Internal or upstream submission error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Service or model temporarily unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    SunoSubmitRequest:
      type: object
      additionalProperties: false
      description: >-
        Music generation. Inspiration mode (custom=false) takes a song
        description in prompt. Custom mode (custom=true) takes lyrics in prompt
        plus optional title, style, negative_tags, max_mode, and duration. One
        request usually returns 2 tracks in result_urls. Billed per request;
        max_mode doubles the price.
      properties:
        prompt:
          type: string
          description: >-
            Inspiration mode: required song description, at most 3000
            characters. Custom mode: lyrics, at most 5000 characters; required
            unless instrumental is true.
          maxLength: 5000
        custom:
          type: boolean
          default: false
        instrumental:
          type: boolean
          default: false
        version:
          type: string
          enum:
            - v6
            - v6-wild
            - v6-mini
          default: v6
          description: Case-insensitive. All versions cost the same.
        title:
          type: string
          maxLength: 80
          description: Custom mode only.
        style:
          type: string
          maxLength: 1000
          description: Custom mode only. Style tags.
        negative_tags:
          type: string
          maxLength: 1000
          description: Custom mode only. Styles to avoid.
        vocal_gender:
          type: string
          enum:
            - Male
            - Female
          description: >-
            Case-insensitive; m and f are accepted. Cannot be combined with
            instrumental=true.
        max_mode:
          type: boolean
          default: false
          description: Custom mode only. Higher quality at double the price.
        duration:
          type: integer
          minimum: 10
          maximum: 360
          description: >-
            Custom mode only. Target length in seconds; actual length may
            differ. Does not change the price.
      allOf:
        - oneOf:
            - required:
                - prompt
              properties:
                custom:
                  type: boolean
                  enum:
                    - false
                prompt:
                  type: string
                  minLength: 1
                  maxLength: 3000
                max_mode:
                  type: boolean
                  enum:
                    - false
              not:
                anyOf:
                  - required:
                      - title
                    properties:
                      title: {}
                  - required:
                      - style
                    properties:
                      style: {}
                  - required:
                      - negative_tags
                    properties:
                      negative_tags: {}
                  - required:
                      - duration
                    properties:
                      duration: {}
            - required:
                - custom
              properties:
                custom:
                  type: boolean
                  enum:
                    - true
        - not:
            required:
              - instrumental
              - vocal_gender
            properties:
              instrumental:
                enum:
                  - true
    TaskSubmitResponse:
      type: object
      required:
        - code
        - message
        - data
        - request_id
      properties:
        code:
          type: integer
          enum:
            - 0
        message:
          type: string
          example: success
        data:
          $ref: '#/components/schemas/TaskSubmitData'
        request_id:
          type: string
          format: uuid
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
        request_id:
          type: string
          format: uuid
        retry_after:
          type: integer
          format: int64
          minimum: 0
          description: Retry delay in seconds. Present for rate-limit errors.
    TaskSubmitData:
      type: object
      required:
        - task_id
        - model_key
        - credits_deducted
      properties:
        task_id:
          type: string
          format: uuid
          description: Wizzx task ID used for status polling.
        model_key:
          type: string
        credits_deducted:
          type: integer
          minimum: 0
          description: Credits reserved when the task is accepted.
        provider_task_id:
          type: string
          description: Diagnostic field returned only when debug=1.
        provider_key:
          type: string
          description: Diagnostic field returned only when debug=1.
    ErrorDetail:
      type: object
      required:
        - message
        - type
        - param
        - code
      properties:
        message:
          type: string
        type:
          type: string
          enum:
            - invalid_request_error
            - authentication_error
            - insufficient_quota
            - permission_denied
            - not_found_error
            - conflict_error
            - unprocessable_entity_error
            - rate_limit_error
            - server_error
            - service_unavailable
        param:
          type: string
          nullable: true
        code:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Wizzx API key. This is not a JWT.

````