Create register
Trades a pool's join secret for a runner identity and the token that authenticates every later call.
POST /v1/runner/register
| Address | https://api.hanzo.ai/v1/runner/register |
| Method | POST |
| Operation | post_runner_register |
| Auth | Authorization: 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).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
capabilities | body | string[] | — | Capabilities are the optional protocol behaviours this runner understands, e.g. |
ephemeral | body | boolean | — | Ephemeral declares that this runner takes ONE job and exits. |
labels | body | string[] | — | Labels are what a workflow's runs-on: will select this runner by. |
name | body | string | — | Name is what to call this runner. |
token | body | string | — | Token is the REGISTRATION secret, a different secret from the runner token the reply carries. |
version | body | string | — | Version is the runner build asking to register. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | runner.RegisterOut | ok |
default | problem-details | refused |
200 body — 8 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
runner | body | runner.Identity | — | |
runner.ephemeral | body | boolean | — | Ephemeral means the runner takes ONE job and exits, so the forge must not expect it back. |
runner.id | body | integer (int64) | — | ID is the forge's own row id for this runner. |
runner.labels | body | string[] | — | Labels are what a workflow's runs-on: selects this runner by. |
runner.name | body | string | — | Name is what a person calls this runner in the forge's UI. |
runner.token | body | string | — | Token is the secret that authenticates that handle. |
runner.uuid | body | string | — | UUID is the handle the runner presents on every later op. |
runner.version | body | string | — | Version is the runner build the forge last heard from. |
Failure carries the platform error shape — see Errors.
Examples
hanzo runner registerimport { 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();The method above is the one at the current release of the document. [email protected] (npm) was generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
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 56 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": "get_git"
}
}
}'How is this guide?