Delete File
curl --request POST \
--url https://api.minimax.io/v1/files/delete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"file_id": "${file_id}",
"purpose": "t2a_async_input"
}
'import requests
url = "https://api.minimax.io/v1/files/delete"
payload = {
"file_id": "${file_id}",
"purpose": "t2a_async_input"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({file_id: '${file_id}', purpose: 't2a_async_input'})
};
fetch('https://api.minimax.io/v1/files/delete', 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://api.minimax.io/v1/files/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'file_id' => '${file_id}',
'purpose' => 't2a_async_input'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.minimax.io/v1/files/delete"
payload := strings.NewReader("{\n \"file_id\": \"${file_id}\",\n \"purpose\": \"t2a_async_input\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
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.post("https://api.minimax.io/v1/files/delete")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"file_id\": \"${file_id}\",\n \"purpose\": \"t2a_async_input\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.minimax.io/v1/files/delete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"file_id\": \"${file_id}\",\n \"purpose\": \"t2a_async_input\"\n}"
response = http.request(request)
puts response.read_body{
"file_id": "${file_id}",
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}File Management
Delete File
Delete files on the MiniMax API Platform.
POST
/
v1
/
files
/
delete
Delete File
curl --request POST \
--url https://api.minimax.io/v1/files/delete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"file_id": "${file_id}",
"purpose": "t2a_async_input"
}
'import requests
url = "https://api.minimax.io/v1/files/delete"
payload = {
"file_id": "${file_id}",
"purpose": "t2a_async_input"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({file_id: '${file_id}', purpose: 't2a_async_input'})
};
fetch('https://api.minimax.io/v1/files/delete', 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://api.minimax.io/v1/files/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'file_id' => '${file_id}',
'purpose' => 't2a_async_input'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.minimax.io/v1/files/delete"
payload := strings.NewReader("{\n \"file_id\": \"${file_id}\",\n \"purpose\": \"t2a_async_input\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
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.post("https://api.minimax.io/v1/files/delete")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"file_id\": \"${file_id}\",\n \"purpose\": \"t2a_async_input\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.minimax.io/v1/files/delete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"file_id\": \"${file_id}\",\n \"purpose\": \"t2a_async_input\"\n}"
response = http.request(request)
puts response.read_body{
"file_id": "${file_id}",
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}Authorizations
HTTP: Bearer Auth
- Security Scheme Type: http
- HTTP Authorization Scheme:
Bearer API_key, can be found in Account Management>API Keys.
Headers
The media type of the request body. Must be set to application/json to ensure the data is sent in JSON format.
Available options:
application/json Body
application/json
⌘I