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

# Create an API key

`POST /api/v0beta1/api-keys`

## Request body

- CreateApiKeyRequest
  - `name` string, required — Human-readable name for the API key.
  - `scope` 'organization' | 'user' — Scope of the key to create. Defaults to `organization`; pass `user` to mint a key owned by the calling user.

## Response `201`

Created API key, including its plaintext value.

- ApiKeyWithValue
  - `id` string, required
  - `name` string, required
  - `scope` 'organization' | 'user', required — Whether the key is scoped to the caller's organization or to the individual user who owns it.
  - `obfuscatedValue` string, required
  - `lastUsedAt` string, nullable, required
  - `createdAt` string, required
  - `updatedAt` string, required
  - `value` string, required

## Other responses

- `400` — Error
- `401` — Error
- `403` — Error

---

[API](https://skmtc.net/amika/apis/amika-api.md) · [All operations](https://skmtc.net/amika/apis/amika-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/amika/amika-api/revisions/664536fccd0e/schema)
