---
title: "Create Api Key"
method: POST
path: "/api-key"
tags: ["Authentication"]
---

# Create Api Key

`POST /api-key`

Create a new API key for the authenticated user.

## Request body

- APIKeyCreateSchema — API Key creation schema.
  - `id` string, uuid, nullable — Optional unique identifier for the API Key.
  - `name` string, required — Name of the API Key.

## Response `200`

Successful Response

- APIKeySchema — API Key schema.
  - `id` string, uuid, required — Unique identifier for the API Key.
  - `name` string, required — Name of the API Key.
  - `secret_key` string, required — Secret key associated with the API Key.
  - `last_used` string, date-time, required — Timestamp indicating the last usage of the API Key.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/chat-fly/apis/chatfly-backend-application.md) · [All operations](https://skmtc.net/chat-fly/apis/chatfly-backend-application/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/chat-fly/chatfly-backend-application/revisions/cbb37496f138/schema)
