---
title: GET /user/api-keys
description: "List your API keys, or read one key's usage — Without query parameters, returns every API key on your account, newest first."
full: true
---

**Auth:** required. Send a signed-in session token (`Authorization: Bearer …`) or the session cookie (browser sessions). See [Authentication](/docs/api/authentication).

Without query parameters, returns every API key on your account, newest first. The
secret itself is never returned; `keyPrefix` identifies a key. Pass `keyId` (the key's
`id`) together with `usage=true` to get that key's request counts for the last 7 and 30
days, its most-called endpoints and its error rate instead.

Needs a signed-in browser session: the route reads identity from the signed-in session only,
so an `ivy_` API key gets `401`.

## Request

### Query parameters

- `keyId` (string (uuid)) —
The key's `id` (not its `keyId` display value). Requires `usage=true`.

- `usage` (enum (&quot;true&quot;)) —
Set to `true` with `keyId` to return usage statistics for that key.

## Responses

### `200` OK

Your keys, or one key's usage when `keyId` and `usage=true` are set

Response shape: `object | object`

### `401` Unauthorized

Authentication required

### `404` Not Found

No key with that `keyId` on your account (usage mode)

**curl**

```bash
curl -X GET 'https://ivybiosciences.com/api/user/api-keys' \
  -H "Authorization: Bearer $IVY_SESSION_TOKEN"
```

**JavaScript**

```js
const res = await fetch('https://ivybiosciences.com/api/user/api-keys', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${process.env.IVY_SESSION_TOKEN}`,
  },
});
const data = await res.json();
```

**Python**

```python
import os, requests

res = requests.get(
    "https://ivybiosciences.com/api/user/api-keys",
    headers={"Authorization": f"Bearer {os.environ['IVY_SESSION_TOKEN']}"},
)
data = res.json()
```
