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.
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}'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", ...}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"OPENAPI.md in the product repo.