BazaarLinkBazaarLink
Sign in
DocsAPI ReferenceSDK ReferenceAgentic UsageAI Skills
Management Keys

Create an API key

Creates a new standard API key (or another management key). A management endpoint — if you authenticate with a Bearer token, it must be a Management API Key, not a regular sk-bl- key; a logged-in session cookie also works. The key field in the response is the only time the raw key value is ever shown — only its hash is stored afterward, and it cannot be retrieved again.

POST/api/v1/keys

Authorizations

Authorizationrequired
string · header

API key as bearer token in the Authorization header.

Body

namerequired
string

Display name for the key; leading/trailing whitespace is trimmed and the result cannot be empty.

≤200 chars, trimmed non-empty
keyType
string

Key type, defaults to standard; any value other than "management" is treated as standard.

standardmanagement
Example: "standard"
limit
number | null

Spend limit in USD, stored as spendLimitUsd. null or omitted means no limit. When set, limit_reset must also be provided. GET /v1/key reports this same value back as limit.

0–1,000,000
limit_reset
string | null

Reset period for the spend limit, stored as spendLimitPeriod. Accepts either the OR-compatible aliases (daily/weekly/monthly) or the internal names (day/week/month) — both forms are equivalent.

dailyweeklymonthlydayweekmonth
Example: "monthly"
expires_at
string | null

Expiration time for the key, an ISO date string that must be in the future. null or omitted means it never expires.

Example: "2027-01-01T00:00:00Z"
organizationId
string | null

Binds the key to the given organization instead of the personal account. The caller must pass the authorization check for that organization/team/member scope, or the request returns 400.

teamId
string | null

Further scopes the key to a specific team within the organization. Used together with organizationId.

orgMemberId
string | null

Further scopes the key to a specific member within the organization. Used together with organizationId.

POST /api/v1/keys
curl https://bazaarlink.ai/api/v1/keys \
  -H "Authorization: Bearer $BAZAARLINK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "production", "limit": 50, "limit_reset": "monthly"}'
Response examples

Created. The key field is the full raw value, shown only in this one response — store it immediately, as it can never be retrieved again, even by the caller.

{
  "id": "key_abc123",
  "name": "production",
  "key": "sk-bl-AbCdEfGh...",
  "keyType": "standard",
  "prefix": "sk-bl-",
  "enabled": true,
  "spendLimitUsd": 50,
  "spendLimitPeriod": "month",
  "expiresAt": null,
  "createdAt": "2026-07-27T00:00:00.000Z",
  "organizationId": null,
  "teamId": null,
  "orgMemberId": null
}
Support
Support
Hi! How can we help you?
Send a message and we'll get back to you soon.
Create an API key — BazaarLink API