# Get credit usage

Source: https://checkslip.com/en/docs/get-usage

GET `https://api.checkslip.com/api/usage`

API key

Returns how many lookups were made, how many took a credit and how many did not, with a count per reason such as free_not_found or free_too_old, per day or per month in Thailand time (interval=DAY or MONTH). A day or month with no lookups is returned as zero, not skipped. One request covers at most 92 days or 24 months. A lookup counts on the day its credit was settled (settled_at), not the day it was sent. The two are usually seconds apart, so a lookup near midnight can land on the next day. The counts trail real time by about 1 minute (see as_of); for each lookup as it happens, use the lookup history (it needs slip:read). Reading usage uses no credit. Needs an API key with usage:read.

## Parameters

| Field | In | Type | Required |
| --- | --- | --- | --- |
| `X-Request-Id` | header | `string` | no |
| `interval` | query | `DAY \| MONTH` | no |
| `from` | query | `string (date)` | yes |
| `to` | query | `string (date)` | yes |

## Responses

### 200 `application/json`

| Field | Type | Required |
| --- | --- | --- |
| `interval` | `DAY \| MONTH` | yes |
| `as_of` | `string (date-time)` | yes |
| `from` | `string (date)` | yes |
| `to` | `string (date)` | yes |
| `timezone` | `string = Asia/Bangkok` | yes |
| `buckets` | `object[]` | yes |
| `totals` | `UsageCounts` | yes |
| `totals.checks` | `integer` | yes |
| `totals.charged` | `integer` | yes |
| `totals.free_not_found` | `integer` | yes |
| `totals.free_duplicate` | `integer` | yes |
| `totals.free_unavailable` | `integer` | yes |
| `totals.free_invalid_qr` | `integer` | yes |
| `totals.free_invalid_file` | `integer` | yes |
| `totals.free_qr_tampered` | `integer` | yes |
| `totals.free_too_old` | `integer` | yes |
| `totals.free_system_error` | `integer` | yes |
| `totals.free_other` | `integer` | yes |

### Possible errors

400 401 default

An error as Problem Details. All codes are listed at [Error codes](https://checkslip.com/en/docs/errors)

**cURL**

```bash
curl "https://api.checkslip.com/api/usage?from=2026-11-05&to=2026-11-05" \
  -H "Authorization: Bearer $CHECKSLIP_API_KEY"
```

**Node.js**

```javascript
const res = await fetch("https://api.checkslip.com/api/usage?from=2026-11-05&to=2026-11-05", {
  headers: {
    Authorization: `Bearer ${process.env.CHECKSLIP_API_KEY}`,
  },
});
const data = await res.json();
```

**Python**

```python
import os

import requests

res = requests.get(
    "https://api.checkslip.com/api/usage",
    headers={
        "Authorization": f"Bearer {os.environ['CHECKSLIP_API_KEY']}",
    },
    params={
        "from": "2026-11-05",
        "to": "2026-11-05",
    },
)
data = res.json()
```

```json
{
  "interval": "DAY",
  "as_of": "2026-11-05T09:30:00+07:00",
  "from": "2026-11-05",
  "to": "2026-11-05",
  "timezone": "Asia/Bangkok",
  "buckets": [
    {
      "start": "2026-11-05",
      "checks": 1,
      "charged": 1,
      "free_not_found": 1,
      "free_duplicate": 1,
      "free_unavailable": 1,
      "free_invalid_qr": 1,
      "free_invalid_file": 1,
      "free_qr_tampered": 1,
      "free_too_old": 1,
      "free_system_error": 1,
      "free_other": 1
    }
  ],
  "totals": {
    "checks": 1,
    "charged": 1,
    "free_not_found": 1,
    "free_duplicate": 1,
    "free_unavailable": 1,
    "free_invalid_qr": 1,
    "free_invalid_file": 1,
    "free_qr_tampered": 1,
    "free_too_old": 1,
    "free_system_error": 1,
    "free_other": 1
  }
}
```
