Skip to main content
GET
/
usage
/
summary
Monthly usage summary
curl --request GET \
  --url https://api.getmetacognition.com/usage/summary
{
  "period": "<string>",
  "start": "<string>",
  "end": "<string>",
  "tokens_in": 123,
  "tokens_out": 123
}
Returns a calendar-month usage rollup in UTC. If you omit month, the endpoint returns the current month.

Headers

Authorization: Bearer <access_token>

Query

month
string
"YYYY-MM". Omit for the current month.

Response — 200

period
string
Always "month".
start
string
First moment of the month in UTC.
end
string
First moment of the next month in UTC.
tokens_in
integer
Total ingress tokens for the month.
tokens_out
integer
Total egress tokens for the month.

Example

# Current month
curl -H "Authorization: Bearer $JWT" \
  https://api.getmetacognition.com/usage/summary

# Specific month
curl -H "Authorization: Bearer $JWT" \
  "https://api.getmetacognition.com/usage/summary?month=2026-04"
Response
{
  "period": "month",
  "start": "2026-05-01T00:00:00+00:00",
  "end":   "2026-06-01T00:00:00+00:00",
  "tokens_in": 12,
  "tokens_out": 27
}

Charting tip

Pull six months in parallel for a rolling chart:
import asyncio, httpx
from datetime import date

months = [(date(2026, m, 1)).strftime("%Y-%m") for m in range(1, 7)]

async def fetch(client, m):
    r = await client.get("/usage/summary", params={"month": m})
    return m, r.json()

async def main():
    async with httpx.AsyncClient(
        base_url="https://api.getmetacognition.com",
        headers={"Authorization": f"Bearer {jwt}"},
    ) as c:
        return dict(await asyncio.gather(*(fetch(c, m) for m in months)))

print(asyncio.run(main()))