Hanzo
OpenapiAccount

Creates — or rotates — the caller's API key of the requested type and returns…

Creates — or rotates — the caller's API key of the requested type and returns it ONCE. A real IAM failure surfaces as 502, never a fabricated key.

POST /v1/account/keys

Addresshttps://api.hanzo.ai/v1/account/keys
MethodPOST
Operationpost_account_keys
AuthAuthorization: Bearer $HANZO_API_KEY

Creates — or rotates — the caller's API key of the requested type and returns it ONCE. A real IAM failure surfaces as 502, never a fabricated key.

Rotating is what creating means here: a user holds one key per type, so the endpoint is idempotent by (caller, type) and the superseded credential stops working. Two live secrets for one user would make "revoke my key" a lie.

Request

2 fields, body application/json (required).

FieldInTypeRequiredDescription
limitbodystring[]Limit narrows what the minted key may reach, as kind:name entries: model:zen5, project:acme, product:commerce, or model:* for a whole kind.
typebodystringType is the key class to act on: "secret" (sk-, session-equivalent, belongs on a server) or "publishable" (pk-, org-identifying, safe in a browser bundle).

Response

StatusBodyMeaning
200mintedKeyok

200 body — 4 fields.

FieldInTypeAlwaysDescription
accessKeybodystringAccessKey is the same value under its predecessor name, carried so callers written against the older field keep working.
keybodystringKey is the credential, returned ONCE — a secret key is unreadable afterwards.
limitbodystring[]Limit is what the minted key may reach, echoed back so the caller can see the narrowing took.
typebodystringType is the class of key that was minted.

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.


Account API · All Hanzo APIs · Interactive reference

How is this guide?

On this page