---
title: "POST /api-key/create"
method: POST
path: "/api-key/create"
tags: ["Api-key"]
---

# POST /api-key/create

`POST /api-key/create`

Create a new API key for a user

## Request body

- object
  - `configId` unknown
  - `name` unknown
  - `expiresIn` string, required
  - `prefix` unknown
  - `remaining` string, required
  - `metadata` unknown
  - `refillAmount` unknown
  - `refillInterval` unknown
  - `rateLimitTimeWindow` unknown
  - `rateLimitMax` unknown
  - `rateLimitEnabled` unknown
  - `permissions` unknown
  - `userId` unknown
  - `organizationId` unknown

## Response `200`

API key created successfully

- object
  - `id` string, required — Unique identifier of the API key
  - `createdAt` string, date-time, required — Creation timestamp
  - `updatedAt` string, date-time, required — Last update timestamp
  - `name` string, nullable — Name of the API key
  - `prefix` string, nullable — Prefix of the API key
  - `start` string, nullable — Starting characters of the key (if configured)
  - `key` string, required — The full API key (only returned on creation)
  - `enabled` boolean, required — Whether the key is enabled
  - `expiresAt` string, date-time, nullable — Expiration timestamp
  - `referenceId` string, required — ID of the reference owning the key
  - `lastRefillAt` string, date-time, nullable — Last refill timestamp
  - `lastRequest` string, date-time, nullable — Last request timestamp
  - `metadata` object, nullable — Metadata associated with the key
  - `rateLimitMax` number, nullable — Maximum requests in time window
  - `rateLimitTimeWindow` number, nullable — Rate limit time window in milliseconds
  - `remaining` number, nullable — Remaining requests
  - `refillAmount` number, nullable — Amount to refill
  - `refillInterval` number, nullable — Refill interval in milliseconds
  - `rateLimitEnabled` boolean, required — Whether rate limiting is enabled
  - `requestCount` number, required — Current request count in window
  - `permissions` object, nullable — Permissions associated with the key

## Other responses

- `400` — Bad Request. Usually due to missing parameters, or invalid parameters.
- `401` — Unauthorized. Due to missing or invalid authentication.
- `403` — Forbidden. You do not have permission to access this resource or to perform this action.
- `404` — Not Found. The requested resource was not found.
- `429` — Too Many Requests. You have exceeded the rate limit. Try again later.
- `500` — Internal Server Error. This is a problem with the server that you cannot fix.

## Changes

- **2026-03-04** `298877d6a79a` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/usekaneo/apis/kaneo-api/changes/api-key/create/post.md)

---

[API](https://skmtc.dev/usekaneo/apis/kaneo-api.md) · [All operations](https://skmtc.dev/usekaneo/apis/kaneo-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/usekaneo/kaneo-api/revisions/298877d6a79a/schema)
