---
title: "Account Create Key"
method: POST
path: "/api/account/keys"
---

# Account Create Key

`POST /api/account/keys`

## Request

- Base URL: `https://opwhcervi3.execute-api.ca-central-1.amazonaws.com`
- URL: `https://opwhcervi3.execute-api.ca-central-1.amazonaws.com/api/account/keys`
- Auth: HTTP bearer

Creates a new API key for the authenticated account and returns its secret once. An account holds exactly one active key, so this REVOKES the previous active key (the response then says `revoked_previous: true`); use it only to rotate. To get a key without rotating, use POST /api/account/keys/ensure. Bearer authentication is required; it consumes no trial or quota and has no billing side effect.

## Headers

- `Authorization` string, nullable

## Request body

- AccountApiKeyCreateRequest
  - `label` string, required

## Response `200`

Successful Response

- AccountKeyCreateResponse
  - `id` string, required
  - `key` string, required
  - `message` string, required
  - `prefix` string, required
  - `revoked_previous` boolean

## Other responses

- `401`: Missing, malformed, or invalid credentials.
- `422`: Validation Error

---

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