Recent ledger entries
const url = 'https://api.sloose.com/entitlements/admin/orgs/org_9f3c/ledger?limit=100';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.sloose.com/entitlements/admin/orgs/org_9f3c/ledger?limit=100' \ --header 'Authorization: Bearer <token>'Backoffice route: a staff session, or ADMIN_TOKEN; never a customer’s session. Straight from the Durable Object — the authority, not the D1 mirror.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The org id.
Example
org_9f3cThe org id.
Query Parameters
Section titled “Query Parameters”Entries to return. Defaults to 100.
Example
100Entries to return. Defaults to 100.
Responses
Section titled “Responses”Ledger entries, newest first, with the current balance.
object
object
AI credits. Included credits reset each period; purchased ones do not.
object
Included + purchased − reserved
Examplegenerated
{ "entries": [ { "additionalProperty": "example" } ], "balance": { "included": 1, "purchased": 1, "reserved": 1, "available": 1, "periodStart": "example", "periodEnd": "example" }}A bearer that is neither the token nor a live session (code: AUTH_REQUIRED).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}A customer’s session, an API token, or no bearer at all — not staff, and not the ADMIN_TOKEN (code: ADMIN_REQUIRED).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}