Skip to content
中文

POST /minimax/v1/files/upload

Method: POSTEndpoint: /minimax/v1/files/upload

Official Documentation

This section contains endpoint-specific behavior, parameters, or usage notes for this API.

Request Parameters

Header Parameters

text
Authorization
string
Optional
Default Value:
Bearer {{YOUR_API_KEY}}

Body Parameters multipart/form-data Required

text
purpose
string
Required
  // provider-specific example normalized for English documentation
  // provider-specific example normalized for English documentation
  // provider-specific example normalized for English documentation
Example:
"prompt_audio"
Example:
prompt_audio
file
file
Required
  // provider-specific example normalized for English documentation
  // provider-specific example normalized for English documentation
  // provider-specific example normalized for English documentation
  // provider-specific example normalized for English documentation
  // provider-specific example normalized for English documentation
Example:
example-file

Example Request

Shell

bash
curl --location --request POST '/minimax/v1/files/upload' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--form 'purpose="prompt_audio"' \
--form 'file=@"example-file"'

Response

🟢 200 Success

Content Type: application/json

Response Schema

text
file
object
Optional
file_id
integer
Unique identifier of the file
Optional
bytes
integer
Optional
File size in bytes
created_at
integer
Optional
Unix timestamp in seconds when the file was created
filename
string
File name
Optional
purpose
string
Purpose of the file.
Optional
base_resp
object
Optional
status_code
integer
Optional
Status codes and their meanings are listed below:
0, request succeeded
1002, rate limit triggered, please try again later
1004, account authentication failed, please check whether the API key is correct
1008, insufficient account balance
1026, the image description contains sensitive content
2013, invalid input parameters, please verify the request body
2049, invalid API key
status_msg
string
Status Details
Optional

Example

json
{
    "file": {
        "file_id": "${file_id}",
        "bytes": 5896337,
        "created_at": 1700469398,
        "filename": "sample.mp3",
        "purpose": "prompt_audio"
    },
    "base_resp": {
        "status_code": 0,
        "status_msg": "success"
    }
}