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

# Suno Upload API 文档

> 通过 Suno 音频上传接口提交参考音频或源文件，为后续音乐生成、翻唱、分轨和风格处理流程做准备。

<Callout type="info">
  * 当 is\_async = false（同步模式）时：
    接口会阻塞等待处理完成，并直接返回 music\_id。
    ⚠️ 由于需要等待完整处理流程，接口耗时较长。

  * 当 is\_async = true（异步模式）时：
    接口会立即返回 jobId。
    你需要通过 jobId 调用[查询任务接口](/api/cn/suno/suno_fetch)，异步获取最终的上传结果。
</Callout>


## OpenAPI

````yaml openapi/cn/suno.json POST /suno/v1/upload
openapi: 3.1.0
info:
  title: TTAPI API DOCS
  version: 1.0.0
  description: Suno 音乐生成相关接口
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /suno/v1/upload:
    post:
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - type: object
                  properties:
                    audio_url:
                      type: string
                      description: 音频地址，必须是可公开访问的音频地址
                    is_async:
                      type: boolean
                      default: false
                      description: |-
                        是否异步

                        - false：同步等待

                        - true：异步查询
                  required:
                    - audio_url
                - $ref: '#/components/schemas/HookUrlParams'
      responses:
        '200':
          description: 请求成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: SUCCESS
                  message:
                    type: string
                    example: success
                  data:
                    oneOf:
                      - type: object
                        description: 使用同步上传（is_async=false），接口将同步等待返回音频id，接口耗时时间久
                        example:
                          music_id: music_id
                      - type: object
                        description: 使用异步上传（is_async=true），接口将立即返回任务id，通过jobId异步查询上传结果
                        example:
                          jobId: jobId
                required:
                  - status
                  - message
                  - data
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    HookUrlParams:
      type: object
      properties:
        hookUrl:
          type: string
          description: 回调通知地址
  responses:
    400Response:
      description: 参数错误
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
              data:
                type: object
            required:
              - status
              - message
    401Response:
      description: 授权失败
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: Wrong TT-API-KEY or email is not activated.
            required:
              - status
              - message
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        请前往 <a href='https://dashboard.ttapi.io' target='_blank'>TTAPI 控制台</a>
        获取 API 密钥。

````