---
title: "Create Admin Api Key"
method: POST
path: "/api/admin/api-keys"
tags: ["admin"]
---

# Create Admin Api Key

`POST /api/admin/api-keys`

Mint a new API key for the calling admin.

Returns the cleartext token in the response body. The caller must
persist it: a re-read of the row will only expose the prefix.

Refuses with 409 when the calling admin already has the per-admin
cap of active (un-revoked) keys. The actionable response is
"revoke an old key, then mint again", surfaced in the error
detail so a CLI client can show it verbatim. Revoked keys do not
count toward the cap.

## Request body

- AdminApiKeyCreate — Mint request body. ``label`` is free-form, capped server-side.
  - `label` string

## Response `200`

Successful Response

- AdminApiKeyMintResponse — Mint response. ``token`` is the only place the cleartext is shown. The caller must save the token immediately; subsequent reads of the row only have the prefix. ``key_prefix`` is duplicated here so the frontend can echo it back to the admin alongside the cleartext for confirmation ("you minted ``ck_a1b2c3d4...``").
  - `id` integer, required
  - `token` string, required
  - `key_prefix` string, required
  - `label` string, required
  - `created_at` string, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/mozilla-ai/apis/clawbolt.md) · [All operations](https://skmtc.net/mozilla-ai/apis/clawbolt/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mozilla-ai/clawbolt/revisions/0e52fe5f8d33/schema)
