Token mints a short-lived, pull-only registry token for exactly one of the…
Token mints a short-lived, pull-only registry token for exactly one of the org's images, through the same IAM realm the docker CLI authenticates against.
POST /v1/registry/token
| Address | https://api.hanzo.ai/v1/registry/token |
| Method | POST |
| Operation | post_registry_token |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Token mints a short-lived, pull-only registry token for exactly one of the
org's images, through the same IAM realm the docker CLI authenticates
against. The scope is pinned server-side to <org>/<image> with the pull
action — no field exists to name another org's image or ask for push. Use it
as Authorization: Bearer … on the OCI wire; it expires in minutes.
Request
1 field, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
image | body | string | — | Image is the repository name inside the org's namespace (e.g. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | registryToken | ok |
200 body — 3 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
expires | body | integer | — | Expires is the token's lifetime in seconds. |
ref | body | string | — | Ref is the one repository reference the token can pull. |
token | body | string | — | Token is the bearer to present on the OCI wire (Authorization: Bearer … against the host's /v2/ routes). |
Failure carries the platform error shape — see Errors.
Examples
hanzo registry tokenimport { Configuration, RegistryApi } from 'hanzoai';
const api = new RegistryApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postRegistryToken({ image: "<image>" });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import RegistryApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = RegistryApi(client).post_registry_token(image="<image>")cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.RegistryAPI.PostRegistryToken(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, registry_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = registry_api::post_registry_token(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.RegistryApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new RegistryApi(client).postRegistryToken();curl -X POST https://api.hanzo.ai/v1/registry/token \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image": "<image>"
}'The door reaches registry through the registry tool, which names its 5 operations with its own verbs — this one among them, under a name only the door 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_registry_images"
}
}
}'How is this guide?