---
title: "Create Api Key"
method: POST
path: "/api/v1/api-keys"
tags: ["api-keys"]
---

# Create Api Key

`POST /api/v1/api-keys`

## Request

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

Create a new API key.

The full API key is only returned once in this response.
Store it securely - you won't be able to see it again.

## Request body

- APIKeyCreate
  - `name` string, required
  - `description` string, nullable
  - `expires_at` string, date-time, nullable

## Response `201`

Successful Response

- APIKeyCreateResponse: Response when creating a new API key - includes the full key (only shown once).
  - `id` string, uuid, required
  - `name` string, required
  - `description` string, nullable, required
  - `key` string, required
  - `key_prefix` string, required
  - `expires_at` string, date-time, nullable, required
  - `created_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/mengi/apis/mengi-cloud.md) · [All operations](https://skmtc.dev/mengi/apis/mengi-cloud/llms.txt) · [OpenAPI document](https://skmtc.dev/mengi/apis/mengi-cloud/revisions/4ae9b375cdbb?raw)
