Skip to main content
GET
Billing consumption
Aggregated charges to your account, bucketed by date and product. Useful for usage dashboards, monthly reconciliation, and anomaly detection. Amounts are signed the ledger’s way: a charge is a positive total_amount_cents, and credits added are negative. By default, credit purchases are excluded — pass include_topups=true to fold them in as topup. For the balance itself — every top-up, credit, refund and adjustment beside each day’s usage, with an opening and closing balance — read GET /billing/transactions.

What a row counts

count is the number of charged entries in the row: one per charge in the ledger. A call’s minutes are one entry, so on voice_call it is the number of call charges, not minutes; a call with no charge in the ledger is not in it, so it can be lower than the calls GET /calls lists. A charge is dated when it was debited from the balance, and the report’s days and months are those dates. A call is charged when it settles, so a call that started at 23:58 and ended after midnight is counted on the next day, and from / to select charges by that moment too.

Common queries

Cost and outcomes together

group_by=agent,disposition returns one row per agent per outcome, each with its own count and total_amount_cents. That is both columns of a per-client report — what an agent cost, and how its calls ended — without joining GET /calls and GET /dispositions by hand.
group_by=disposition gives the same breakdown for the workspace as a whole. An outcome is a fact about the call a charge belongs to, so a charge with no call behind it — a number’s monthly rent, a top-up, an eval run — comes back as disposition: null. A call nobody has dispositioned lands in the same bucket; the row’s own agent_id tells the two apart. For the calls themselves, one per row, export them from GET /calls/export.

Cost by where the call came from

group_by=source returns one row per call origin, so a workspace’s own rehearsals are separated from the calls it was paid for without exporting the call log once per source and adding the totals up by hand. agent,source answers the same question per agent. The values are the ones GET /calls reports and GET /calls?source= filters by — test, shared_link, api, phone_inbound, phone_outbound — so the two reads agree call for call.
An origin is a fact about the call a charge belongs to, so a charge with no call behind it — a number’s monthly rent, a top-up, an eval run — comes back as source: null. A call recorded before origins were written down comes back as source: "unknown".

Cost by number, and whose carrier it is

group_by=phone_number returns one row per workspace number per product: the number a call used (the number it called from, or the number that answered it) and the number a monthly rent was for. A call counts once, under the workspace number it ran on: a call your carrier number made to one of your Yappr numbers is an incoming call on that Yappr number, and counts there, not under the carrier number. provider says whose carrier the number is on — the number’s own provider from GET /phone-numbers, the same word a call from it carries on GET /calls:
  • external — a number in your own Telnyx account, added to a carrier account. Telnyx billed you for these calls’ phone minutes on your Telnyx account; the row’s amount is Yappr’s charge beside that bill, at the phone-call price, the same price as a call from a number bought from Yappr. Yappr charges no monthly rent for these numbers.
  • telnyx — a number bought from Yappr.
A charge with no number behind it — a browser call, a call on a SIP endpoint, an eval run, a top-up — comes back as phone_number_id: null. To list the calls behind an external row, filter GET /calls by carrier_account_id. A number you remove — from a carrier account, or a number bought from Yappr that you release — keeps its row and its phone_number_id, so its spend stays where it was. phone_number is the number its calls carry, and provider says whose account they ran on; a removed number’s rent keeps the id with phone_number and provider null. One exception: a number removed from a carrier account before 27 September 2026 did not keep its id. Its calls still come back under their own row, with its phone_number, provider: "external" and phone_number_id: null, and never in the row of charges with no number. Every charge in the window is counted, however many there are. If a charge’s call or number cannot be read, the report answers 500 rather than counting it under no number.

Cost by carrier account

group_by=carrier_account returns one row per carrier account per product: the Telnyx account each call ran on, with the account itself in carrier_account. An agency that keeps a Telnyx account per client reads each client’s carrier calls in one row, however many numbers the account has, and even for a number removed before 27 September 2026, whose phone_number row cannot carry an id: the call itself keeps the account it ran on.
The account is the call’s own carrier_account_id, as GET /calls reports it, else the account of the number it used. A charge on Yappr’s carrier — a call on a number bought from Yappr, and that number’s rent — is the row with carrier_account_id: null and provider: "telnyx"; a charge with no carrier at all — a browser call, a call on a SIP endpoint, an eval run — is the row with provider: null. An account that is no longer this workspace’s keeps its carrier_account_id with carrier_account: null. To list a row’s calls, filter GET /calls by carrier_account_id.

Names, order, and the rows nobody owns

Rows grouped by agent carry agent — the agent itself, { "id", "name", "archived_at" }, archived agents included — and agent_name beside agent_id, so a per-client report needs no second read of GET /agents. Two agents can share a name; the id is what tells them apart. agent is null where agent_id is, and for an agent that is not this workspace’s: a call this workspace was charged for on another workspace’s agent keeps that agent_id, which GET /agents/{id} answers 404 for, and is not named here. sort sets the order: amount (largest first — the default, and the order the report has always used), period (oldest first, for group_by=day or month), or name (agent, then outcome, then origin, then number, then carrier account, then product, A to Z). period on a grouping with no dates, and name on day or month rows, are refused with 400 CONSUMPTION_QUERY_INVALID, as is any other value. Days and months with no charge are not rows: a month by day lists the days something was charged. Some spend belongs to no agent or no known origin, and it is still counted — never dropped: Group by agent and source together (group_by=agent,source) to see which of these a figure holds.

Products

These six are the names the product filter takes and the only values product comes back as.

Parameters

The report takes from, to, group_by, product, include_topups, timezone and sort, each at most once. group_by is day when left out. group_by=total returns one row per product for the whole window, period: "total": the period’s spend on calls, eval runs and numbers in one read. Anything else is refused with 400 CONSUMPTION_QUERY_INVALID, naming it, rather than ignored. That matters most for a per-client bill: there is no agent filter, and ?agent_id= used to answer with the whole workspace’s spend as if it were one client’s. Ask for group_by=agent (or agent,disposition) and read that client’s row instead. include_topups is true or false; any other value is refused rather than read as false. product is one of the names under Products (the underlying type names, such as voice_usage, are accepted too); anything else — minutes, voice — is refused with the list, where it used to answer 500. from and to must be real ISO 8601 timestamps: 2026-02-30 and Aug 2026 are refused, not answered 500. And from after to is refused rather than answered with nothing in it — a report with the dates swapped used to read as a month that cost $0. to is inclusive, and a date-only to covers that whole day on the report’s clock (below): from=2026-08-01&to=2026-08-31 is all of August, up to the last moment of the 31st. With from left out the window starts 30 × 24 hours before now. That is not the dashboard’s Last 30 days, which is 30 whole days on the workspace’s clock, today included: to read the same days, send from as the date 29 days before today.

Days on your clock

Days and months are the workspace’s own — the clock set with timezone on PUT /call-windows, and the one the dashboard shows the same money on. A charge at 22:30 UTC on 30 September is 1 October in an Asia/Jerusalem workspace, and group_by=day puts it there. A date-only from or to is a whole day on that clock too; a value with a time in it means that moment, whatever the zone. A workspace that never set its clock is on UTC (GET /call-windows answers timezone_set: false), so its days are UTC days. The dashboard then shows the same report on the reader’s browser clock and says so; set the clock to make both read the same days. Pass timezone to read the report on another clock — timezone=UTC gives the UTC days this report used before it followed the workspace. It is an IANA name (Asia/Jerusalem, Europe/London, UTC); an offset such as +03:00 or a name the API does not know is refused with 400 CONSUMPTION_QUERY_INVALID. range.timezone in the response names the clock that was used, and range.from and range.to the window that was read, as instants: a date-only to ends at that day’s last microsecond on the clock, …T23:59:59.999999Z on UTC and …T20:59:59.999999Z on Asia/Jerusalem in summer, the same form GET /billing/transactions gives.

Token usage

Buckets for token-metered products carry input_tokens, output_tokens and total_tokens alongside the amount. Today that means eval_run — eval charges are a direct function of tokens consumed, so these fields are what explain a given line. Products that don’t meter tokens omit these fields entirely rather than returning 0, so total_tokens being absent means “not applicable here”, never “nothing was used”.
Input dominates output by a wide margin on evals — often 150:1. That’s expected: the agent’s conversation context is re-sent on every turn, so a long case accumulates input tokens quadratically while output stays roughly constant per turn. If a suite is costing more than you expect, the lever is usually case length and prompt size, not the number of runs.

Authorizations

Authorization
string
header
required

Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys. No key is 401 MISSING_KEY; a key that is not one of ours, or is revoked, is 401 INVALID_KEY; an expired one is 401 EXPIRED_KEY. A valid key without the scope an operation needs is 403 INSUFFICIENT_SCOPE on every operation, and the message names the scope. Every response, a 401 included, carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a minute per API key. Every 429, whatever its code, carries Retry-After (whole seconds, never zero): the per-key budget's RATE_LIMIT asks for what is left of the minute, a route's daily cap (RATE_LIMITED) for the time until that cap resets. All four headers are listed in Access-Control-Expose-Headers, so a browser can read them. A path the API does not serve (an unknown sub-path, an id left empty) is 404 ROUTE_NOT_FOUND, and a method a served path does not take is 405 METHOD_NOT_ALLOWED with an Allow header; both are answered before any scope check, and nothing is read or changed. A trailing slash is ignored where it cannot be an id left empty (POST /calls/ is POST /calls) and refused where it can (GET /calls/). A doubled slash inside a path is merged into one before the request reaches the API (GET //calls is GET /calls).

Query Parameters

from
string<date-time>

Start of the window. Defaults to 30 × 24 hours before now — not the dashboard's "Last 30 days", which is 30 whole days on the workspace's clock, today included; send from as the date 29 days before today to read the same days.

to
string<date-time>

End of the window, inclusive. Defaults to now. A date-only value covers that whole day on the report's clock (timezone), up to its last moment; a date-only from starts at that day's first moment on the same clock.

timezone
string

The clock days, months and date-only windows are read on, as an IANA name. Defaults to the workspace's clock (set with timezone on PUT /call-windows); timezone=UTC reads UTC days. An offset such as +03:00, or a name the API does not know, is 400 CONSUMPTION_QUERY_INVALID. The response names the clock used in range.timezone.

Example:

"Asia/Jerusalem"

group_by
enum<string>
default:day

Bucket granularity, day when left out. total returns one row per product for the whole window, with period: "total". agent returns one row per agent_id (currently only populated for voice_call). disposition returns one row per outcome, and agent,disposition one row per agent per outcome — cost and outcomes on the same row, which is the whole of a per-client report in one read.

source returns one row per call origin — test, shared_link, api, phone_inbound, phone_outbound — which is what separates a workspace's own rehearsals from the calls it was paid for, and agent,source answers it per agent. The values are the ones GET /calls reports and GET /calls?source= filters by, so the two reads agree call for call.

An outcome, and an origin, are facts about the CALL a charge belongs to. A charge with no call behind it — a number's monthly rent, a top-up, an eval run — buckets as disposition: null / source: null, and so does a call nobody has dispositioned; the row's own agent_id tells the two apart.

phone_number returns one row per workspace number per product, with provider saying whose carrier it is: external rows are the calls placed on your own Telnyx account, whose phone minutes Telnyx billed you for separately; Yappr charges no rent for them. A call counts under the workspace number it ran on - the number it was placed from, or the workspace number that answered it - so a call your carrier number made to one of your Yappr numbers counts under that Yappr number. A charge with no number behind it — a browser call, a SIP endpoint call, an eval run, a top-up — buckets as phone_number_id: null. A number removed since keeps its row and its id.

carrier_account returns one row per carrier account per product - the Telnyx account each call ran on, named (carrier_account) - so an agency with an account per client can rebill each client its carrier calls. Calls on Yappr's carrier and their numbers' rent are one row (carrier_account_id: null, provider: telnyx), and charges with no carrier at all - browser and SIP endpoint calls, eval runs - another (provider: null). A carrier call keeps its account even when its number was removed.

Anything outside this list is 400.

Available options:
day,
month,
total,
agent,
product,
disposition,
agent,disposition,
source,
agent,source,
phone_number,
carrier_account
product
enum<string>

Filter to a single product category. The underlying type names (voice_usage, eval_run_charge, phone_number_purchase, phone_number_monthly, credit_purchase) are accepted too; anything else is 400.

Available options:
voice_call,
eval_run,
phone_number,
topup,
refund,
adjustment
include_topups
boolean
default:false

true or false. Any other value is refused with 400 rather than read as false.

sort
enum<string>
default:amount

Row order. amount — largest first (the default). period — oldest first; only with group_by=day or month. name — by agent name, then outcome, then origin, then number, then carrier account, then product, A to Z, with the unowned bucket last; not with day or month. Any other value, or one that does not fit the grouping, is 400 CONSUMPTION_QUERY_INVALID.

Available options:
amount,
period,
name

Response

Consumption rows

data
object[]
range
object

What the rows were read for, as the request resolved it.