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

# Create an API Key

`POST /v1/api-keys`

Generates a new programmatic API key for accessing authorized resources.
The full, secret API key is returned ONLY once in this response and cannot be recovered later.

## Request body

- CreateAPIKeyRequest
  - `name` string, required — Descriptive name for the key.
  - `org_id` string, uuid, required — Organization that owns the API key.
  - `team_ids` string[] — Optional list of teams the key can access. Omit or pass an empty array for organization-wide access.
  - `operation` 'read_render' | 'all' | 'admin'

## Response `201`

API key created successfully

- APIKeyCreatedResponse
  - `id` string, uuid, required — Unique API Key identifier.
  - `name` string, required — Human-readable name of the key.
  - `key` string, required — The fully generated secure raw API Key string. This is returned ONLY ONCE.
  - `operation` string, required
  - `created_at` string, date-time, required — Timestamp of creation.

## Other responses

- `400` — Invalid request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Referenced team not found
- `500` — Internal Server Error

---

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