---
title: "POST /api/v1/api-keys"
method: POST
path: "/api/v1/api-keys"
tags: ["API Keys"]
---

# POST /api/v1/api-keys

`POST /api/v1/api-keys`

Create a new API key for the authenticated tenant

## Headers

- `idempotency-key` string, uuid, required — Required for mutating calls. Use a V4 UUID. The server stores the first result for 24h and returns it on subsequent retries with the same key.

## Request body

- CreateApiKeyRequest
  - `name` string, required — Name/label for the API key
  - `metadata` Metadata

## Response `200`

Default Response

- CreateApiKeyResponse
  - `apiKey` ApiKey, required
    - `apiKeyId` string, uuid, required — API key ID
    - `tenantId` string, uuid, required — Tenant ID
    - `name` string, required — API key name/label
    - `prefix` string, required — API key prefix for identification
    - `active` boolean, required — Whether the API key is active
    - `createdAt` string, date-time, required — API key creation timestamp
    - `updatedAt` string, date-time, required — API key last update timestamp
    - `lastUsedAt` string, date-time — API key last used timestamp
    - `metadata` Metadata
  - `plaintextKey` string, required — The complete API key. Store this securely - it will only be shown once!

---

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