---
title: "Create an API key for the authenticated user"
method: POST
path: "/v1/user/api_keys"
tags: ["api_keys"]
---

# Create an API key for the authenticated user

`POST /v1/user/api_keys`

Create a personal API key for the currently authenticated user. The key inherits the user's role, so it grants no more access than the user already has. Creation requires an access-token session; API keys cannot mint replacement keys. The response contains the key itself, which is shown only once and cannot be retrieved afterwards.

## Request body

- CreateApiKeyRequestBody
  - `data` ApiKeyData, required
    - `name` string, required — A human-readable name for the API key.
    - `description` string, nullable — An optional description of what the API key is for.
    - `expires_at` string, date-time, nullable — When the API key expires. The key never expires when omitted.

## Response `201`

The newly created API key, including the key itself.

- CreateApiKeyResponseBody
  - `data` CreatedApiKey, required
    - `id` string, required
    - `name` string, required
    - `description` string, nullable
    - `created_at` string, date-time, required
    - `expires_at` string, date-time, nullable
    - `key` string, required — The API key. This is the only time it is returned; it cannot be recovered from the listing endpoints.

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `422` — Unprocessable Entity
- `507` — Insufficient Storage

---

[API](https://skmtc.net/arize-ai/apis/arize-phoenix-rest-api.md) · [All operations](https://skmtc.net/arize-ai/apis/arize-phoenix-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/arize-ai/arize-phoenix-rest-api/versions/a14d8ad6f708/schema)
