Skip to content

Usage API

What the organization used this month and what it cost.

The same operations are in the interactive API reference, and the whole contract is in the OpenAPI document.

GET/v1/usage

This month's usage and spend

Returns what the organization used since the start of this calendar month (UTC) and what that use cost. Needs usage:read, and the caller must be an organization admin; a member gets 403. This operation accepts a personal access token or console session only, not an API key.

items counts use by product, always starting with api.requests, the number of requests made with your keys. limit on each item is currently always null: no cap is reported here. spend.products lists the priced use you pay for, one row per price it was charged at, so a price change part-way through the month shows as two rows and never as one averaged price. AI chat is one row for all its tokens.

amount_micros is what the use cost in total. pending_micros is the part not yet taken from the wallet. Both are in millionths of the currency unit: 6000000 is Rs 6. Free credit lowers the real charge; see GET /v1/usage/charges for how much each charge took from credit. Usage in a test key's sandbox is counted separately and is never charged. Reading costs nothing.

Accepts: personal access token. Open in the API reference

ParameterInTypeRequiredDescription
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

GET/v1/usage/charges

Each charge, newest first

Lists each priced charge, newest first, with when it happened, what it was for, how much and whether it has been taken from the wallet. Needs usage:read, and the caller must be an organization admin. This operation accepts a personal access token or console session only, not an API key.

Paged, newest first: limit is 1 to 100 (default 50, out of range values are clamped) and cursor is the next_cursor of the previous page. The cursor is opaque and never built by the client; a cursor this API did not return is a 400. has_more is true while another page exists. There is no total.

Each charge shows amount_micros, the full cost, and credit_micros, the part free credit paid; the wallet paid the rest. Zero-cost use is not listed. charged is false while the charge is waiting to be taken from the wallet.

Accepts: personal access token. Open in the API reference

ParameterInTypeRequiredDescription
limitqueryintegerNoHow many items to return. Default 50, at most 100.
cursorquerystringNoThe `next_cursor` of the previous page. Opaque; never built by the client.
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.