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

# Create API key

`POST /keys/create`

Create a new API key. The full key is only returned once in the response.

## Request body

- KeyCreateRequest
  - `name` string, required
  - `scopes` string[]
  - `expires_in_days` integer

## Response `201`

Created API key.

- object
  - `data` ApiKey
    - `id` string, uuid
    - `key` string — Full API key (only returned on creation)
    - `name` string
    - `key_prefix` string
    - `scopes` string[]
    - `last_used_at` string, date-time, nullable
    - `expires_at` string, date-time, nullable
    - `created_at` string, date-time

## Other responses

- `400` — Validation error.
- `401` — Invalid or expired token.

---

[API](https://skmtc.dev/openwhispr/apis/openwhispr-api.md) · [All operations](https://skmtc.dev/openwhispr/apis/openwhispr-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/openwhispr/openwhispr-api/revisions/d1578f9ae6e5/schema)
