Authentication

Every request is authenticated with an API key sent as a Bearer token.

Sending your key

Pass the key in the Authorization header:

Authorization: Bearer kal_live_...
curl {BASE}/v1/balance \
  -H "Authorization: Bearer $KAALERA_API_KEY"
const res = await fetch("{BASE}/v1/balance", {
  headers: { Authorization: `Bearer ${process.env.KAALERA_API_KEY}` },
});
const data = await res.json();
console.log(res.status, data);
import os, requests

res = requests.get(
    "{BASE}/v1/balance",
    headers={"Authorization": f"Bearer {os.environ['KAALERA_API_KEY']}"},
)
print(res.status_code, res.json())

Keys start with kal_live_. A missing, wrong or revoked key returns:

{
  "error": {
    "code": "invalid_api_key",
    "message": "Missing or invalid API key."
  }
}

Managing keys

Keep keys secret

!

Never use API keys in browser code, mobile apps or public repositories. Anyone with the key can spend your wallet balance. Call the API from your backend and keep the key in an environment variable or secret manager.

If a key leaks, revoke it in the dashboard and create a new one.