---
title: "Create an API key"
method: POST
path: "/v1/auth/keys"
tags: ["auth"]
---

# Create an API key

`POST /v1/auth/keys`

## Request

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

Generate a new API key. The plaintext key is returned only once in this response — store it securely. Requires the admin key.

## Headers

- `authorization` string

## Request body

- APIKeyCreate: Request schema for creating a new API key.
  - `name` string, required
  - `key_scope` string

## Response `201`

Successful Response

- APIKeyCreated: Response returned once on key creation — includes the plaintext key.
  - `id` integer, required
  - `name` string, required
  - `key_prefix` string, required
  - `is_active` boolean, required
  - `created_at` string, date-time, nullable
  - `key` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/techmanual/apis/techmanual-ai-api.md) · [All operations](https://skmtc.dev/techmanual/apis/techmanual-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/techmanual/apis/techmanual-ai-api/revisions/97e0fde41040?raw)
