curl --request POST \
--url 'https://api.example.com/ai/jobs/{job_id}/cancel?HAIQU_API_KEY='import requests
url = "https://api.example.com/ai/jobs/{job_id}/cancel?HAIQU_API_KEY="
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/ai/jobs/{job_id}/cancel?HAIQU_API_KEY=', 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.example.com/ai/jobs/{job_id}/cancel?HAIQU_API_KEY=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/ai/jobs/{job_id}/cancel?HAIQU_API_KEY="
req, _ := http.NewRequest("POST", url, nil)
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.example.com/ai/jobs/{job_id}/cancel?HAIQU_API_KEY=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/ai/jobs/{job_id}/cancel?HAIQU_API_KEY=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"job_id": "<string>",
"status": "<string>",
"context": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Cancel Job
Cancel a submitted or running job.
Use this tool to stop work the caller no longer wants, for example a run submitted against the wrong device or with the wrong shot count. Cancelling takes effect immediately from the caller’s point of view; the worker container is stopped in the background.
When to Use:
- Call this when the user asks to stop, abort, or kill a job.
- Call this before resubmitting a corrected job, so the superseded one stops consuming quota.
Constraints:
- Cancelling an already finished job is a no-op that reports the existing terminal status rather than an error.
- Cancellation is not reversible. Use
restart_jobto run the same job again afterwards.
Notes:
- This is a billable-work control, so confirm the job identity with the user before calling it when more than one job is in flight.
Args: job_id: Job identifier returned by a prior MCP submission or listing tool. user: Authenticated user resolved from the API key. db: Active database session.
Returns: The job identifier, its status after the call, and a summary of what changed.
Raises:
HTTPException: Raised with 404 when the job is not available to the
caller.
curl --request POST \
--url 'https://api.example.com/ai/jobs/{job_id}/cancel?HAIQU_API_KEY='import requests
url = "https://api.example.com/ai/jobs/{job_id}/cancel?HAIQU_API_KEY="
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/ai/jobs/{job_id}/cancel?HAIQU_API_KEY=', 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.example.com/ai/jobs/{job_id}/cancel?HAIQU_API_KEY=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/ai/jobs/{job_id}/cancel?HAIQU_API_KEY="
req, _ := http.NewRequest("POST", url, nil)
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.example.com/ai/jobs/{job_id}/cancel?HAIQU_API_KEY=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/ai/jobs/{job_id}/cancel?HAIQU_API_KEY=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"job_id": "<string>",
"status": "<string>",
"context": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Path Parameters
Response
Successful Response
Represent the outcome of a job lifecycle action such as cancel or restart.
Attributes: job_id: Identifier of the affected job. status: Job status after the action was applied. context: Summary of what changed and the recommended next step.