Returns the caller's own API keys — every type they hold, read AUTHORITATIVELY…
Returns the caller's own API keys — every type they hold, read AUTHORITATIVELY from IAM rather than from the session claim, which lags a key minted…
GET /v1/account/keys
| Address | https://api.hanzo.ai/v1/account/keys |
| Method | GET |
| Operation | get_account_keys |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Returns the caller's own API keys — every type they hold, read AUTHORITATIVELY from IAM rather than from the session claim, which lags a key minted moments ago. No secret material comes back: a secret key is represented by its prefix, and only a publishable key (public by construction) carries its full value.
A transient IAM read failure reports an empty set rather than a 5xx, so the page shows the honest empty state and never a fabricated key.
Request
GET /v1/account/keys takes no parameters and no body — the credential is the whole request.
Response
| Status | Body | Meaning |
|---|---|---|
200 | apiKeyList | ok |
200 body — 6 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
keys | body | apiKey[] | — | Keys is every key the caller holds, at most one per type. |
keys[].createdAt | body | string | — | CreatedAt is when the key last changed, as IAM records it. |
keys[].key | body | string | — | Key is the FULL value, and is present for a publishable key only: it is public by construction and useless to its holder if it cannot be read back. |
keys[].limit | body | string[] | — | Limit is what this key may reach, as kind:name entries — model:zen5, project:acme, product:commerce. |
keys[].prefix | body | string | — | Prefix is the recognizable, non-secret head of the key — enough to tell two keys apart, never enough to use one. |
keys[].type | body | string | — | Type is the key class: secret (sk-) or publishable (pk-). |
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.
import { Configuration, AccountApi } from 'hanzoai';
const api = new AccountApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getAccountKeys();from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import AccountApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = AccountApi(client).get_account_keys()cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.AccountAPI.GetAccountKeys(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, account_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = account_api::get_account_keys(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.AccountApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new AccountApi(client).getAccountKeys();The method above is the one at the current release of the document. [email protected] (npm) and [email protected] (PyPI) were 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 https://api.hanzo.ai/v1/account/keys \
-H "Authorization: Bearer $HANZO_API_KEY"The door reaches account through the account tool, which names its 8 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": "get_appearance"
}
}
}'How is this guide?