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

# Create a new API key

`POST /auth/keys`

## Request

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

Create a named API key for the authenticated user.

The raw key value is returned exactly once in this response.
It is never stored and cannot be retrieved again.
Enforces key limits: free accounts get ``api_key_limit_free``; legacy
subscription tiers keep their caps; any user with at least one completed
credit-pack purchase is boosted to ``api_key_limit_paid``.

## Request body

- CreateApiKeyRequest: Request body for creating a new API key.
  - `name` string, required

## Response `200`

API key with raw value (shown once)

- ApiResponseApiKeyResponse
  - `data` ApiKeyResponse: Response body for a single API key. ``raw_key`` is only populated on creation (shown once, never stored).
    - `id` string, uuid, required
    - `name` string, required
    - `key_prefix` string, required
    - `created_at` string, date-time, required
    - `is_active` boolean, required
    - `raw_key` string, nullable
  - `error` ErrorDetail: Structured error information for API error responses. Attributes: code: Machine-readable error code (e.g. "JOB_NOT_FOUND"). message: Human-readable error description. details: Optional additional context for debugging.
    - `code` string, required
    - `message` string, required
    - `details` object, nullable
  - `meta` object, nullable

## Other responses

- `401`: Unauthorized — missing or invalid API key/JWT.
- `422`: Validation Error

---

[API](https://skmtc.dev/whoisgeni/apis/whoisgenius.md) · [All operations](https://skmtc.dev/whoisgeni/apis/whoisgenius/llms.txt) · [OpenAPI document](https://skmtc.dev/whoisgeni/apis/whoisgenius/revisions/707f1c34f6b3?raw)
