Skip to main content
GET
/
billing
/
consumption
Billing consumption
curl --request GET \
  --url https://api.goyappr.com/billing/consumption \
  --header 'Authorization: Bearer <token>'
{
  "from": "2023-11-07T05:31:56Z",
  "to": "2023-11-07T05:31:56Z",
  "group_by": "<string>",
  "data": [
    {
      "period": "2026-05-07",
      "total_amount_cents": 123,
      "count": 123,
      "agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.goyappr.com/llms.txt

Use this file to discover all available pages before exploring further.

Aggregated debits from your credit account, bucketed by date and product. Useful for usage dashboards, monthly reconciliation, and anomaly detection. By default, top-ups are excluded — pass include_topups=true to fold them in for full statement parity.

Common queries

# This month's voice-call spend, day by day
curl "https://api.goyappr.com/billing/consumption?from=2026-05-01T00:00:00Z&group_by=day&product=voice_call" \
  -H "Authorization: Bearer $YAPPR_API_KEY"

# Eval spend for the year, monthly
curl "https://api.goyappr.com/billing/consumption?from=2026-01-01T00:00:00Z&group_by=month&product=eval_run" \
  -H "Authorization: Bearer $YAPPR_API_KEY"

# Per-agent voice-call spend last 30 days
curl "https://api.goyappr.com/billing/consumption?group_by=agent&product=voice_call" \
  -H "Authorization: Bearer $YAPPR_API_KEY"

# Total spend for one specific suite_run (no native filter — query eval_runs and sum)
# (use `GET /agent-eval/runs?suite_run_id=...` and sum `total_cost_cents` client-side)

Products

ProductWhat it covers
voice_callPaid call minutes (inbound + outbound + web). Per-agent grouping populates here.
eval_runAgent-eval runs.
phone_numberMonthly number rent.
topupPositive credit purchases. Excluded by default.
refundReverse charges (negative).

Authorizations

Authorization
string
header
required

Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys.

Query Parameters

from
string<date-time>

Start of the window. Defaults to 30 days ago.

to
string<date-time>

End of the window (exclusive). Defaults to now.

group_by
enum<string>
default:day

Bucket granularity. agent returns one row per agent_id (currently only populated for voice_call).

Available options:
day,
month,
total,
agent
product
enum<string>

Filter to a single product category.

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

Response

Consumption rows

from
string<date-time>
to
string<date-time>
group_by
string
data
object[]