Skip to content
llms.party

Usage and balance

GET /v1/usage reports what your key may call and how much of its budget is used. Use it to show a balance in a client, warn before a key runs out, or explain a 422 budget error. It works for every key, including keys restricted to the model routes; the gateway looks your key up itself, so no management-route access is needed.

Try it with your own key in the live playgrounds →

curl -sS "https://llms.party/v1/usage" \
  -H "Authorization: Bearer $LLMS_PARTY_KEY"

The response describes the key that made the request:

{
  "key": {
    "alias": "laptop",
    "status": "active",
    "models": ["deepseek-flash", "deepseek-v4-pro", "minimax-h3"],
    "expires_at": null
  },
  "budget": {
    "limit_usd": 25,
    "spent_usd": 1.23,
    "remaining_usd": 23.77,
    "duration": "30d",
    "resets_at": "2026-11-01T00:00:00Z"
  },
  "usage": {
    "total_spent_usd": 4.56,
    "last_active": "2026-10-19T06:36:51Z"
  },
  "limits": {
    "rpm": null,
    "tpm": null
  }
}

Fields

FieldMeaning
key.aliasThe key's label, or null.
key.statusactive, expired, revoked or deleted.
key.modelsModel groups this key may call; the same list as GET /v1/models.
key.expires_atWhen the key stops working, or null for no expiry.
budget.limit_usdBudget for the current window, or null when the key has no budget cap.
budget.spent_usdSpend in the current budget window.
budget.remaining_usdlimit_usd - spent_usd, or null when there is no cap.
budget.durationBudget window, for example 30d, or null.
budget.resets_atWhen the current window ends and spent_usd resets to zero.
usage.total_spent_usdLifetime spend recorded for this key.
usage.last_activeLast request made with the key, or null.
limits.rpm / limits.tpmPer-key request and token-per-minute limits, or null.

Budget windows

When budget.duration is set, budget.spent_usd covers only the current window and budget.resets_at is when that window resets — it is not the key's lifetime. The lifetime figure is usage.total_spent_usd.

The gateway checks the budget before each request and does not reserve it for work in progress. Video jobs are charged when they report cost, so concurrent creates can overspend before the next call is rejected; see Errors & limits. Give a key enough budget for a whole video lifecycle, not just task creation.

Errors

StatusMeaning
401Missing, malformed, revoked or expired key.
502Usage information is temporarily unavailable; retry later.

The endpoint reads the key from the Authorization header only. It never accepts a key as a query parameter and only ever returns the calling key's information.