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

# Create a workspace API key

`POST /api/workspace/api-keys`

[cloud-only] Creates a new API key for the current workspace.

## Request body

- object
  - `name` string, required — Display name for the API key
  - `description` string — User-provided description of the key's purpose

## Response `201`

API key created

- WorkspaceApiKeyCreated — [cloud-only] A newly created workspace API key, including the full secret value (shown only once).
  - `id` string, required
  - `name` string, required
  - `description` string, required — User-provided description of the key's purpose. Always present in responses; empty string when no description was supplied on create.
  - `key` string, required — Full API key value (only returned on creation)
  - `prefix` string
  - `created_at` string, date-time

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Workspace not found
- `422` — Validation error
- `429` — Key limit reached
- `500` — Internal server error

## Changes

- **2026-05-22** `09a5075587c8` — 5 info
  - api operation id `createWorkspaceApiKey` removed and replaced with `createWorkspaceAPIKey`
  - added the non-success response with the status `404`
  - added the non-success response with the status `422`
  - added the non-success response with the status `429`
  - …1 more
- **2026-05-19** `154b54b72941` — 1 warning, 1 info
  - the `description` request property's maxLength was set to `5000`
  - the response property `description` became required for the status `201`
- **2026-05-19** `cc79ecd094b4` — 2 info
  - added the new optional request property `description`
  - added the optional property `description` to the response with the `201` status
- **2026-05-08** `c9640fded659` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/comfy-org/apis/comfyui-api/changes/api/workspace/api-keys/post.md)

---

[API](https://skmtc.dev/comfy-org/apis/comfyui-api.md) · [All operations](https://skmtc.dev/comfy-org/apis/comfyui-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/comfy-org/comfyui-api/revisions/09a5075587c8/schema)
