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

# Create a new API key

`POST /v1/api-keys`

## Request

- Base URL: `https://api.algenta.ai`
- URL: `https://api.algenta.ai/v1/api-keys`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

## Request body

- CreateAPIKeyRequest
  - `label` string, required
  - `expires_at` string, date-time, nullable
  - `device_limit` integer, nullable

## Response `201`

Successful Response

- APIKeyCreated: Returned once at key creation — raw key shown here only.
  - `id` string, uuid, required
  - `label` string, required
  - `key_prefix` string, required
  - `device_limit` integer, required: Max registered devices for this key on the local runtime path. 0 preserves the plan's unlimited or no-local-runtime behavior.
  - `raw_key` string, required: The full API key — shown ONCE, store it securely.
  - `created_at` string, date-time, required
  - `expires_at` string, date-time, nullable

## Other responses

- `422`: Validation Error

---

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