跳转到主要内容
POST
/
v1
/
files
/
upload
Upload File
curl --request POST \
  --url https://api.minimaxi.com/v1/files/upload \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form purpose=voice_clone \
  --form file=@example-file
{
  "file": {
    "file_id": "${file_id}",
    "bytes": 5896337,
    "created_at": 1700469398,
    "filename": "复刻音频",
    "purpose": "voice_clone"
  },
  "base_resp": {
    "status_code": 0,
    "status_msg": "success"
  }
}

Authorizations

Authorization
string
header
required

HTTP: Bearer Auth

  • Security Scheme Type: http
  • HTTP Authorization Scheme: Bearer API_key,用于验证账户信息,可在 账户管理>接口密钥 中查看。

Headers

Content-Type
enum<string>
default:multipart/form-datan
required

请求体的媒介类型 multipart/form-data

Available options:
multipart/form-data

Body

multipart/form-data
purpose
enum<string>
default:voice_clone
required

文件使用目的。取值及支持格式如下:

  • voice_clone: 快速复刻原始文件,(支持mp3、m4a、wav格式)
Available options:
voice_clone
Example:

"voice_clone"

file
file
required

需要上传的文件。填写文件的路径地址

支持上传的文件需遵从以下规范:

  • 上传的音频文件格式需为:mp3、m4a、wav格式
  • 上传的音频文件的时长最少应不低于10秒,最长应不超过5分钟
  • 上传的音频文件大小需不超过20mb

Response

200 - application/json
file
object
base_resp
object
I