Hanzo
OpenapiLink

Registers a signed-in AI provider account on a machine.

Registers a signed-in AI provider account on a machine.

POST /v1/link

Addresshttps://api.hanzo.ai/v1/link
MethodPOST
Operationpost_link
AuthAuthorization: Bearer $HANZO_API_KEY

Registers a signed-in AI provider account on a machine.

It records that a developer has signed into one provider account on one machine — a Claude Max or ChatGPT Plus subscription, a Hanzo key, a raw provider key — and answers 201 with the stored link. Re-reporting the same (machine, provider, account) UPDATES that link rather than creating a second, so a collector may call this on every heartbeat. machine and provider are required (400 otherwise), as is a valid kind, and every field is length-bounded. Scoped to the caller: a validated principal and a non-empty org, else 403, so a caller writes only their OWN accounts within their own org.

Request

8 fields, body application/json (required).

FieldInTypeRequiredDescription
accountbodystringAccount is the provider-side account identifier.
hostbodystringHost is the machine's human hostname label.
kindbodystringKind decides how the account's inference BILLS and defaults to subscription: a subscription account bills the user's own monthly plan and is metered here for…
machinebodystringMachine is the stable machine identifier.
osbodystringOS is the machine's operating system label.
planbodystringPlan is the provider plan label (e.g.
providerbodystringProvider is the AI provider the account belongs to.
usagebodyanyUsage is an optional usage snapshot, clamped and re-serialized to known fields; omitting it keeps the last good one.

Response

StatusBodyMeaning
201linkViewcreated

201 body — 15 fields.

FieldInTypeAlwaysDescription
accountbodystringAccount is the provider-side account identifier, when the collector knows it.
billingbodystringBilling is how this account's inference bills — plan (the user's own subscription, metered here for visibility only) or commerce (the gateway path).
createdAtbodystringCreatedAt is when the link was first registered, RFC 3339 UTC.
hostbodystringHost is the machine's human hostname label, from its most recent report.
idbodystringID is the link's opaque handle ("link_" + 32 hex chars).
kindbodystringKind is how the account authenticates: subscription or apikey.
lastSeenbodystringLastSeen is when the account last reported, RFC 3339 UTC.
machinebodystringMachine is the stable machine identifier the collector reports.
osbodystringOS is the machine's operating system label.
planbodystringPlan is the provider plan label (e.g.
providerbodystringProvider is the AI provider this account belongs to (claude, openai, hanzo…).
statusbodystringStatus is linked or revoked.
updatedAtbodystringUpdatedAt is when the link was last refreshed, RFC 3339 UTC.
usagebodyanyUsage is the last good usage snapshot, clamped and re-serialized to known fields at ingest.
userbodystringUser is the owning subject — the validated caller who registered the link.

Failure carries the platform error shape — see Errors.

Examples

hanzo links create

Link API · All Hanzo APIs · Interactive reference

How is this guide?

On this page