Skip to content
Skip to Content
Batchwell Docs

Authentication

Bearer API keys, key prefixes, spend limits and revocation.

Send your key in the Authorization header on every request:

HTTP
Authorization: Bearer bw_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
PrefixMeaning
bw_live_Production key, spends real credit
bw_test_Test key

A key is the prefix followed by 43 base-62 characters. We store only a SHA-256 hash of the full key and its first 12 characters, which the dashboard shows so you can tell keys apart. A lost key cannot be recovered; revoke it and create a new one.

A key can carry a spend limit in USD with a reset period of none (lifetime), daily, weekly or monthly. A request that would take the key over its limit is refused with 402 insufficient_credit before any model runs.

Revoking a key in the dashboard takes effect on every gateway instance within 5 seconds. Requests with an unknown or revoked key get 401; requests for an organization that is suspended or frozen get 403.

Do not ship keys in browser or mobile apps. Call Batchwell from your backend, a CLI or a CI secret. The Chat page in the dashboard is the exception: it keeps the key you paste in page memory only.