# List API keys

`GET https://my.neuronai.uz/api/v1/api-keys`

API reference › API keys

Lists your organization's API keys, newest first, revoked ones included.

**Authentication:** `Authorization: Bearer <API key>`, a key with `api_keys:read`.

## Query parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | integer \| null | No | Keys per page, from 1 to 100. 50 by default. Minimum 1. Maximum 100. |
| `cursor` | string \| null | No | The `next_cursor` of the previous page. At most 512 characters. |

## Response (200, `application/json`)

Success.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | object[] | Yes |  |
| `data[].id` | string | Yes | A lowercase ULID. |
| `data[].name` | string | Yes |  |
| `data[].description` | string \| null | Yes |  |
| `data[].masked_key` | string | Yes | `nai_...` and the last four characters of the secret. |
| `data[].access` | string | Yes | How much a key may do. A `full` key holds every product at its highest level, products added later included, but never `api_keys`, which is only ever granted explicitly. A `restricted` key holds exactly the levels in its `permissions` map. One of `full`, `restricted`. |
| `data[].permissions` | object | Yes | The effective level for every product. A full key reads as what it can do; `api_keys` is only ever granted explicitly. |
| `data[].permissions.tts` | string | Yes | One of `none`, `read`, `write`. |
| `data[].permissions.voices` | string | Yes | One of `none`, `read`, `write`. |
| `data[].permissions.stt` | string | Yes | One of `none`, `write`. |
| `data[].permissions.llm` | string | Yes | One of `none`, `read`, `write`. |
| `data[].permissions.embeddings` | string | Yes | One of `none`, `write`. |
| `data[].permissions.rerank` | string | Yes | One of `none`, `write`. |
| `data[].permissions.account` | string | Yes | One of `none`, `read`. |
| `data[].permissions.api_keys` | string | Yes | One of `none`, `read`, `write`. |
| `data[].expires_at` | string \| null | Yes | When the key stops working, or `null` for never. |
| `data[].allowed_ips` | string[] | Yes | Addresses or CIDR ranges the key may be used from. Empty allows any address. |
| `data[].monthly_spend_limit` | number \| null | Yes | Credits per calendar month (UTC), or `null` for no limit. |
| `data[].spent_this_month` | number | Yes | Credits spent this calendar month (UTC). |
| `data[].enabled` | boolean | Yes |  |
| `data[].revoked_at` | string \| null | Yes |  |
| `data[].last_used_at` | string \| null | Yes |  |
| `data[].created_at` | string | Yes |  |
| `data[].secret` | string | No | The whole key. Only in the answer to a create, and never again. |
| `next_cursor` | string \| null | Yes |  |
| `request_id` | string | Yes |  |

```json
{
  "data": [
    {
      "id": "7c4a8d09-ca37-4f3c-9e2b-1b0f3c2a9d41",
      "name": "Aziza",
      "description": "string",
      "masked_key": "nai_••••••••3f9a",
      "access": "full",
      "permissions": {
        "tts": "none",
        "voices": "none",
        "stt": "none",
        "llm": "none",
        "embeddings": "none",
        "rerank": "none",
        "account": "none",
        "api_keys": "none"
      },
      "expires_at": "2026-11-17T09:30:00Z",
      "allowed_ips": [
        "203.0.113.10"
      ],
      "monthly_spend_limit": 500,
      "spent_this_month": 42.5,
      "enabled": true,
      "revoked_at": "2026-11-17T09:30:00Z",
      "last_used_at": "2026-11-17T09:30:00Z",
      "created_at": "2026-11-17T09:30:00Z",
      "secret": "nai_8xK2pQ7vR4tY9mW3nZ5b3f9a"
    }
  ],
  "next_cursor": "eyJpZCI6NDJ9",
  "request_id": "7c4a8d09-ca37-4f3c-9e2b-1b0f3c2a9d41"
}
```

### Headers

| Header | Type | Description |
| --- | --- | --- |
| `X-Request-Id` | string | Identifies this request. A JSON body carries it as `request_id` too; quote it to support. |
| `X-RateLimit-Limit` | integer | The requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused. |
| `X-RateLimit-Remaining` | integer | How many of them are left this minute. |

## Errors

Every error has the same JSON shape:

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_request",
    "message": "The request is malformed or failed validation.",
    "param": null
  },
  "request_id": "7c4a8d09-ca37-4f3c-9e2b-1b0f3c2a9d41"
}
```

| Status | Meaning |
| --- | --- |
| 401 | The API key is missing or not recognized (`invalid_api_key`), revoked (`api_key_revoked`), disabled (`api_key_disabled`) or expired (`api_key_expired`). |
| 403 | The key lacks the permission this endpoint needs (`insufficient_permissions`), or the client IP is not in its allowlist (`ip_not_allowed`). |
| 422 | The request failed validation (`invalid_request`). `error.fields` names each invalid field. |
| 429 | A rate or concurrency limit was reached (`rate_limit_exceeded`, `concurrency_limit_exceeded`). Retry after `Retry-After` seconds. |
| default | Any other error, in the same shape, such as `server_error` (500) or `service_unavailable` (503). |

## Examples

### TypeScript SDK

```typescript
import {NeuronAI} from "@naiuz/sdk";

const client = new NeuronAI();

for await (const key of client.apiKeys.list()) {
    console.log(key.id, key.name, key.masked_key);
}
```

### Python SDK

```python
from naiuz import NeuronAI

client = NeuronAI()

for key in client.api_keys.list():
    print(key.id, key.name, key.masked_key)
```

### PHP SDK

```php
$client = new \Naiuz\NeuronAI();

foreach ($client->apiKeys->list() as $key) {
    echo $key->id, ' ', $key->name, ' ', $key->masked_key, PHP_EOL;
}
```

---

Source: https://docs.neuronai.uz/api/reference/api-keys/list-api-keys
