Cancel or Delete a Video Generation Task
curl --request DELETE \
--url https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{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.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{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.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{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.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{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.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{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{}BytePlus API Compat
Cancel or Delete a Video Generation Task
Cancel a queued video generation task, or delete a video generation task record.
DELETE
/
byteplus
/
api
/
v3
/
contents
/
generations
/
tasks
/
{id}
Cancel or Delete a Video Generation Task
curl --request DELETE \
--url https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{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.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{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.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{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.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{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.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{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{}Authorizations
Pass Authorization: Bearer <token> in the request header.
Path Parameters
The ID of the video generation task to cancel or delete.
The behavior of the DELETE endpoint varies by task status:
| Current Status | DELETE Supported | Behavior | Status After DELETE |
|---|---|---|---|
| queued | Yes | Cancel task queueing, task status changes to cancelled | cancelled |
| running | No | - | - |
| succeeded | Yes | Delete the video generation task record; subsequent queries will not be supported | - |
| failed | Yes | Delete the video generation task record; subsequent queries will not be supported | - |
| cancelled | No | - | - |
| expired | Yes | Delete the video generation task record; subsequent queries will not be supported | - |
Note: The above parameters are Query String Parameters, passed in the URL string.
Response
200 - application/json
This API has no response parameters.
⌘I