Overview

The Usage API aggregates usage_events into an on-demand invoice draft for an organization. It is scoped to organization owners and admins and covers a caller-specified billing period.

Base URL

All endpoints require a valid Bearer token in the Authorization header. See Authentication for details.

Endpoints

Get usage summary

Query parameters: Dimensions: With group_by, the response also carries:
Groups cover every combination of the requested dimensions, so a client can roll them up to any one dimension (or filter to one bot) without asking again. Servers older than bot/day reject those two with invalid_group_by; the web dashboard then retries with the first four. Response:

Your usage windows

GET /api/v1/me/usage (see Me API) also reports the caller’s Allternit Cloud inference spend in three windows, and how fast it is being used. The window fields use snake_case keys. The older weekly fields on the same reply keep their names.
  • used_usd is Cloud inference spend at the price charged to the user (cost_usd in inference_usage). Hosted computer time is not counted; it keeps its own hour allowance.
  • limit_usd and used_ratio are null when the plan has no limit for that window (for example a no-plan account).
  • enforced is true for the 5h and 7d windows on paid plans. The month window shows the plan’s credit grant and is not a stop.
  • pace.status is ok, warn (at the current burn the window runs out before it resets) or out (already used up). runs_out_at is null unless the window will run out. burn_per_hour is the spend per hour over the window so far.

Limits per plan

The limits are USD of Cloud inference spend. The month limit equals the plan’s monthly credit grant. A Free account has no plan and no limits. Admin accounts are exempt: no window is enforced for them. Only an active or trialing Plus, Max or Ultra plan is limited.

When a window is used up

A Cloud request made while an enforced window is used up is refused with HTTP 429:
window is 5h or 7d. resets_at is when that window frees up. Clients show a notice with the reset time and never print the raw error. The same check applies to model-router calls billed to the viewer. The refusal is skipped when the account has turned on carry_past_windows and its credit balance is above 0. The request then runs and is billed from the balance. Credits themselves still answer 402 credits_exhausted at 0.

Credits carry-over setting

carry_past_windows is stored on user_credits (migration 168) and is false until the person turns it on. Off: the 5-hour and 7-day windows are hard stops until they reset. On: work continues past a window and is billed from the credit balance. The Usage page switch saves this value. GET reads false for an account with no credits row. PUT answers 409 (“Add usage credits first.”) for an account with no credits row.

Error codes