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

# Create Api Key

`POST /internal/api-keys/generate`

Create a new API key for a user.

This endpoint requires internal API key authentication.
The returned API key should be saved securely as it cannot be retrieved again.

## Headers

- `x-api-key` string, required — Internal API Key for authentication

## Request body

- CreateApiKeyRequest
  - `name` string, nullable — Optional friendly name for the key

## Response `200`

Successful Response

- CreateApiKeyResponse
  - `api_key` string, required — The newly created API key (show only once)
  - `key_id` string, required — The key ID for management purposes

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/mirage/apis/mirage-video-api.md) · [All operations](https://skmtc.net/mirage/apis/mirage-video-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mirage/mirage-video-api/versions/302cafad9d70/schema)
