Revokes the caller's own API key of the requested class.
Revokes the caller's own API key of the requested class.
DELETE /v1/account/keys
| Address | https://api.hanzo.ai/v1/account/keys |
| Method | DELETE |
| Operation | delete_account_keys |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Revokes the caller's own API key of the requested class. The class is
the same field mint takes — ?type=publishable, defaulting to secret — so
revoking the key that ships in a browser bundle does not sign its holder out of
their own API: the other key keeps working.
Revoking is how a key is replaced when it does not need replacing; minting the same class again rotates it in one step. IAM drops the credential immediately, but the gateway caches keys for a few minutes, so a request that beat the cache expiry may still be served.
For callers written against the older shape, the class is also accepted in a JSON
request body, read only when ?type= is absent.
Request
1 field.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
type | query | string | — | Type 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
| Status | Body | Meaning |
|---|---|---|
200 | revokedKey | ok |
200 body — 2 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
ok | body | boolean | — | OK is true when the key was revoked. |
type | body | string | — | Type is the key class that was revoked, resolved — so a caller that named nothing can see it revoked the secret key. |
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.deleteAccountKeys();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).delete_account_keys()cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.AccountAPI.DeleteAccountKeys(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::delete_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).deleteAccountKeys();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 -X DELETE 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?