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

# Create Api Key

`POST /api/v1/api-keys`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/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 retrieve it again.

Requires sufficient permissions based on your subscription tier.

## Headers

- `Authorization` string

## Request body

- CreateAPIKeyRequest: Request to create a new API key.
  - `name` string, required: Human-readable name for the key
  - `scope` string: Permission scope: read-only, read-write, or admin

## Response `201`

Successful Response

- StandardResponse: Standard API response wrapper.
  - `success` boolean, required
  - `data` unknown
  - `message` string, nullable
  - `error` string, nullable
  - `meta` object, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api.md) · [All operations](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api/llms.txt) · [OpenAPI document](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api/revisions/51c755fb5d0b?raw)
