Skip to main content
POST
Create a personal API key

Authorizations

Authorization
string
header
required

JWT obtained through Barndoor's authentication flow. Pass the token verbatim in Authorization: Bearer <token>. Use the Barndoor SDK's loginInteractive() helper to obtain a token in scripts and notebooks.

Body

application/json
name
string
required
expires_at
string<date-time> | null

Response

200 - application/json

The newly created key

id
string<uuid>
required
name
string
required
key_prefix
string
required
key
string
required

The raw API key. Returned only at creation time and never stored in plaintext — copy it immediately. Use this value as Authorization: Bearer <key> (or x-api-key: <key>) on requests to /v1/chat/completions, /v1/messages, and friends.

Example:

"bd-abcd1234ef56..."

scopes
string[]
required
created_at
string<date-time>
required
group_name
string | null
expires_at
string<date-time> | null