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

# 文件管理

> 下载与元数据检索（retrieve / retrieve_content）

> 常见路径：
>
> * `GET /minimaxi/v1/files/retrieve?file_id=...`
> * `GET /minimaxi/v1/files/retrieve_content?file_id=...`

说明

* `retrieve` 返回文件对象（含 `download_url`/`bytes` 等）；
* `retrieve_content` 直接返回二进制流，建议加 `-L` 跟随重定向并输出到文件；
* 可选参数：`task_id`、`channel_id`（用于定位来源渠道）。

## 上传复刻音频（voice\_clone / prompt\_audio）

> 路径：`POST /minimaxi/v1/files/upload`
>
> * 媒介类型：`multipart/form-data`
> * 字段：
>   * `purpose`：
>     * `voice_clone`：上传待复刻音频（10 秒–5 分钟）
>     * `prompt_audio`：上传示例音频（用于 `clone_prompt`，时长 \< 8 秒）
>   * `file`：待上传的音频文件，支持 mp3/m4a/wav，≤ 20MB

```bash theme={null}
curl -X POST "$BASE_URL/minimaxi/v1/files/upload" \
  -H "Authorization: Bearer $TOKEN" \
  -F "purpose=voice_clone" \  # 或 prompt_audio
  -F "file=@/path/to/audio.wav"
```

> 声音快速复刻（voice cloning）推荐配合 `POST /minimaxi/v1/voice_clone` 使用：\
> 1）先通过 `/minimaxi/v1/files/upload` 上传复刻音频拿到 `file_id`；\
> 2）再在 `POST /minimaxi/v1/voice_clone` 中传入对应的 `file_id` 与 `voice_id` 完成音色快速复刻。

<Tabs>
  <Tab title="下载内容">
    ```bash theme={null}
    curl -L "$BASE_URL/minimaxi/v1/files/retrieve_content?file_id=$FILE_ID" \
      -H "Authorization: Bearer $TOKEN" \
      --output "$FILE_ID.bin"
    ```
  </Tab>

  <Tab title="查询元数据">
    ```bash theme={null}
    curl "$BASE_URL/minimaxi/v1/files/retrieve?file_id=$FILE_ID" \
      -H "Authorization: Bearer $TOKEN"
    ```
  </Tab>
</Tabs>
