Skip to content
DocsGet started

Authentication

Send your key as a bearer token. There is no OAuth flow, no signature to compute and no expiry to refresh.

The header#

http
POST /api/v1/documents HTTP/1.1
Host: statementbear.com
Authorization: Bearer sb_live_9f2c41d0a7b34e58c6d1f0a2b8e37c94
Content-Type: application/pdf

Every /api/v1 endpoint takes the same header, the parsing MCP server included. A request with no Authorization header returns 401 missing_key. An unknown or revoked key returns 401 invalid_key.

Key format#

A prefix followed by a long random string. The prefix makes a key recognisable in a log, a paste or a secret scanner, and lets us answer a support question without seeing the rest of it.

PrefixWhat it does
sb_live_Reads the file you send and bills for it. Sees only live documents and collections.
sb_test_Returns a fixture document. Never billed. Sees only test documents and collections. See Test mode.

How keys are stored#

A live key is shown once, when it is created, and we cannot read it back to you, so a lost live key means issuing a new one. A test key stays on the API keys page of the console, so you can copy it again whenever you need it.

Rotating and revoking#

  • Hold more than one key at a time. Issue the new key, deploy it, then revoke the old one.
  • Revocation applies to the next request.
  • A revoked key stays listed, so past usage stays attributable on your invoice and in Logs.
  • Issue and revoke keys yourself on the API keys page of the console. Admins and developers can both do it. See Console and teams.

Authentication errors#

StatusCodeMeaning
401missing_keyNo Authorization header.
401invalid_keyUnknown, malformed or revoked key.
402canceledThe key is valid but billing was cancelled. Keys are kept, so reactivating needs no redeploy.

None of these are charged. Full list on Errors.

Something wrong or missing on this page? [email protected]