Cancel jobs

Cancels a queued or running render in the caller's org.

POST /v1/compute/fleet/jobs/{id}/cancel

Addresshttps://api.hanzo.ai/v1/compute/fleet/jobs/{id}/cancel
MethodPOST
OperationcancelFleetJob
AuthAuthorization: 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).

FieldInTypeRequiredDescription
idpathstringyesID is the job (activity) id, from the URL path.
idbodystring—ID is the job (activity) id, from the URL path.
reasonbodystring—Reason is recorded on the cancellation; empty records "canceled from console".
runbodystring—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

StatusBodyMeaning
200compute.jobCanceledok
defaultproblem-detailsrefused

200 body — 2 fields.

FieldInTypeAlwaysDescription
canceledbodystring—Canceled is the job id that was canceled.
runbodystring—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 compute, 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": "compute",
         "arguments": {
           "op": "cancelFleetJob",
           "input": {
             "id": "<id>",
             "reason": "<reason>"
           }
         }
       }
     }'

Compute API · All Hanzo APIs · Interactive reference

Was this page useful?