---
title: "Create an API key"
method: POST
path: "/v1/api-keys"
---

# Create an API key

`POST /v1/api-keys`

## Request

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

Create a new API key for the organization. The raw token is returned once and never retrievable again. Requires a key with the manage-API-keys capability.

## Request body

- object
  - `description` string, nullable: Human-readable label for the key
  - `canChat` boolean: Allow the key to run threads, chat, and upload files
  - `canManageAgents` boolean: Allow the key to create/update/delete agents and org config
  - `canManageApiKeys` boolean: Allow the key to manage the organization's API keys. The highest-privilege capability — grant only to trusted internal keys.
  - `allowedAgentIds` string[]: Restrict the key to these agent (App) ids. Omit or leave empty for all agents.

## Response `201`

Default Response

- ApiKeyCreated
  - `id` string, uuid, required: Unique identifier of the API key
  - `token` string, required: The raw secret token. Shown once at creation and never retrievable again.

---

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