Credits
Get credit stats
Retrieve aggregated credit usage statistics for a date range, ready for BI tools like Power BI or Looker.
GET
/
credits
/
stats
const stats = await client.credits.stats({
from: "2025-01-01",
to: "2025-03-31",
});
console.log(`Total spent: ${stats.summary.total_spent} credits`);
for (const m of stats.by_module) {
console.log(`${m.module_key}: ${m.total}`);
}
{
"period": { "from": "2025-01-01", "to": "2025-03-31" },
"summary": {
"total_spent": 4200,
"previous_period_spent": 3800,
"previous_period_change_pct": 10.5,
"monthly_allocation": 50000,
"period_end": "2025-04-18T00:00:00.000Z",
"cost_per_credit": {
"amount": 0.02,
"currency": "EUR",
"monthly_fee": 1000,
"monthly_credits": 50000
}
},
"daily": [
{
"date": "2025-01-01",
"total": 120,
"by_module": { "lasso": 120 },
"by_user": { "5f0e...": 120 }
}
],
"by_module": [{ "module_key": "lasso", "total": 3000 }],
"by_service": [{ "service_type": "ai_field", "total": 1500 }],
"by_user": [{ "user_id": "5f0e...", "total": 800 }],
"lasso": {
"credits_spent": 3000,
"products_enhanced": 450,
"credits_per_product": 6.67,
"by_table": [
{
"table_id": "9b81...",
"name": "Summer catalog",
"total": 800,
"products": 120
}
]
},
"currency_config": {
"monthly_fee_czk": 25000,
"monthly_fee_eur": 1000,
"monthly_credits": 50000,
"auto_eur": false
}
}
Returns spending totals, daily breakdowns, per-module/service/user splits, Lasso table usage, and the company’s money-display configuration for the requested period.
Query parameters
Start date, inclusive (
YYYY-MM-DD).End date, inclusive (
YYYY-MM-DD). Must be on or after from, and the range may span at most 1830 days (~5 years).Response
Show Summary metrics
Show Summary metrics
Total credits spent in the period.
Credits spent in the equal-length window immediately before
from.Percentage change vs. the previous period.
null when the prior window had zero spend (no baseline).Monthly credit allocation for the company.
End of the current billing period (ISO 8601), if known.
Show Lasso (product extraction) usage
Show Lasso (product extraction) usage
Total Lasso credits spent in the period.
Sum of the current
total_products across tables that had Lasso usage in the period — a snapshot of table sizes, not a count of products enhanced during the period.credits_spent / products_enhanced using those snapshot counts.For row-level transaction export, use Get credit usage. For the live balance, use Get credit balance.
const stats = await client.credits.stats({
from: "2025-01-01",
to: "2025-03-31",
});
console.log(`Total spent: ${stats.summary.total_spent} credits`);
for (const m of stats.by_module) {
console.log(`${m.module_key}: ${m.total}`);
}
{
"period": { "from": "2025-01-01", "to": "2025-03-31" },
"summary": {
"total_spent": 4200,
"previous_period_spent": 3800,
"previous_period_change_pct": 10.5,
"monthly_allocation": 50000,
"period_end": "2025-04-18T00:00:00.000Z",
"cost_per_credit": {
"amount": 0.02,
"currency": "EUR",
"monthly_fee": 1000,
"monthly_credits": 50000
}
},
"daily": [
{
"date": "2025-01-01",
"total": 120,
"by_module": { "lasso": 120 },
"by_user": { "5f0e...": 120 }
}
],
"by_module": [{ "module_key": "lasso", "total": 3000 }],
"by_service": [{ "service_type": "ai_field", "total": 1500 }],
"by_user": [{ "user_id": "5f0e...", "total": 800 }],
"lasso": {
"credits_spent": 3000,
"products_enhanced": 450,
"credits_per_product": 6.67,
"by_table": [
{
"table_id": "9b81...",
"name": "Summer catalog",
"total": 800,
"products": 120
}
]
},
"currency_config": {
"monthly_fee_czk": 25000,
"monthly_fee_eur": 1000,
"monthly_credits": 50000,
"auto_eur": false
}
}
Errors
| Status | Meaning |
|---|---|
| 400 | Missing/invalid from or to, from after to, or range larger than 1830 days |
| 401 | Invalid or missing API key |
| 500 | Server or database error |
⌘I
const stats = await client.credits.stats({
from: "2025-01-01",
to: "2025-03-31",
});
console.log(`Total spent: ${stats.summary.total_spent} credits`);
for (const m of stats.by_module) {
console.log(`${m.module_key}: ${m.total}`);
}
{
"period": { "from": "2025-01-01", "to": "2025-03-31" },
"summary": {
"total_spent": 4200,
"previous_period_spent": 3800,
"previous_period_change_pct": 10.5,
"monthly_allocation": 50000,
"period_end": "2025-04-18T00:00:00.000Z",
"cost_per_credit": {
"amount": 0.02,
"currency": "EUR",
"monthly_fee": 1000,
"monthly_credits": 50000
}
},
"daily": [
{
"date": "2025-01-01",
"total": 120,
"by_module": { "lasso": 120 },
"by_user": { "5f0e...": 120 }
}
],
"by_module": [{ "module_key": "lasso", "total": 3000 }],
"by_service": [{ "service_type": "ai_field", "total": 1500 }],
"by_user": [{ "user_id": "5f0e...", "total": 800 }],
"lasso": {
"credits_spent": 3000,
"products_enhanced": 450,
"credits_per_product": 6.67,
"by_table": [
{
"table_id": "9b81...",
"name": "Summer catalog",
"total": 800,
"products": 120
}
]
},
"currency_config": {
"monthly_fee_czk": 25000,
"monthly_fee_eur": 1000,
"monthly_credits": 50000,
"auto_eur": false
}
}

