Skip to main content

New: DOJ Justice Manual, USCIS Policy Manual, USPTO MPEP/TMEP, and DFARS PGI are now in the API. See what's covered.

Get started

Authentication

Every request carries an API key in a bearer header.

API keys#

header
Authorization: Bearer lb_key_your_api_key_here

Keep keys on the server. Anyone holding a key can spend your credits.

Example requests#

curl
curl -X POST https://api.lexbharat.example/api/v1/us/statutes/search \
  -H "Authorization: Bearer lb_key_..." \
  -H "Content-Type: application/json" \
  -d '{ "query": "fair use" }'
python
import requests
r = requests.post(
    "https://api.lexbharat.example/api/v1/us/statutes/search",
    headers={"Authorization": "Bearer lb_key_..."},
    json={"query": "fair use"},
)
print(r.json())
javascript
const r = await fetch("https://api.lexbharat.example/api/v1/us/statutes/search", {
  method: "POST",
  headers: { Authorization: "Bearer lb_key_...", "Content-Type": "application/json" },
  body: JSON.stringify({ query: "fair use" }),
});

Error codes#

StatusMeaning
401Missing or invalid key
402Out of credits
429Rate limit exceeded; honour Retry-After

How many keys you can hold#

Each plan allows a fixed number of keys: for example one live and one test key on a smaller plan. Create a second key before revoking the first.

Rotating a key#

Create a new key, deploy it, confirm traffic is using it, then revoke the old one.

Last modified on October 20, 2026

Was this page helpful?