Get a budget's balance
Changed onReturns a limit budget's spend, remaining amount, and projected spend in the budget window that contains evaluated_at. derived adds the balances of the derived budgets with the highest spend.
A caller who sees only their own derived budget reads that one. Its amounts count that caller's usage alone, and derived holds the caller's value, or is empty without usage in the budget window.
The amounts count the usage stored when the request runs. latest_record_at shows when the newest counted usage reached the service. Only a limit budget has a balance, so if the budget is an exemption, the request fails with 400. If the organization has no budget with this identifier that the caller can see, or the identifier isn't a valid UUID, the request fails with 404.
Request
- Base URLhttps://global.api.konghq.com
- Auth
- HTTP bearer
- or HTTP bearer
- or HTTP bearer
- or HTTP bearer
Path parameters
The id of the budget.
Query parameters
The maximum number of derived budgets in derived, which lists the highest spend first.
1 to 100. Defaults to 20.
The time to calculate the balances for, as an RFC 3339 timestamp in UTC. It selects the budget window. The amounts still count all usage stored when the request runs. A request that passes an earlier read's evaluated_at gets the same budget window, unless the budget's window changed in between.
A time in the future isn't accepted. Defaults to the time of the request.
Response
The budget's balance.
The budget the balance belongs to.
The budget window that contains evaluated_at.
The limit that remaining is measured against.
The spend of all usage in the budget's scope during the budget window. With each, it's the total for the whole budget: each event counts once, including usage without a value for the each field.
The limit minus consumed. Negative once spend exceeds the limit.
Where consumed ends the budget window at the current pace, rounded to the cent. The pace extrapolates consumed over the whole window from the share of the window that has elapsed at evaluated_at. That share counts as at least one twentieth, so a balance read at the very start of a window projects a bounded amount.
The time the balance is calculated for, as an RFC 3339 timestamp in UTC. It selects the budget window.
When the newest usage counted in the balance reached the service, as an RFC 3339 timestamp in UTC. It doesn't show that all earlier usage has arrived.
null when no usage matches.
The balances of the derived budgets with the highest spend, highest first, at most as many as the size query parameter allows.
Empty for a budget without each.
true when more derived budgets exist than derived lists. It isn't a pagination cursor: GET /v1/ai-cost-management/budget-balances with filter[budget.id] lists the balance of every derived budget.
Changes
- info
endpoint added
- info