---
title: "Create a live API key"
method: POST
path: "/v1/me/api-keys"
tags: ["Account"]
---

# Create a live API key

`POST /v1/me/api-keys`

## Request

- Base URL: `https://api.vatnode.dev`
- URL: `https://api.vatnode.dev/v1/me/api-keys`
- Auth: API key in cookie `better-auth.session_token`

Mints a new live API key. The full secret is returned exactly once in
this response and never again – store it securely.

## Request body

- object
  - `label` string, required

## Response `201`

The created key, including the full secret (shown once).

- ApiKeyCreated
  - `id` string, required
  - `key` string, required: The full API key secret. Returned only once, at creation.
  - `label` string, required
  - `keyPreview` string, required
  - `environment` 'live', required
  - `createdAt` string, date-time, required
  - `message` string, required

## Other responses

- `400`: The request body, query string or path parameters failed structural validation (wrong type, missing required field, out-of-range length, malformed enum, etc.). Returns the standard error envelope with code `INVALID_REQUEST`. This is distinct from a semantically well-formed request that is rejected later (e.g. `INVALID_FORMAT` for a VAT ID that parses but is not a valid VAT number).
- `401`: No valid session (`UNAUTHORIZED`), or the account has been deleted (`ACCOUNT_DELETED`).
- `422`: The plan’s API-key limit has been reached (`KEY_LIMIT_REACHED`).
- `500`: Key creation failed (`CREATION_FAILED`).
- `503`: The database is temporarily unavailable (`DB_UNAVAILABLE`).

---

[API](https://skmtc.dev/vatnode/apis/vatnode-api.md) · [All operations](https://skmtc.dev/vatnode/apis/vatnode-api/llms.txt) · [OpenAPI document](https://skmtc.dev/vatnode/apis/vatnode-api/revisions/c65828db2037?raw)
