OpenapiCompute
Cancel jobs
Cancels a queued or running render in the caller's org.
POST /v1/compute/fleet/jobs/{id}/cancel
| Address | https://api.hanzo.ai/v1/compute/fleet/jobs/{id}/cancel |
| Method | POST |
| Operation | cancelFleetJob |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Cancels a queued or running render in the caller's org. The engine cancel is org-scoped, so a tenant can only ever cancel its OWN job: a job in another tenant's shard is 404, exactly like one that never existed. An already-finished job is 409.
Request
4 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | ID is the job (activity) id, from the URL path. |
id | body | string | — | ID is the job (activity) id, from the URL path. |
reason | body | string | — | Reason is recorded on the cancellation; empty records "canceled from console". |
run | body | string | — | Run is the run id; empty defaults to the job id, which is what the dispatcher sets (runId == activityId == prompt_id), so the common case sends no body. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | compute.jobCanceled | ok |
default | problem-details | refused |
200 body — 2 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
canceled | body | string | — | Canceled is the job id that was canceled. |
run | body | string | — | Run is the run id the cancel was applied to. |
Failure carries the platform error shape — see Errors.
Examples
hanzo compute fleet jobs cancel <id>import { Configuration, ComputeApi } from 'hanzoai';
const api = new ComputeApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.cancelFleetJob({ id: 'id', id: "<id>", reason: "<reason>" });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import ComputeApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = ComputeApi(client).cancel_fleet_job(id='id', id="<id>", reason="<reason>")cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)
resp, _, err := client.ComputeAPI.CancelFleetJob(context.Background()).Execute()
if err != nil {
return err
}use hanzo_client::apis::{configuration::Configuration, compute_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = compute_api::cancel_fleet_job(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.ComputeApi;
ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));
var result = new ComputeApi(client).cancelFleetJob();curl -X POST https://api.hanzo.ai/v1/compute/fleet/jobs/<id>/cancel \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "<id>",
"reason": "<reason>"
}'Tool visor, op cancelFleetJob — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "visor",
"arguments": {
"op": "cancelFleetJob",
"input": {
"id": "<id>",
"reason": "<reason>"
}
}
}
}'How is this guide?