> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nodemaven.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API keys

> List, mint and revoke sub-keys for the account. Sub-keys are separate from your main account key, and every revoke is a soft delete.

The API keys endpoints manage **sub-keys**: additional keys you can mint under the account and revoke individually. A sub-key is not the same thing as your main account key, which lives in the dashboard under **Profile**, section **API key**, and is not managed through these endpoints.

All requests go to `https://api.nodemaven.com/api/v2/base/` and carry the header `Authorization: x-api-key YOUR_API_KEY`. See the [NodeMaven API overview](/proxy-api/overview) for the shared basics.

## Endpoints

| Method | Path | What it does | Request body | Responses |
| - | - | - | - | - |
| `GET` | `/api-keys` | List the account's sub-keys | | 200 |
| `POST` | `/api-keys` | Mint a new sub-key | `ApiKeyCreateRequest` | 201, 409, 422 |
| `POST` | `/api-keys/revoke-all` | Revoke every sub-key on the account (soft delete) | | 200 |
| `GET` | `/api-keys/{id}` | Retrieve a sub-key | | 200, 404 |
| `DELETE` | `/api-keys/{id}` | Revoke a sub-key (soft delete) | | 204 |

## Minting a sub-key

`ApiKeyCreateRequest` has two fields:

| Field | Type | Required | Notes |
| - | - | - | - |
| `name` | string | Yes | Maximum 255 characters |
| `expires_at` | date-time | No | Nullable. A null value means the sub-key has no expiry |

```bash theme={null}
curl -X POST https://api.nodemaven.com/api/v2/base/api-keys \
  -H "Authorization: x-api-key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Scraper worker",
    "expires_at": null
  }'
```

`expires_at` is optional, and because it is nullable you can set it explicitly to null to say the sub-key should not expire. Leaving it out has the same practical effect.

## Revoking

Both revoke operations are **soft deletes**, so the record is marked revoked rather than erased.

<Warning>
  **`POST /api-keys/revoke-all` revokes every sub-key on the account in one call.** Any integration authenticating with a sub-key stops working immediately. There is no per-key exemption and no undo exposed by this endpoint. Use `DELETE /api-keys/{id}` when you only mean to retire one.
</Warning>

```bash theme={null}
curl -X DELETE https://api.nodemaven.com/api/v2/base/api-keys/API_KEY_ID \
  -H "Authorization: x-api-key YOUR_API_KEY"
```

A successful single revoke returns 204, so no body comes back.

## Why a mint fails

`POST /api-keys` has two failure codes, and they mean different things:

| Code | Meaning |
| - | - |
| 409 | The account has reached its sub-keys limit. Revoke a sub-key you no longer need and mint again, or contact support about the limit |
| 422 | The request body was invalid |

In both cases the sub-key was not created.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.