---
title: "Create API key"
method: POST
path: "/api/api-keys"
tags: ["API Keys"]
---

# Create API key

`POST /api/api-keys`

## Request

- Base URL: `https://api.zvid.io`
- URL: `https://api.zvid.io/api/api-keys`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

Generate a new API key for the authenticated user

## Request body

- object
  - `name` string, required: Name for the API key

## Response `201`

API key created successfully

- ApiKeyCreated
  - `id` integer, required
  - `apiKey` string, required: Full API key (only shown once)
  - `name` string, required
  - `keyPrefix` string, required: Stored prefix derived from the key
  - `created` boolean, required

## Other responses

- `400`: Validation error or business error (e.g. duplicate name)
- `401`: Unauthorized

---

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