# List keys

URL: https://docs.hanzo.ai/docs/openapi/account/get-account-keys

> Returns the API keys the caller may see, newest first: their own, or every key the org holds when the caller administers it.

`GET /v1/account/keys`

> [Account →](https://docs.hanzo.ai/docs/openapi/account) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                        |
| ------------- | -------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/account/keys` |
| **Method**    | `GET`                                  |
| **Operation** | `get_account_keys`                     |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY` |

Returns the API keys the caller may see, newest first: their own, or
every key the org holds when the caller administers it. Each is its own
credential with its own name, prefix, status, expiry and limit. Revoked keys
stay listed. No secret material comes back; a publishable key, which is public
by construction, carries its full value.

## Request

`GET /v1/account/keys` takes no parameters and no body — the credential is the whole request.

## Response

| Status    | Body               | Meaning |
| --------- | ------------------ | ------- |
| `200`     | account.apiKeyList | ok      |
| `default` | problem-details    | refused |

`200` body — 21 fields.

| Field                 | In   | Type              | Always | Description                                                                                                                                                                        |
| --------------------- | ---- | ----------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `keys`                | body | account.apiKey\[] | —      | Keys is every key the caller may see, newest first: their own, or every key of the org when the caller administers it.                                                             |
| `keys[].budget`       | body | account.keyBudget | —      |                                                                                                                                                                                    |
| `keys[].budget.month` | body | integer (int64)   | —      | Month is per calendar month, UTC.                                                                                                                                                  |
| `keys[].budget.total` | body | integer (int64)   | —      | Total is over the key's whole life.                                                                                                                                                |
| `keys[].created`      | body | string            | —      | Created is when the key was minted (RFC 3339).                                                                                                                                     |
| `keys[].creator`      | body | string            | —      | Creator is the person the key speaks for, `&lt;org&gt;/&lt;user&gt;`: who created it.                                                                                              |
| `keys[].expires`      | body | string            | —      | Expires is when the key stops working (RFC 3339).                                                                                                                                  |
| `keys[].id`           | body | string            | —      | ID addresses this key in PATCH and DELETE /v1/account/keys/{id}.                                                                                                                   |
| `keys[].key`          | body | string            | —      | Key is the full credential.                                                                                                                                                        |
| `keys[].limit`        | body | string\[]         | —      | Limit is what this key may reach, as `kind:name` entries — `model:zen5`, `project:acme`, `product:train` (read and write), `read:billing` (read only), `read:*` (a read-only key). |
| `keys[].name`         | body | string            | —      | Name is the key's label, chosen by the person who made it.                                                                                                                         |
| `keys[].prefix`       | body | string            | —      | Prefix is the head of the credential this key's holder presents — the sk- of a secret key — enough to tell which string a row is, never enough to use.                             |
| `keys[].rate`         | body | integer (int64)   | —      | Rate is how many requests a minute the key may make.                                                                                                                               |
| `keys[].revoked`      | body | string            | —      |                                                                                                                                                                                    |
| `keys[].revoker`      | body | string            | —      | Revoker is who revoked the key, `&lt;org&gt;/&lt;user&gt;`, and Revoked when.                                                                                                      |
| `keys[].spend`        | body | account.keyBudget | —      |                                                                                                                                                                                    |
| `keys[].spend.month`  | body | integer (int64)   | —      | Month is per calendar month, UTC.                                                                                                                                                  |
| `keys[].spend.total`  | body | integer (int64)   | —      | Total is over the key's whole life.                                                                                                                                                |
| `keys[].status`       | body | string            | —      | Status is active, expired, revoked, or disabled (switched off in IAM).                                                                                                             |
| `keys[].type`         | body | string            | —      | Type is the key class: secret (sk-) or publishable (pk-).                                                                                                                          |
| `keys[].used`         | body | string            | —      | Used is when the key was last used (RFC 3339).                                                                                                                                     |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo account keys get
```

**SDK**

**.ts**

```ts
import { Configuration, AccountApi } from 'hanzoai';

const api = new AccountApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getAccountKeys();
```

**.py**

```python
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()
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.AccountAPI.GetAccountKeys(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::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?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.AccountApi;

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

var result = new AccountApi(client).getAccountKeys();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/account/keys \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

MCP reaches **account** through the `account` tool, which names its 6 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
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_account_appearance"
         }
       }
     }'
```

---

[Account API](https://docs.hanzo.ai/docs/openapi/account) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
