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

# Create a new API key

`POST /me/keys`

## Request

- Base URL: `https://api.emile.wine` (the document declares no server; this is the origin it was published from)
- URL: `https://api.emile.wine/me/keys`
- Auth: HTTP bearer

Returns the plaintext key ONCE. Subsequent reads only expose the prefix.

## Headers

- `X-API-Key` string, nullable

## Request body

- CreateKeyRequest
  - `name` string, required

## Response `201`

Successful Response

- CreateKeyResponse
  - `id` string, uuid, required
  - `name` string, required
  - `key` string, required
  - `prefix` string, required
  - `created_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

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