Goal

Understand how many validations you have consumed in the current billing cycle, where you are relative to your plan's monthly limit, which operations account for most of the usage, and how usage patterns have shifted over time. Use these signals to plan scale-up events and to build usage alerts in your own monitoring stack.

Prerequisites

  • An active API key (mxcep_…). No additional permission beyond authentication is required for the usage endpoints.

Steps

1. Check the current-cycle quota snapshot

GET /v1/usage/summary returns your plan's monthly limit, validations consumed, validations remaining, and a pre-classified tone indicator (ok, warn, danger, none).

curl 'https://api.example.com/v1/usage/summary' \
  -H 'Authorization: Bearer mxcep_••••'
{
  "data": {
    "type": "usage_summary",
    "attributes": {
      "limit": 5000,
      "used": 2100,
      "remaining": 2900,
      "percent_used": 42.0,
      "tone": "ok",
      "resets_at": "2025-05-01T00:00:00Z"
    }
  }
}

Tone thresholds:

toneMeaning
okBelow 70% consumed.
warn70–89% consumed.
danger90%+ consumed.
nonePlan has no monthly limit.

2. Get raw API usage counters

GET /v1/api/usage provides a broader snapshot including requests today, requests this month, plan quota, and the current Banxico service status.

curl 'https://api.example.com/v1/api/usage' \
  -H 'Authorization: Bearer mxcep_••••'
{
  "data": {
    "requests_today": 42,
    "requests_month": 580,
    "quota": {
      "plan_slug": "basic",
      "limit": 1000,
      "used": 420,
      "remaining": 580,
      "resets_at": "2025-04-01T00:00:00Z"
    }
  }
}

3. Check rate-limit caps

Your plan enforces per-minute or per-hour rate limits in addition to the monthly quota. Check configured limits with:

curl 'https://api.example.com/v1/usage/limits' \
  -H 'Authorization: Bearer mxcep_••••'

This returns the plan-defined caps (e.g. requests per minute) separately from the monthly quota count.

4. Inspect per-operation breakdown

See which endpoints are consuming the most quota in the current cycle:

curl 'https://api.example.com/v1/usage/breakdown' \
  -H 'Authorization: Bearer mxcep_••••'

GET /v1/usage/history returns time-bucketed usage data. Combine with the insights trends endpoint for richer time-series analysis.

curl 'https://api.example.com/v1/usage/history' \
  -H 'Authorization: Bearer mxcep_••••'

6. View the usage heatmap

GET /v1/usage/heatmap shows activity density by hour of day and day of week — useful for understanding peak usage windows.

curl 'https://api.example.com/v1/usage/heatmap' \
  -H 'Authorization: Bearer mxcep_••••'

7. Export usage data

Download raw usage data as CSV or XLSX for ingestion into your analytics pipeline:

curl 'https://api.example.com/v1/api/usage/export?format=csv' \
  -H 'Authorization: Bearer mxcep_••••' \
  --output usage-export.csv

What's next