API reference
Credits and key limits
GET /v1/credits returns your posted balance and lifetime totals. GET /v1/key returns the calling key’s spending cap, usage and reset schedule.
https://gateway.kalsenti.ai/v1/creditsOn this page
Balance
Returns the posted account balance and lifetime ledger totals in US dollars. Credit reserved for requests in progress can reduce what’s available to spend without changing the posted balance.
curl https://gateway.kalsenti.ai/v1/credits \
-H "Authorization: Bearer $KALSENTI_API_KEY"{
"data": {
"total_credits": 100.5,
"total_usage": 25.75,
"balance": 74.75
}
}total_creditsnumber- Every amount ever added to the account, in US dollars.
total_usagenumber- All credit deducted, including request charges, refunds and account adjustments, in US dollars.
balancenumber- The posted balance in US dollars. It can be negative.
The posted balance is total_credits minus total_usage.
Key limits
Returns the spending cap for the key used in the request, its settled spending for the current period and how often the cap resets.
curl https://gateway.kalsenti.ai/v1/key \
-H "Authorization: Bearer $KALSENTI_API_KEY"{
"data": {
"label": "my-app",
"limit": 5,
"usage": 1.2,
"limit_remaining": 3.8,
"limit_reset": "monthly",
"is_free_tier": false,
"expires_at": null
}
}labelstring- The name you gave the key.
limitnumber | null- The cap in US dollars, or
nullwhen the key has none. usagenumber- What the key has spent in the current period, in US dollars.
limit_remainingnumber | null- The cap minus settled spending, with a minimum of zero, or
nullif the key has no cap. limit_resetstring | nulldaily,weeklyormonthly,nullfor a cap that never resets, andnullwhen there is no cap.is_free_tierboolean- Always false.
expires_atstring | null- When the key stops working, as an ISO 8601 timestamp, or null if it doesn’t expire.
A key with no cap reports usage as 0. To set a cap, open Developer in the dashboard and choose Limits for that key. See the reset schedule for the UTC boundaries.
Both routes accept Authorization: Bearer or x-api-key and count toward the key’s request limit. Both return 401 for a revoked or expired key.