---
title: "Create a named API key"
method: POST
path: "/me/api-keys"
tags: ["Accounts"]
---

# Create a named API key

`POST /me/api-keys`

## Request

- Base URL: `https://api.temp.md`
- URL: `https://api.temp.md/me/api-keys`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/temp-md/apis/temp-md-public-api/docs/me/api-keys/post.ts> (a function with typed inputs; its response is checked against the schema)

The raw token is returned once and stored only as a hash.

## Request body

- object
  - `name` string, required

## Response `201`

Key and one-time secret

- object
  - `key` ApiKey, required
    - `id` string, required
    - `name` string, required
    - `suffix` string, required
    - `status` 'active' | 'revoked', required
    - `createdAt` string, date-time, required
    - `lastUsedAt` string, date-time, nullable, required
    - `revokedAt` string, date-time, nullable, required
    - `current` boolean, required
  - `token` string, required
  - `message` string, required

## Other responses

- `400`: Invalid request
- `401`: Authentication required or invalid
- `409`: Request conflicts with current state
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/temp-md/apis/temp-md-public-api.md) - [All operations](https://skmtc.dev/temp-md/apis/temp-md-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/temp-md/apis/temp-md-public-api/revisions/4753682e1e3a?raw)
