API Reference
Usage API
Query usage statistics and estimated costs for your tenant.
Usage API
Track API usage and costs per tenant. Usage is metered in real-time and costs are calculated based on your plan's per-unit rates.
Pricing model
Qanatix bills on two metrics: Records (active records stored) and Searches (search API calls per month).
| Free | Pro (€199/mo) | Scale (€399/mo) | Enterprise | |
|---|---|---|---|---|
| Collections | 1 | 5 | Unlimited | Unlimited |
| Records | 50 | 100,000 | Unlimited | Unlimited |
| Searches | 50 | 50,000 | 500,000 | Unlimited |
| Search overage | Blocked | €1.50/1K | €1/1K | Custom |
Free plan has hard caps — requests are blocked (HTTP 402) when limits are reached. Paid plans allow overages, billed end-of-month.
GET /usage
Get usage stats for the current month.
curl "https://api.qanatix.com/api/v1/usage" \
-H "Authorization: Bearer sk_live_abc123..."Response (200)
{
"tenant_id": "your-tenant-id",
"usage": {
"requests": 1678,
"searches": 1247,
"records": 342
}
}| Field | Description |
|---|---|
requests | Total API calls |
searches | Search queries executed |
records | Active records (records) stored |
How usage is tracked
- Every API request increments a Redis counter (atomic, ~0.1ms overhead)
- Counters are flushed to Postgres every 5 minutes via Taskiq scheduled task
- The portal usage endpoint combines Redis (real-time) + Postgres (persisted) for accurate totals
- Free plan: hard block at limits (HTTP 402)
- Paid plans: unlimited usage, metered for end-of-month billing
Rate limits
Rate limits are per-tenant, enforced via Redis token bucket:
| Plan | API calls/min | Search/min |
|---|---|---|
| Free | 60 | 20 |
| Pro | 600 | 300 |
| Scale | 2,000 | 1,000 |
| Enterprise | 10,000 | 10,000 |
Exceeding rate limits returns HTTP 429 with X-RateLimit-Remaining and X-RateLimit-Reset headers.