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

# 异步人声分离

> 异步上传音频文件并创建人声分离任务。接口会立即返回任务 ID。

## 说明

异步方式进行人声分离。接口会在任务创建后立即返回 `task_id`。获得 `task_id` 后，可使用[查询人声分离任务 API](/api-reference/endpoint/voice-isolation/pending)轮询任务状态与分离结果。

对于需要保持 HTTP 请求连接并直接返回分离结果的场景，见[同步人声分离 API](/api-reference/endpoint/voice-isolation/sync)。

## 音频要求

* 上传字段固定为 `file`
* 支持的音频格式、时长与文件大小限制以服务端校验规则为准
* 当文件不符合模型要求或音频格式非法时，服务端将返回 `400`

<Warning>
  在线 Playground 会先通过文档站代理上传文件，较大的音视频文件可能触发 `413 Request Entity Too Large`。如需测试较大文件，请使用下方 `curl` 示例或 SDK 从本地直连 `https://api.senseaudio.cn`。
</Warning>

## 请求示例

```bash theme={null}
curl --request POST 'https://api.senseaudio.cn/v1/isolation/async' \
  --header 'Authorization: Bearer <API_KEY>' \
  --form 'model=senseaudio-voice-isolation-1.0-260319' \
  --form 'file=@/path/to/sample.wav'
```


## OpenAPI

````yaml api-reference/endpoint/voice-isolation/voice-isolation.openapi.json POST /v1/isolation/async
openapi: 3.1.0
info:
  title: SenseAudio - Voice Isolation
  version: 1.0.0
servers:
  - url: https://api.senseaudio.cn
    description: 生产环境
security:
  - bearerAuth: []
paths:
  /v1/isolation/async:
    post:
      tags:
        - Voice Isolation
      summary: 异步人声分离
      description: 异步上传音频文件并创建人声分离任务。接口会立即返回任务 ID。
      operationId: voiceIsolationAsync
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - model
                - file
              properties:
                model:
                  type: string
                  description: 人声分离模型名称
                  enum:
                    - senseaudio-voice-isolation-1.0-260319
                    - senseaudio-voice-isolation-1.5
                  example: senseaudio-voice-isolation-1.0-260319
                file:
                  type: string
                  format: binary
                  description: 待处理的音频文件
      responses:
        '200':
          description: 任务创建成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  task_id:
                    type: string
                    description: 异步任务 ID，可用于查询任务状态和结果
                    example: 9e4f0f7c-1c5c-4a1d-8a73-2d86d58c0d1b
                required:
                  - task_id
              example:
                task_id: 9e4f0f7c-1c5c-4a1d-8a73-2d86d58c0d1b
        '400':
          description: 请求参数或音频文件不符合要求
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: 错误码
        message:
          type: string
          description: 错误信息
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API_KEY
      description: 格式：`Bearer <API_KEY>`

````