Retrieve MiniMaxi file
curl --request GET \
--url https://xuwuai.com/minimaxi/v1/files/retrieve \
--header 'Authorization: Bearer <token>'import requests
url = "https://xuwuai.com/minimaxi/v1/files/retrieve"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://xuwuai.com/minimaxi/v1/files/retrieve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://xuwuai.com/minimaxi/v1/files/retrieve",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://xuwuai.com/minimaxi/v1/files/retrieve"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://xuwuai.com/minimaxi/v1/files/retrieve")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://xuwuai.com/minimaxi/v1/files/retrieve")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{}文件管理
文件管理
下载与元数据检索(retrieve / retrieve_content)
GET
/
minimaxi
/
v1
/
files
/
retrieve
Retrieve MiniMaxi file
curl --request GET \
--url https://xuwuai.com/minimaxi/v1/files/retrieve \
--header 'Authorization: Bearer <token>'import requests
url = "https://xuwuai.com/minimaxi/v1/files/retrieve"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://xuwuai.com/minimaxi/v1/files/retrieve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://xuwuai.com/minimaxi/v1/files/retrieve",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://xuwuai.com/minimaxi/v1/files/retrieve"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://xuwuai.com/minimaxi/v1/files/retrieve")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://xuwuai.com/minimaxi/v1/files/retrieve")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{}常见路径:说明
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
curl -X POST "https://xuwuai.com/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完成音色快速复刻。
- 下载内容
- 查询元数据
curl -L "https://xuwuai.com/minimaxi/v1/files/retrieve_content?file_id=$FILE_ID" \
-H "Authorization: Bearer $TOKEN" \
--output "$FILE_ID.bin"
curl "https://xuwuai.com/minimaxi/v1/files/retrieve?file_id=$FILE_ID" \
-H "Authorization: Bearer $TOKEN"