Train

The cloud's one training endpoint, /v1/train (HIP-1333): clients the caller drives on the engine, and jobs the org's linked machines or Hanzo's executor run, whose adaptation, protection, objective and output are fields and whose artifacts, bases and evaluations are what they produce.

Also for this capability: API · CLI · MCP · SDKs

The cloud's one training endpoint, /v1/train (HIP-1333): clients the caller drives on the engine, and jobs the org's linked machines or Hanzo's executor run, whose adaptation, protection, objective and output are fields and whose artifacts, bases and evaluations are what they produce.

Base URLhttps://api.hanzo.ai
Operations35
AuthAuthorization: Bearer $HANZO_API_KEY

Specification

Specification pending — no HIP in hanzoai/hips declares capability: train yet. What this capability serves is below, from the API document; what it is — the store it owns, how it meters, what it publishes — is written as a HIP under HIP-0139.

Four surfaces

SurfaceReaches this capability asCoverage
RESTtrain at its own prefix35 operations
CLIhanzo capabilities …35 of 35
SDKTrainApi in every published client35 methods
MCPtool train on https://api.hanzo.ai/v1/mcp35 operations, 11 under the document's own id — ask describe for the rest

Quickstart

export HANZO_API_KEY=sk-...   # console.hanzo.ai → API keys

Then the first call — a read that needs nothing but the key. GET /v1/capabilities, operation capabilitiesList:

hanzo capabilities list
import { Configuration, TrainApi } from 'hanzoai';

const api = new TrainApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.capabilitiesList();
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).capabilities_list()
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.TrainAPI.CapabilitiesList(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::capabilities_list(&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).capabilitiesList();
curl https://api.hanzo.ai/v1/capabilities \
  -H "Authorization: Bearer $HANZO_API_KEY"

Tool train, op capabilitiesList — 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": "train",
         "arguments": {
           "op": "capabilitiesList",
           "input": {}
         }
       }
     }'

Answers 200 with object — ok.

Endpoints

EndpointWhat it does
POST /v1/capabilities/{name}/disableTakes a capability's installed version out of the org's published set: its questions are answered by base Kai, bit for bit, from the next decision.
POST /v1/capabilities/{name}/publishInstalls a version in the org's published set, where ai attaches it to the org's decisions: the version's evaluation must have passed, and it must have been taught over the base Kai serves now.
POST /v1/capabilities/{name}/rollbackPuts the version installed before the installed one back in the org's published set: exactly that version's artifact, nothing retrained.
POST /v1/capabilities/{name}/trainTeaches a capability a new version from its corrections, on the CPU over the states its org's decisions captured: no row is encoded again.
GET /v1/capabilities/{name}Answers one capability: its versions with their evaluations, newest first, and what its installed version did live.
DELETE /v1/capabilities/{name}Deletes a capability and its versions; their artifacts go with the org's retention.
GET /v1/capabilities/captureAnswers whether the org's Kai decisions keep their states for its capabilities to learn from.
PUT /v1/capabilities/captureTurns capture on or off for the org's Kai decisions from the next one.
GET /v1/capabilities/correctionsAnswers every correction of the org's decisions, newest first, each captured (it can teach) or missing (its decision was made with capture off), and the questions they ask, each counted: what a capability is made from.
GET /v1/capabilitiesAnswers the org's capabilities by name, each with its state, its latest and installed versions, and what the installed one did live.
POST /v1/capabilitiesMakes a capability in draft from captured corrections of one question: that question (its key, type and labels) is the route it will be installed behind.
GET /v1/train/artifacts/{sha256}Answers one of the org's objects, as the list does, with an address that fetches its bytes for ten minutes once it is stored: how an executor reads an artifact:<sha256> dataset its job names, and how the org downloads what it uploaded.
DELETE /v1/train/artifacts/{sha256}Deletes one of the org's objects — an upload or a job's output — from the store: every artifact naming it then reads deleted, and its storage is no longer billed.
GET /v1/train/artifactsAnswers the org's objects — its uploads and its jobs' outputs, one per sha256 — with what produced each, whether it is published and when retention deletes it.
POST /v1/train/artifactsRecords rows the org is about to upload, named by the SHA-256 of their bytes, and answers the same grant an executor's artifact gets: a presigned PUT S3 accepts only with that checksum and length, encrypted under the org's key — a PUT per 64 MiB part over 64 MiB — or stored: true when the org already holds those bytes.
POST /v1/train/clients/{id}/forward_backwardAccumulates the gradients of a batch on the client.
POST /v1/train/clients/{id}/optim_stepApplies the optimizer to the accumulated gradients.
POST /v1/train/clients/{id}/sampleDecodes from the client's current weights.
POST /v1/train/clients/{id}/save_weightsWrites the client's adapter on the engine.
GET /v1/train/clients/{id}Answers one of the org's clients with its loss history.
DELETE /v1/train/clients/{id}Drops one of the org's clients and frees its memory on the engine.
GET /v1/train/clientsAnswers the org's live clients as the engine reports them.
POST /v1/train/clientsLoads base_model on the engine with a LoRA adapter and answers the client, loading; poll it until ready.
GET /v1/train/jobs/{id}/artifactsAnswers a job's artifacts — checkpoint, capability, lora, basis or merged, each named by the SHA-256 of its bytes — with a download address that lives ten minutes for each one stored.
POST /v1/train/jobs/{id}/artifactsRecords an output its executor is about to store, named by the SHA-256 of its bytes, and answers a presigned PUT for exactly that object under the org's prefix — S3 accepts it only with the checksum and encrypts it under the org's key — or, over 64 MiB, a presigned PUT per 64 MiB part, or stored: true when the org already holds those bytes.
POST /v1/train/jobs/{id}/cancelStops a job that has not ended.
GET /v1/train/jobs/{id}/eventsAnswers a job's events after a cursor — status changes, the coordinator's address, metrics, log lines, artifacts and the result — waiting up to wait seconds for the first new one, so a caller following a run holds one request at a time.
POST /v1/train/jobs/{id}/eventsAn executor's report for the task it holds: status changes, the lead's coordinator address, metrics, log lines, stored artifacts and, last, the lead's result.
GET /v1/train/jobs/{id}/metricsAnswers a job's metric series — loss, throughput and each validation suite's numbers as the executor reported them — one per name, each point [step, value, unix seconds].
POST /v1/train/jobs/{id}/publishPublishes a job's output under a name.
GET /v1/train/jobs/{id}Answers one job: what it asked for, its status and tasks, its artifacts, its result and verdict, and whether it was published.
POST /v1/train/jobs/claimAn 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.
GET /v1/train/jobsAnswers the org's jobs, newest first, narrowed by ?status=.
POST /v1/train/jobsCreates a job that teaches base_model one capability: the data, the objective, how the trained parameters are represented (adaptation), what they must not damage and by how much (protect), where it runs and how far (resources), the suites it is judged on (evaluation) and what it produces (output).
GET /v1/train/modelsAnswers each base the caller can train today, in one shape: the base, the methods it trains by (adaptations), where it runs (runs: Hanzo's devices or the org's machines) with what one device-second costs there in nano-USD, then the resources that run it (nouns), its executor and devices, and the protections, objective terms, outputs and dataset schemes it takes.

All Hanzo APIs · Interactive reference

Was this page useful?
Broken link or missing step? Drop it in #docs on Discord or open a PR.