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

# Mint an API key

`POST /api/v1/keys`

## Request

- Base URL: `https://koskamo.com`
- URL: `https://koskamo.com/api/v1/keys`
- Auth: none declared

Creates a ksk_live_ key. Key creation requires the application’s trusted ingress in production. Rate limit: 3 requests per hour per IP. The full key is returned exactly once. When minted during a signed-in koskamo.com session, the key is bound to that account.

## Request body

- object
  - `name` string: Label for the key; defaults to "agent"

## Response `201`

Key created. Store `key` immediately; Koskamo never shows it again.

- object
  - `key` string, required: Full secret key with the ksk_live_ prefix
  - `prefix` string, required
  - `name` string, required
  - `warning` string, required

## Other responses

- `403`: Access denied (trusted ingress required)
- `429`: Too many keys minted from this address (3 requests per hour per IP)
- `503`: Key minting needs a database; public retrieve already works without one

---

[API](https://skmtc.dev/koskamo/apis/koskamo-agent-api.md) · [All operations](https://skmtc.dev/koskamo/apis/koskamo-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/koskamo/apis/koskamo-agent-api/revisions/c7761a377e7b?raw)
