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

# Create API key

`POST /api-keys`

## Request

- Base URL: `https://api.caliuapp.com`
- URL: `https://api.caliuapp.com/api-keys`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `caliu_session`

Create a new API key. The full key is returned ONCE at creation — store it securely.

## Request body

- object
  - `name` string, required: Human-readable name for this API key

## Response `201`

API key created

- object
  - `apiKey` object, required
    - `id` string, required
    - `name` string, required
    - `prefix` string, required: First 8 chars of the key for identification
    - `lastUsedAt` string, nullable
    - `expiresAt` string, nullable
    - `createdAt` string, required
    - `key` string, required: Full API key — shown ONCE at creation, never stored

## Other responses

- `402`: Free key limit reached (Caliu Pro required)
- `422`: Validation error
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/caliuapp/apis/caliu-api.md) · [All operations](https://skmtc.dev/caliuapp/apis/caliu-api/llms.txt) · [OpenAPI document](https://skmtc.dev/caliuapp/apis/caliu-api/revisions/1ba4d3f687fe?raw)
