Cancel a queued job
curl --request POST \
--url https://api.blon.ai/v1/jobs/{id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.blon.ai/v1/jobs/{id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.blon.ai/v1/jobs/{id}/cancel', 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.blon.ai/v1/jobs/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.blon.ai/v1/jobs/{id}/cancel"
req, _ := http.NewRequest("POST", 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.post("https://api.blon.ai/v1/jobs/{id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blon.ai/v1/jobs/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "job",
"model": "<string>",
"status": "queued",
"provider_status": "<string>",
"queue_position": 123,
"cancelable": true,
"next_poll_after_seconds": 123,
"urls": {
"get": "<string>",
"cancel": "<string>"
},
"input": {},
"metadata": {},
"cost": {
"currency": "CREDITS",
"estimated": "<string>",
"charged": "<string>",
"refunded": "<string>"
},
"usage": [
{
"meter": "output_seconds",
"units": 123
}
],
"artifacts": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"url": "<string>",
"url_expires_at": "<string>",
"content_type": "<string>",
"size_bytes": 123,
"width": 123,
"height": 123,
"duration_ms": 123
}
],
"expires_at": "<string>",
"error": {
"code": "content_policy",
"message": "<string>",
"retryable": true
},
"webhook": {
"url": "<string>",
"status": "pending",
"attempts": 123
},
"idempotency_hit": true,
"request_id": "<string>",
"created_at": "<string>",
"started_at": "<string>",
"completed_at": "<string>",
"updated_at": "<string>"
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}API Reference
Cancel a queued job
POST
/
jobs
/
{id}
/
cancel
Cancel a queued job
curl --request POST \
--url https://api.blon.ai/v1/jobs/{id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.blon.ai/v1/jobs/{id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.blon.ai/v1/jobs/{id}/cancel', 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.blon.ai/v1/jobs/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.blon.ai/v1/jobs/{id}/cancel"
req, _ := http.NewRequest("POST", 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.post("https://api.blon.ai/v1/jobs/{id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blon.ai/v1/jobs/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "job",
"model": "<string>",
"status": "queued",
"provider_status": "<string>",
"queue_position": 123,
"cancelable": true,
"next_poll_after_seconds": 123,
"urls": {
"get": "<string>",
"cancel": "<string>"
},
"input": {},
"metadata": {},
"cost": {
"currency": "CREDITS",
"estimated": "<string>",
"charged": "<string>",
"refunded": "<string>"
},
"usage": [
{
"meter": "output_seconds",
"units": 123
}
],
"artifacts": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"url": "<string>",
"url_expires_at": "<string>",
"content_type": "<string>",
"size_bytes": 123,
"width": 123,
"height": 123,
"duration_ms": 123
}
],
"expires_at": "<string>",
"error": {
"code": "content_policy",
"message": "<string>",
"retryable": true
},
"webhook": {
"url": "<string>",
"status": "pending",
"attempts": 123
},
"idempotency_hit": true,
"request_id": "<string>",
"created_at": "<string>",
"started_at": "<string>",
"completed_at": "<string>",
"updated_at": "<string>"
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}授權
bearerapiKey
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
路徑參數
回應
Canceled.
Allowed value:
"job"可用選項:
queued, processing, completed, failed, canceled The upstream provider's own status, verbatim.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes