Claim jobs

An executor's long poll for work: it names the machine it runs on, its devices and what its build runs, and is answered, within 25 seconds, one task it can run — a job's lead first; a join once its lead has said where it coordinates — or 204.

POST /v1/train/jobs/claim

Addresshttps://api.hanzo.ai/v1/train/jobs/claim
MethodPOST
Operationpost_train_jobs_claim
AuthAuthorization: Bearer $HANZO_API_KEY

An executor's long poll for work: it names the machine it runs on, its devices and what its build runs, and is answered, within 25 seconds, one task it can run — a job's lead first; a join once its lead has said where it coordinates — or 204. The answer carries the task's lease, once, which every report for the task must carry; the device-seconds held for it; and how often it must report. An executor acting as a principal of an org claims that org's tasks placed on its machine and can claim no other org's. A platform claim (SuperAdmin alone) is Hanzo's executor: it is answered a task of any org's job that names no machines, its first window held against the job's payer first, and the claim is put on the platform's audit trail.

Request

9 fields, body application/json (required).

FieldInTypeRequiredDescription
basesbodystring[]—Bases are the base models its trainer runs.
devicesbodystring[]—Devices are its accelerators, one entry per device: cuda, rocm, metal, vulkan, cpu.
machinebodystring—Machine is the machine claiming, by name: one of the org's linked machines, or for a platform claim the Hanzo host.
platformbodyboolean—Platform claims for Hanzo's executor: a task of any org's job that names no machines.
supportsbodytrain.Supports—
supports.adaptationsbodystring[]—Adaptations are the modes it runs.
supports.outputsbodystring[]—Outputs are the output kinds it produces.
supports.protectbodystring[]—Protect are the protections it runs: projection, distillation, capabilities.
supports.termsbodystring[]—Terms are the objective terms it runs.

Response

StatusBodyMeaning
200train.Assignmentok
defaultproblem-detailsrefused

200 body — 90 fields.

FieldInTypeAlwaysDescription
jobbodytrain.Job—
job.adaptationbodytrain.Adaptation—
job.adaptation.alphabodynumber (double)—Alpha is an adapter's scale.
job.adaptation.basisbodystring—Basis is a basis artifact, by sha256 or basis://<base>/<name>.
job.adaptation.chosebodytrain.Chose—
job.adaptation.chose.modebodystring—Mode is the mode the job runs.
job.adaptation.chose.whybodystring—Why says what decided it.
job.adaptation.modebodystring—Mode is full, readout (the head alone, over the frozen base), lora, qlora, basis or auto.
job.adaptation.rankbodyinteger (int64)—Rank is an adapter's rank, or how many of a basis's directions are used.
job.adaptation.residual_rankbodyinteger (int64)—ResidualRank is the rank of an orthonormal residual learned beside a basis's coefficients; 0 trains the coefficients alone.
job.adaptation.sourcesbodystring[]—Sources are lora artifacts (sha256) a basis is built from, in place of Basis.
job.adaptation.targetsbodystring[]—Targets are the modules an adapter or a basis attaches to.
job.artifactsbodytrain.artifact[]—Artifacts are its outputs.
job.artifacts[].createdbodyinteger (int64)—Created is when it was registered, unix seconds.
job.artifacts[].jobbodystring—Job is the job that produced it; empty for an upload.
job.artifacts[].kindbodystring—Kind is checkpoint, lora, capability, basis or merged, or dataset for an upload.
job.artifacts[].metabodyany—Meta describes it: its base and revision, its modules, a basis's address.
job.artifacts[].namebodystring—Name labels it.
job.artifacts[].sha256bodystring—SHA256 is the hex digest of its bytes, and its name in the object store.
job.artifacts[].sizebodyinteger (int64)—Size is its byte count.
job.artifacts[].statebodystring—State is pending until its bytes are read back, then stored; deleted once the org deleted it or it outlived its retention unpublished.
job.base_modelbodystring—
job.createdbodyinteger (int64)—Created, Started and Ended are unix seconds; 0 is not yet.
job.created_bybodystring—CreatedBy is the principal that created it.
job.datasetbodytrain.Dataset—
job.dataset.splitsbodyobject—Splits maps a role (train, validation) to the dataset's own split name.
job.dataset.splits.*bodystring—
job.dataset.uribodystring—URI names the data.
job.endedbodyinteger (int64)—
job.errorbodystring—Error says why a job failed or stopped.
job.evaluationbodytrain.Evaluation—
job.evaluation.suitesbodystring[]—Suites are the suites the job is meant to improve.
job.frombodystring—
job.idbodystring—ID names the job.
job.objectivebodytrain.Objective—
job.objective.lossbodystring—Loss is cross_entropy.
job.objective.termsbodytrain.Term[]—Terms are added to each row's loss.
job.objective.terms[].kindbodystring—Kind names the term.
job.objective.terms[].marginbodynumber (double)—Margin is a hinge's margin, in logits.
job.objective.terms[].weightbodynumber (double)—Weight scales it; 0 is off.
job.outputbodytrain.Output—
job.output.kindbodystring—Kind is checkpoint, lora, capability, basis or merged.
job.output.namebodystring—Name labels it.
job.projectbodystring—Project is the creator's project scope.
job.protectbodytrain.Protect—
job.protect.budgetbodytrain.Budget—
job.protect.budget.accuracybodynumber (double)—Accuracy is the largest accuracy drop allowed.
job.protect.budget.ecebodynumber (double)—ECE is the largest calibration-error rise allowed.
job.protect.capabilitiesbodystring[]—Capabilities are capability artifacts, by sha256.
job.protect.distillationbodyboolean—Distillation adds KL to the base's answers on a preservation set drawn from the suites.
job.protect.projectionbodytrain.Projection—
job.protect.projection.strengthbodynumber (double)—Strength is λ in [0, 1]; absent is 1, the whole of P g removed.
job.protect.suitesbodystring[]—Suites are capabilities the base already has, by suite.
job.publishedbodyany—Published is the publish record, once published.
job.resourcesbodytrain.Resources—
job.resources.budgetbodyinteger (int64)—Budget bounds what the job's compute costs, in US cents; 0 is none beyond the payer's balance.
job.resources.devicesbodystring[]—Devices are the accelerator kinds the job may run on — cuda, rocm, metal, vulkan, cpu; none named is any its base runs.
job.resources.machinesbodystring[]—Machines are the org's linked machines by name; the first leads.
job.resources.max_secondsbodyinteger (int64)—MaxSeconds bounds the device-seconds the job's tasks use together; 0 is none.
job.resources.stepsbodyinteger (int64)—Steps bounds optimizer steps; 0 runs the plan.
job.resultbodyany—Result is the lead's evaluation and verdict, once reported.
job.revisionbodystring—
job.startedbodyinteger (int64)—
job.statusbodystring—Status is queued, running, evaluating, succeeded, rejected, failed, cancelled or stopped.
job.tasksbodytrain.TaskView[]—Tasks are its units of execution.
job.tasks[].devicebodystring—Device is the accelerator class it runs on — gpu or cpu — and Devices how many.
job.tasks[].devicesbodyinteger (int64)—
job.tasks[].heldbodyinteger (int64)—
job.tasks[].hostbodystring—Host is the machine that claimed it.
job.tasks[].idbodystring—ID names the task.
job.tasks[].machinebodystring—Machine is the machine it was placed on, or empty for any.
job.tasks[].rolebodystring—Role is lead or join.
job.tasks[].secondsbodyinteger (int64)—Seconds are the device-seconds its reports metered, and Held those held for it.
job.tasks[].seenbodyinteger (int64)—Seen is its last report, unix seconds.
job.tasks[].statusbodystring—Status is open, claimed, done or lost.
job.usagebodytrain.Usage—
job.usage.cost_micro_usdbodyinteger (int64)—CostMicroUSD is what Seconds were charged, in micro-USD: 0 on the org's own machines.
job.usage.heldbodyinteger (int64)—Held are the device-seconds held beyond Seconds; 0 once it ended.
job.usage.secondsbodyinteger (int64)—Seconds are the device-seconds used.
orgbodystring—Org is the job's org.
taskbodytrain.Claimed—
task.coordinatorbodystring—Coordinator is where a join task reaches its lead.
task.devicebodystring—Device is the accelerator kind it runs on, and Devices how many of them.
task.devicesbodyinteger (int64)—
task.heldbodyinteger (int64)—Held is the device-seconds held for it.
task.idbodystring—ID names the task.
task.jobbodystring—Job names its job.
task.leasebodystring—Lease authenticates every report for the task; it is answered once.
task.reportbodyinteger (int64)—Report is the most seconds that may pass between its reports.
task.rolebodystring—Role is lead or join.

Failure carries the platform error shape — see Errors.

Examples

hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.

import { Configuration, TrainApi } from 'hanzoai';

const api = new TrainApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postTrainJobsClaim({ bases: ["<bases>"], devices: ["<devices>"] });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import TrainApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = TrainApi(client).post_train_jobs_claim(bases=["<bases>"], devices=["<devices>"])
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.TrainAPI.PostTrainJobsClaim(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, train_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = train_api::post_train_jobs_claim(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.TrainApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new TrainApi(client).postTrainJobsClaim();
curl -X POST https://api.hanzo.ai/v1/train/jobs/claim \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "bases": [
         "<bases>"
       ],
       "devices": [
         "<devices>"
       ]
     }'

MCP declares no tool for train — tools/list on https://api.hanzo.ai/v1/mcp names the products it does reach. Use HTTP or an SDK.


Train API · All Hanzo APIs · Interactive reference

Was this page useful?