NEAR AI Cloud: Recompute usage_hourly for a UTC window (Admin only)
POST /v1/admin/usage-hourly/recompute Recompute usage_hourly for a UTC window (Admin only) Deprecated: this endpoint is moving to cloud-platform at the same path; the cloud-platform base URL will be announced. Behaviour may differ in edge cases.
Rebuilds [start, end) from raw usage one UTC day per transaction, then reports raw vs
aggregate parity for every day the window touches. Parity always covers the whole UTC day,
so a window covering part of a day can report ok: false from hours outside it; repair
whole days to clear a day's parity. Use it after a backfill or when the nightly parity check
warns; the scheduler only re-reads the last 3 hours. A window must not start past the next
hour the scheduler has yet to compute (409), or the hours in between would never be computed.
Admin permissions: admin session or read_write token. A read_only token receives HTTP 403 with error.type insufficient_permissions before the handler runs.
Request body (application/json):
- end (string, date-time, required): Exclusive end; a whole UTC hour, at most 31 days after
start. - start (string, date-time, required): Inclusive start; a whole UTC hour.
Responses: 200: Window recomputed
- days (array of object, required)
- aggregate_requests (integer, int64, required)
- aggregate_total_cost_nano (integer, int64, required)
- day (string, date, required)
- ok (boolean, required): True when raw and aggregate totals for the whole UTC day match.
- raw_requests (integer, int64, required)
- raw_total_cost_nano (integer, int64, required)
- end (string, date-time, required)
- rows_written (integer, int64, required)
- start (string, date-time, required) 400: Invalid window 401: Unauthorized 403: Missing admin privileges (forbidden) or insufficient token permission (insufficient_permissions). 409: Window starts past the hours usage_hourly has computed 500: Internal server error