Skip to main content
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

from
string
required
Start date, inclusive (YYYY-MM-DD).
to
string
required
End date, inclusive (YYYY-MM-DD). Must be on or after from, and the range may span at most 1830 days (~5 years).

Response

period
object
summary
object
daily
array
by_module
array
by_service
array
by_user
array
lasso
object
currency_config
object
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

StatusMeaning
400Missing/invalid from or to, from after to, or range larger than 1830 days
401Invalid or missing API key
500Server or database error