How the balance is computed
Visibility
- Real-time in the dashboard (app.geekhub.mx)
- API endpoint (coming soon):
GET /v1/creditswill return your current balance - Response headers (coming soon): each response will include
x-geekhub-balance-mxn
Threshold and alerts
Per-request detail
In /dashboard/usage you have the full log; each request shows:- Model used
- Tokens (in / out) or images / seconds
- Exact MXN cost
- P95 latency
- Status (200 / 4xx / 5xx)
- Timestamp
Race conditions
The balance deduction is atomic at the Postgres transaction level: theconsume_credit_on_request() trigger uses pg_advisory_xact_lock per org to serialize concurrent consumption. Even with 100 parallel requests, balance_after always reflects the correct order.
Zero double-charging. Each failed request with
cost_mxn > 0 does not generate a consumption (the trigger filters it).