Skip to main content
POST
Create a API key

Authorizations

Authorization
string
header
required

A Barndoor API key, sent as Authorization: Bearer <key>. Keys are prefixed bdai_ and are opaque — do not attempt to decode one. Interchangeable with an OAuth 2.0 access token.

Scopes

openid

Issue an OIDC ID token identifying the caller.

profile

Read the caller's basic profile claims.

email

Read the caller's email address.

Body

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

Optional IdP group binding (e.g. "engineering"). Members of this group share the group-scoped budgets, rate limits, and model-access policies.

scopes
string[]
user_email
string | null
user_id
string<uuid> | null

Response

The created record

created_at
string<date-time>
required
id
string<uuid>
required
key
string
required

The full API key — only returned at creation time, never stored.

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