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

# 音频上传

> 上传音频以供其他动作引用。

> [!TIP]
>
> 也可以用统一任务接口 `POST /v1/task/submit` 提交：`model` 填 `suno/upload`，参数放进 `input`。两种写法效果与计费完全一样。

> [accordion] 任务结果
>
> 任务成功后，查询结果里产物的格式
>
> 任务成功后，结果放在 `data.result` 里：
>
> ```json theme={null}
> {
>   "code": "success",
>   "data": {
>     "task_id": "5adac6ee-...",
>     "action": "upload",
>     "model": "suno/upload",
>     "status": "SUCCESS",
>     "progress": "100%",
>     "result": {
>       "music_id": "89b20862-..."
>     }
>   }
> }
> ```
>
> `result.music_id` 是上传后的曲目 ID，上传翻唱、上传续写、参考生成等操作都可以直接引用它。


## OpenAPI

````yaml cn/openapi/suno.json POST /suno/v2/upload
openapi: 3.1.0
info:
  title: Suno API
  version: 1.0.0
  description: Suno 接口
servers:
  - url: https://api.ephone.ai
security:
  - bearerAuth: []
paths:
  /suno/v2/upload:
    post:
      summary: 音频上传
      description: 上传音频以供其他动作引用。
      operationId: suno_upload
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                audio_url:
                  type: string
                  description: '**音频地址**：公网可直接下载的音频地址，建议 8 分钟以内，支持 MP3 / WAV / M4A。'
                is_async:
                  type: boolean
                  default: false
                  description: '**异步处理**：开启后立即返回任务 ID，稍后再查结果；关闭则等待处理完成后直接返回。'
                notify_hook:
                  type: string
                  format: uri
                  description: >-
                    **推送地址**：任务结束后，把和查询结果相同的内容 POST 到这个地址（公网可以访问的 http / https
                    地址）。不传就自己查询。
              required:
                - audio_url
            example:
              audio_url: https://example.com/audio.mp3
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
              example:
                code: success
                message: success
                data:
                  task_id: 5adac6ee-...
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: error
                message: music_id is required
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
              example:
                error:
                  message: Invalid Token
                  type: rix_api_error
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
              example:
                error:
                  message: Too many requests, please try again later
                  type: rix_api_error
components:
  schemas:
    SubmitResponse:
      type: object
      properties:
        code:
          type: string
          enum:
            - success
        message:
          type: string
        data:
          type: object
          properties:
            task_id:
              type: string
              description: 任务 ID。
          required:
            - task_id
      required:
        - code
        - data
    Error:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
    GatewayError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: '在请求头 `Authorization: Bearer YOUR_API_KEY` 里带上 API Key。'

````

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