Credits
Get credit usage
Retrieve a paginated history of credit transactions.
GET
/
v1
/
credits
/
usage
const usage = await client.credits.usage({
from: "2025-01-01T00:00:00Z",
to: "2025-03-31T23:59:59Z",
limit: 50,
});
console.log(`Total used: ${usage.total_used} credits`);
for (const tx of usage.data) {
console.log(`${tx.service}: ${tx.amount} credits - ${tx.description}`);
}
usage = client.credits.usage(
from_="2025-01-01T00:00:00Z",
to="2025-03-31T23:59:59Z",
limit=50,
)
print(f"Total used: {usage['total_used']} credits")
for tx in usage["data"]:
print(f"{tx['service']}: {tx['amount']} credits - {tx['description']}")
curl -X GET "https://hub.banditshq.com/api/v1/credits/usage?from=2025-01-01T00:00:00Z&to=2025-03-31T23:59:59Z&limit=50" \
-H "Authorization: Bearer lasso_..."
{
"data": [
{
"id": "tx_abc123",
"service": "enhancement",
"amount": -12,
"table_id": "tbl_xyz789",
"description": "Enhanced 6 rows × description column",
"created_at": "2025-03-10T14:30:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 50,
"total": 128
},
"total_used": 3420
}
Query parameters
integer
default:"1"
Page number for pagination.
integer
default:"25"
Number of items per page (max 100).
string
Filter transactions from this ISO 8601 date.
string
Filter transactions up to this ISO 8601 date.
string
Filter by service type (e.g.,
extraction, enhancement).Response
array
object
number
Total credits consumed across all matching transactions (not just the current page).
const usage = await client.credits.usage({
from: "2025-01-01T00:00:00Z",
to: "2025-03-31T23:59:59Z",
limit: 50,
});
console.log(`Total used: ${usage.total_used} credits`);
for (const tx of usage.data) {
console.log(`${tx.service}: ${tx.amount} credits - ${tx.description}`);
}
usage = client.credits.usage(
from_="2025-01-01T00:00:00Z",
to="2025-03-31T23:59:59Z",
limit=50,
)
print(f"Total used: {usage['total_used']} credits")
for tx in usage["data"]:
print(f"{tx['service']}: {tx['amount']} credits - {tx['description']}")
curl -X GET "https://hub.banditshq.com/api/v1/credits/usage?from=2025-01-01T00:00:00Z&to=2025-03-31T23:59:59Z&limit=50" \
-H "Authorization: Bearer lasso_..."
{
"data": [
{
"id": "tx_abc123",
"service": "enhancement",
"amount": -12,
"table_id": "tbl_xyz789",
"description": "Enhanced 6 rows × description column",
"created_at": "2025-03-10T14:30:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 50,
"total": 128
},
"total_used": 3420
}
⌘I
const usage = await client.credits.usage({
from: "2025-01-01T00:00:00Z",
to: "2025-03-31T23:59:59Z",
limit: 50,
});
console.log(`Total used: ${usage.total_used} credits`);
for (const tx of usage.data) {
console.log(`${tx.service}: ${tx.amount} credits - ${tx.description}`);
}
usage = client.credits.usage(
from_="2025-01-01T00:00:00Z",
to="2025-03-31T23:59:59Z",
limit=50,
)
print(f"Total used: {usage['total_used']} credits")
for tx in usage["data"]:
print(f"{tx['service']}: {tx['amount']} credits - {tx['description']}")
curl -X GET "https://hub.banditshq.com/api/v1/credits/usage?from=2025-01-01T00:00:00Z&to=2025-03-31T23:59:59Z&limit=50" \
-H "Authorization: Bearer lasso_..."
{
"data": [
{
"id": "tx_abc123",
"service": "enhancement",
"amount": -12,
"table_id": "tbl_xyz789",
"description": "Enhanced 6 rows × description column",
"created_at": "2025-03-10T14:30:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 50,
"total": 128
},
"total_used": 3420
}

