---
title: "Create Api Key"
method: POST
path: "/admin/keys"
tags: ["Admin"]
---

# Create Api Key

`POST /admin/keys`

## Request

- Base URL: `https://api.kolens.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.kolens.ai/admin/keys`
- Auth: none declared

Generate a new API key.
Call this once per new user/subscriber.
Requires X-Admin-Secret header matching SECRET_KEY env var.

## Headers

- `x-admin-secret` string, nullable

## Request body

- CreateKeyRequest
  - `label` string
  - `user_id` string

## Response `200`

Successful Response

- CreateKeyResponse
  - `key` string, required
  - `label` string, required
  - `message` string, required

## Other responses

- `422`: Validation Error

---

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