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

# Create an API key

`POST /v1/keys`

Creates a new API key. The secret `key` is returned only once in this response, so store it securely.

## Request body

- ApiKeyCreate
  - `name` string, required — A descriptive name for the key.

## Response `201`

The created API key, including the one-time secret.

- object
  - `data` ApiKeyCreated — A newly created API key. The secret `key` is returned only once.
    - `id` string
    - `name` string
    - `key` string — The secret API key. Store it securely, because it is shown only once.
    - `keyLastFour` string
    - `clientId` string

## Other responses

- `401` — Missing or invalid API key credentials.
- `422` — The request could not be processed (for example, a plan limit was reached).

---

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