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

# Create API key

`POST /api-keys`

## Request body

- object
  - `name` string

## Response `201`

API key created

- object
  - `id` string, required
  - `fullKey` string, required
  - `name` string, required
  - `prefix` string, required
  - `createdAt` string, date-time, required

## Other responses

- `401` — Unauthenticated
- `402` — Payment required. Returns a WWW-Authenticate header with an MPP challenge for pay-per-use endpoints, or indicates a subscription/credit issue for identity-authenticated endpoints.

## Changes

- **2026-04-25** `2adc33156b4b` — 2 warning, 4 info
  - added the new `insufficient_credits` enum value to the `error` response property for the response status `401`
  - added the new `no_credits` enum value to the `error` response property for the response status `401`
  - the endpoint scheme security `oauthBearer` was added to the API
  - added the non-success response with the status `402`
  - …2 more
- **2026-04-08** `d40c57a05527` — 2 info
  - the endpoint scheme security `apiKey` was added to the API
  - the endpoint scheme security `sessionCookie` was removed from the API

[Change history](https://skmtc.dev/xquik-dev/apis/xquik-api/changes/api-keys/post.md)

---

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