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

# Create an API key

`POST /api/v1/keys`

## Request

- Base URL: `https://www.agenttax.io`
- URL: `https://www.agenttax.io/api/v1/keys`
- Auth: HTTP bearer

Returns the raw key ONCE in the response — save it. Hashed with API_KEY_HMAC_KEY pepper before storage; a DB leak is useless without the server-side pepper (Wave 5.8).

## Request body

- CreateApiKeyRequest
  - `name` string: Human-readable label shown alongside the key prefix in the dashboard.
  - `type` 'live' | 'test'

## Response `201`

Key created — `key` field is shown once and never again.

## Other responses

- `401`: Authentication required.

---

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