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
- Create keys in the developer dashboard. You can have up to 10 active keys.
- A key is shown once, when you create it. Copy it then; it cannot be shown again.
- Kaalera stores only a hash of the key, never the key itself. The dashboard shows its first characters so you can tell keys apart.
- Revoke a key at any time from the dashboard. It stops working immediately.
- All keys on your account share the same USD wallet.
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.