Create register

Trades a pool's join secret for a runner identity and the token that authenticates every later call.

POST /v1/runner/register

Addresshttps://api.hanzo.ai/v1/runner/register
MethodPOST
Operationpost_runner_register
AuthAuthorization: Bearer $HANZO_API_KEY

Trades a pool's join secret for a runner identity and the token that authenticates every later call. It is the one operation with no credential to check, because a runner has none until this answers.

The secret names the pool it opens, and a pool exists only because somebody declared it. A daemon that starts against capacity nobody declared is refused here, which is where the rule that pools are declared state actually holds.

Request

6 fields, body application/json (required).

FieldInTypeRequiredDescription
capabilitiesbodystring[]—Capabilities are the optional protocol behaviours this runner understands, e.g. "cancelling".
ephemeralbodyboolean—Ephemeral declares that this runner takes ONE job and exits.
labelsbodystring[]—Labels are what a workflow's runs-on: will select this runner by.
namebodystring—Name is what to call this runner.
tokenbodystring—Token is the REGISTRATION secret, a different secret from the runner token the reply carries.
versionbodystring—Version is the runner build asking to register.

Response

StatusBodyMeaning
200runner.RegisterOutok
defaultproblem-detailsrefused

200 body — 8 fields.

FieldInTypeAlwaysDescription
runnerbodyrunner.Identity—
runner.ephemeralbodyboolean—Ephemeral means the runner takes ONE job and exits, so the forge must not expect it back.
runner.idbodyinteger (int64)—ID is the forge's own row id for this runner.
runner.labelsbodystring[]—Labels are what a workflow's runs-on: selects this runner by.
runner.namebodystring—Name is what a person calls this runner in the forge's UI.
runner.tokenbodystring—Token is the secret that authenticates that handle.
runner.uuidbodystring—UUID is the handle the runner presents on every later op.
runner.versionbodystring—Version is the runner build the forge last heard from.

Failure carries the platform error shape — see Errors.

Examples

hanzo runner register
import { Configuration, GitApi } from 'hanzoai';

const api = new GitApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postRunnerRegister({ capabilities: ["<capabilities>"], ephemeral: false });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import GitApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = GitApi(client).post_runner_register(capabilities=["<capabilities>"], ephemeral=False)
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

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

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

let result = git_api::post_runner_register(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.GitApi;

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

var result = new GitApi(client).postRunnerRegister();
curl -X POST https://api.hanzo.ai/v1/runner/register \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "capabilities": [
         "<capabilities>"
       ],
       "ephemeral": false
     }'

MCP reaches git through the git tool, which names its 38 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_git_keys"
         }
       }
     }'

Git API · All Hanzo APIs · Interactive reference

Was this page useful?