Přejít na hlavní obsah
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}`);
}
{
  "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 parametry

page
integer
výchozí:"1"
Číslo stránky pro stránkování.
limit
integer
výchozí:"25"
Počet položek na stránku (max 100).
from
string
Filtrování transakcí od tohoto data ISO 8601.
to
string
Filtrování transakcí do tohoto data ISO 8601.
service
string
Filtrování podle typu služby (např. extraction, enhancement).

Odpověď

data
array
pagination
object
total_used
number
Celkový počet spotřebovaných kreditů napříč všemi odpovídajícími transakcemi (nejen aktuální stránka).
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}`);
}
{
  "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
}