GET /v1/usage
Your balance and usage, for scripts and monitoring. Calling it is free. Every other response also carries what it cost and what is left, in two headers.
Endpoint
GET https://layahost.com/v1/usage?days=30
days is optional: 1 to 90, default 30. Usage covers the whole account, across all its keys.
GET /v1/usage
curl "https://layahost.com/v1/usage?days=7" \
-H "Authorization: Bearer $LAYAHOST_API_KEY"
Response · 200
{
"balance": {
"micros": 17396635,
"usd": 17.396635,
"decisions_left": 2708083
},
"plan": {
"plan": "starter",
"name": "Starter",
"price_usd_per_month": 9,
"included_decisions": 1000000,
"used_decisions": 31580,
"remaining_decisions": 968420,
"period_end": "2026-10-19T08:12:40+00:00",
"cancels_at_period_end": false,
"overage_price_per_decision_micros": 10
},
"price_per_decision_micros": 10,
"period": { "from": "2026-09-19", "to": "2026-09-25", "days": 7 },
"totals": {
"requests": 1840,
"decisions": 2905,
"errors": 12,
"cost_micros": 14525,
"cost_usd": 0.014525
},
"daily": [
{ "date": "2026-09-19", "requests": 0, "decisions": 0, "cost_micros": 0 },
{ "date": "2026-09-20", "requests": 310, "decisions": 520, "cost_micros": 2600 }
]
}
| Field | Description |
|---|---|
balance.micros | Prepaid credit left, in millionths of a US dollar. |
balance.decisions_left | Decisions you can still make: what is left of your plan's allowance this period, plus what your credit buys. |
plan | Your monthly plan: decisions included, used and remaining in this period, when the period ends, and the price per decision after the allowance. null without an active plan. |
price_per_decision_micros | What a decision costs from credit: your plan's overage price, or the pay-as-you-go price. |
totals | Requests, billed decisions, failed requests and cost over the period. |
daily | One row per day, oldest first, including days with no usage. Dates are UTC. |
Cost and balance headers
Every authenticated response, including batches and errors, has:
| Header | Description |
|---|---|
x-layahost-cost-micros | What this request took from your credit, in micro-USD. 0 for failed requests and for decisions covered by your plan. |
x-layahost-balance-micros | Your balance after this request. |
To be warned before credit runs out, set a low-balance alert on the Billing page; you get one email when the balance falls under it.