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

# Create Api Key

`POST /me/api-keys`

Mint a new API key. The plaintext secret is in the response only
here; subsequent GET responses redact it. Show it to the user once
in a copy-on-display dialog.

## Request body

- ApiKeyCreateRequest — Body for POST /me/api-keys. `scopes` is a list of {'read', 'write'}. Defaults to ['read'] — least privilege; users opt into write at create time and we don't let them edit scopes after the fact (revoke + re-create instead).
  - `name` string, required
  - `scopes` string[]

## Response `201`

Successful Response

- ApiKeyCreatedResponse — Returned only on POST /me/api-keys. `key` is the FULL secret; show it to the user once and never persist it client-side either.
  - `id` string, required
  - `name` string, required
  - `prefix` string, required
  - `scopes` string[], required
  - `last_used_at` string, date-time, nullable
  - `revoked_at` string, date-time, nullable
  - `created_at` string, date-time, required
  - `key` string, required

## Other responses

- `422` — Validation Error

---

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