---
title: "Create an API key"
method: POST
path: "/api/v1/users/me/api-keys"
tags: ["Users & Profiles"]
---

# Create an API key

`POST /api/v1/users/me/api-keys`

## Request

- Base URL: `https://api.skills-hub.ai`
- URL: `https://api.skills-hub.ai/api/v1/users/me/api-keys`
- Auth: one of:
  - HTTP bearer
  - API key in header `Authorization`

Authenticated. Issues a new personal API key for the signed-in user with an optional `expiresInDays`. The plaintext key is returned only once in this response and cannot be retrieved again.

## Response `200`

Successful response. The returned fields are described in this endpoint's summary/description; typed per-field response schemas are being added incrementally.

- object: Newly created API key. The plaintext `key` is returned only once and cannot be retrieved again.
  - `id` string, required
  - `name` string, required
  - `keyPrefix` string, required: Non-secret display prefix, e.g. 'sh_abc123...'
  - `key` string, required: Full plaintext API key — shown only at creation.
  - `lastUsedAt` string, date-time, nullable, required
  - `expiresAt` string, date-time, nullable, required
  - `createdAt` string, date-time, required
  - `requestsLast30Days` integer, required: Metered requests attributed to this key over the trailing 30 UTC days. Always 0 at creation.

---

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