Skip to main content
GET
/
api
/
v1
/
billing
/
spending
curl "https://api.mor.org/api/v1/billing/spending?year=2026&mode=gross" \
  -H "Authorization: Bearer sk-your-api-key"
{
  "year": 2026,
  "mode": "gross",
  "months": [
    { "year": 2026, "month": 1, "amount": "-12.45", "transaction_count": 340 },
    { "year": 2026, "month": 2, "amount": "-8.20", "transaction_count": 210 },
    { "year": 2026, "month": 3, "amount": "0.00", "transaction_count": 0 }
  ],
  "total": "-45.67",
  "currency": "USD"
}
Get monthly spending summaries for a calendar year. Use this endpoint to answer how much you used per month without fetching individual usage line items. Returns all 12 months, including months with zero spending.

Headers

Authorization
string
required
API key or Cognito JWT: Bearer sk-xxxxxx

Query Parameters

year
integer
Year to retrieve spending for. Defaults to the current year.
mode
string
default:"gross"
How spending is calculated:
  • gross — Count usage charges only
  • net — Include refunds in the calculation

Response

year
integer
Year covered by this response.
mode
string
Spending calculation mode (gross or net).
months
array
Twelve months of spending data, one entry per calendar month.
total
string
Total spending for the year.
currency
string
Currency code (USD).
curl "https://api.mor.org/api/v1/billing/spending?year=2026&mode=gross" \
  -H "Authorization: Bearer sk-your-api-key"
{
  "year": 2026,
  "mode": "gross",
  "months": [
    { "year": 2026, "month": 1, "amount": "-12.45", "transaction_count": 340 },
    { "year": 2026, "month": 2, "amount": "-8.20", "transaction_count": 210 },
    { "year": 2026, "month": 3, "amount": "0.00", "transaction_count": 0 }
  ],
  "total": "-45.67",
  "currency": "USD"
}
Use Get Monthly Spending for charts and dashboards. Use List Usage when you need per-request detail.