Quickstart

Meter your first event in minutes. The examples below use http://localhost:8000 — swap in your Abacus host. All /v1/* endpoints take X-API-Key.

Pre-launch: Abacus is pre-launch — the hosted API is not live yet, so the quickstart below runs against your own local instance of the open core today. At launch, paid plans claim their key on the claim page and the Starter plan signs up self-serve there.

1. Define a meter and price it

curl -X POST http://localhost:8000/v1/meters \
  -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" \
  -d '{"name":"api_calls","unit":"call","aggregation":"sum"}'

curl -X POST http://localhost:8000/v1/meters/api_calls/prices \
  -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" \
  -d '{"unit_price_cents": 5, "currency": "usd", "upto": null}'

2. Ingest usage events

curl -X POST http://localhost:8000/v1/events \
  -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" \
  -d '{"meter":"api_calls","customer":"cus_123","quantity":1,
      "idempotency_key":"evt_9f2c1a"}'
# {"id": 42, "deduped": false, "meter": "api_calls", ...}

3. Preview and finalize the invoice

curl "http://localhost:8000/v1/invoices/preview?customer=cus_123" \
  -H "X-API-Key: YOUR_API_KEY"
# {"lines": [{"meter":"api_calls","quantity":48210.0,
#   "unit_price_cents":5,"amount_cents":241050}], "total_cents":241050}

# Finalize burns prepaid wallet credits (if a wallet exists):
curl -X POST "http://localhost:8000/v1/invoices/finalize?customer=cus_123" \
  -H "X-API-Key: YOUR_API_KEY"
Full reference: every endpoint — method, path, auth, request and response shapes — is documented in OPENAPI.md in the product repo.

Pick a plan