List link

Lists your linked accounts and the devices they sit on.

GET /v1/link

Addresshttps://api.hanzo.ai/v1/link
MethodGET
Operationget_link
AuthAuthorization: Bearer $HANZO_API_KEY

Lists your linked accounts and the devices they sit on.

It answers the caller's own links plus a devices projection of the same rows folded per machine — the cross-machine "AI Providers / Accounts" view. A device is a projection, not a stored entity: its labels come from its most-recently-seen account, so there is no device to create and none to garbage-collect. Revoked links are INCLUDED rather than dropped, because a logged-out account keeps its usage history and audit trail. Scoped to the caller: a validated principal and a non-empty org, else 403.

Request

GET /v1/link takes no parameters and no body — the credential is the whole request.

Response

StatusBodyMeaning
200link.linkListok
defaultproblem-detailsrefused

200 body — 38 fields.

FieldInTypeAlwaysDescription
devicesbodylink.deviceView[]—Devices is the same rows folded per machine — the cross-machine "AI Providers / Accounts" view.
devices[].accountsbodylink.linkView[]—Accounts is every account the caller has signed in on this machine.
devices[].accounts[].accountbodystring—Account is the provider-side account identifier, when the collector knows it.
devices[].accounts[].billingbodystring—Billing is how this account's inference bills — plan (the user's own subscription, metered here for visibility only) or commerce (the gateway path).
devices[].accounts[].createdAtbodystring—CreatedAt is when the link was first registered, RFC 3339 UTC.
devices[].accounts[].hostbodystring—Host is the machine's human hostname label, from its most recent report.
devices[].accounts[].idbodystring—ID is the link's opaque handle ("link_" + 32 hex chars).
devices[].accounts[].kindbodystring—Kind is how the account authenticates: subscription or apikey.
devices[].accounts[].lastSeenbodystring—LastSeen is when the account last reported, RFC 3339 UTC.
devices[].accounts[].machinebodystring—Machine is the stable machine identifier the collector reports.
devices[].accounts[].osbodystring—OS is the machine's operating system label.
devices[].accounts[].planbodystring—Plan is the provider plan label (e.g. "Claude Max").
devices[].accounts[].providerbodystring—Provider is the AI provider this account belongs to (claude, openai, hanzo…).
devices[].accounts[].statusbodystring—Status is linked or revoked.
devices[].accounts[].updatedAtbodystring—UpdatedAt is when the link was last refreshed, RFC 3339 UTC.
devices[].accounts[].usagebodyany—Usage is the last good usage snapshot, clamped and re-serialized to known fields at ingest.
devices[].accounts[].userbodystring—User is the owning subject — the validated caller who registered the link.
devices[].activeSessionsbodyinteger (int64)—ActiveSessions is how many agent sessions the caller currently has running on this machine; 0 where the agent plane is not mounted.
devices[].hostbodystring—Host is the machine's hostname label, from its most-recently-seen account.
devices[].lastSeenbodystring—LastSeen is when any account on this machine last reported, RFC 3339 UTC.
devices[].machinebodystring—Machine is the stable machine identifier.
devices[].osbodystring—OS is the machine's operating system label.
linksbodylink.linkView[]—Links is every link the caller registered, newest first.
links[].accountbodystring—Account is the provider-side account identifier, when the collector knows it.
links[].billingbodystring—Billing is how this account's inference bills — plan (the user's own subscription, metered here for visibility only) or commerce (the gateway path).
links[].createdAtbodystring—CreatedAt is when the link was first registered, RFC 3339 UTC.
links[].hostbodystring—Host is the machine's human hostname label, from its most recent report.
links[].idbodystring—ID is the link's opaque handle ("link_" + 32 hex chars).
links[].kindbodystring—Kind is how the account authenticates: subscription or apikey.
links[].lastSeenbodystring—LastSeen is when the account last reported, RFC 3339 UTC.
links[].machinebodystring—Machine is the stable machine identifier the collector reports.
links[].osbodystring—OS is the machine's operating system label.
links[].planbodystring—Plan is the provider plan label (e.g. "Claude Max").
links[].providerbodystring—Provider is the AI provider this account belongs to (claude, openai, hanzo…).
links[].statusbodystring—Status is linked or revoked.
links[].updatedAtbodystring—UpdatedAt is when the link was last refreshed, RFC 3339 UTC.
links[].usagebodyany—Usage is the last good usage snapshot, clamped and re-serialized to known fields at ingest.
links[].userbodystring—User is the owning subject — the validated caller who registered the link.

Failure carries the platform error shape — see Errors.

Examples

hanzo auth link list
import { Configuration, LinkApi } from 'hanzoai';

const api = new LinkApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getLink();
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import LinkApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = LinkApi(client).get_link()
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

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

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

let result = link_api::get_link(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.LinkApi;

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

var result = new LinkApi(client).getLink();
curl https://api.hanzo.ai/v1/link \
  -H "Authorization: Bearer $HANZO_API_KEY"

MCP reaches link through the link tool, which names its 11 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_links"
         }
       }
     }'

Link API · All Hanzo APIs · Interactive reference

Was this page useful?