Cancel or delete video generation task
curl --request DELETE \
--url https://api.minimax.io/v2/video_generation/{task_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.minimax.io/v2/video_generation/{task_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.minimax.io/v2/video_generation/{task_id}', 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/v2/video_generation/{task_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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://api.minimax.io/v2/video_generation/{task_id}"
req, _ := http.NewRequest("DELETE", 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.delete("https://api.minimax.io/v2/video_generation/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.minimax.io/v2/video_generation/{task_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"task_id": "424010985738629",
"action": "cancel",
"status": "cancelled"
}{
"type": "error",
"error": {
"type": "bad_request_error",
"message": "invalid params (2013)",
"http_code": "400"
},
"request_id": "021785229015510a2c883cf675b9804d"
}{
"type": "error",
"error": {
"type": "authorized_error",
"message": "login fail: Please carry the API secret key in the 'Authorization' field of the request header (1004)",
"http_code": "401"
},
"request_id": "021785229015510a2c883cf675b9804d"
}{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "rate limit, please retry later (1002)",
"http_code": "429"
},
"request_id": "021785229015510a2c883cf675b9804d"
}{
"type": "error",
"error": {
"type": "server_error",
"message": "internal error (1000)",
"http_code": "500"
},
"request_id": "021785229015510a2c883cf675b9804d"
}MiniMax-H3
Cancel or Delete Video Generation Task
Cancel (queued) or delete (terminal state) a video generation task based on its status.
DELETE
/
v2
/
video_generation
/
{task_id}
Cancel or delete video generation task
curl --request DELETE \
--url https://api.minimax.io/v2/video_generation/{task_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.minimax.io/v2/video_generation/{task_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.minimax.io/v2/video_generation/{task_id}', 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/v2/video_generation/{task_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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://api.minimax.io/v2/video_generation/{task_id}"
req, _ := http.NewRequest("DELETE", 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.delete("https://api.minimax.io/v2/video_generation/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.minimax.io/v2/video_generation/{task_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"task_id": "424010985738629",
"action": "cancel",
"status": "cancelled"
}{
"type": "error",
"error": {
"type": "bad_request_error",
"message": "invalid params (2013)",
"http_code": "400"
},
"request_id": "021785229015510a2c883cf675b9804d"
}{
"type": "error",
"error": {
"type": "authorized_error",
"message": "login fail: Please carry the API secret key in the 'Authorization' field of the request header (1004)",
"http_code": "401"
},
"request_id": "021785229015510a2c883cf675b9804d"
}{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "rate limit, please retry later (1002)",
"http_code": "429"
},
"request_id": "021785229015510a2c883cf675b9804d"
}{
"type": "error",
"error": {
"type": "server_error",
"message": "internal error (1000)",
"http_code": "500"
},
"request_id": "021785229015510a2c883cf675b9804d"
}This endpoint automatically performs a cancel or delete based on the task’s current status, as follows:
| Task status | Action | Description |
|---|---|---|
queued | cancel | Cancel the task; generation has not started, no charge |
succeeded | delete | Delete the task record |
failed | delete | Delete the task record |
expired | delete | Delete the task record |
running | — | Not allowed, returns an error (cannot cancel while generating) |
cancelled | — | Not allowed, returns an error |
Authorizations
HTTP: Bearer Auth
- Security Scheme Type: http
- HTTP Authorization Scheme:
Bearer API_key, used to verify account information, can be found in Account Management>API Keys.
Path Parameters
ID of the video generation task to cancel or delete.
⌘I