Quickstart: send your first usage event

Create a key, send an event, count it with a meter, and read its usage.

  1. Create an API key in the dashboard (Settings › API keys). Keep it on your server; never ship it in a browser or mobile app.
  2. Send an event. The base URL is api.passage.ink, over HTTPS:
curl -X POST "$PASSAGE_BASE_URL/v1/events" \
  -H "Authorization: Bearer <api-key>" \
  -H "Idempotency-Key: 6f1c2d4e-0b7a-4f8e-9c3d-2a5b7e9f1c0d" \
  -H "Content-Type: application/json" \
  -d '{"events": [{"customer_id": "cus_42", "event_name": "api_call", "timestamp": "2026-11-02T14:05:00Z", "properties": {"endpoint": "/search"}}]}'
  1. Create a meter that counts those events:
curl -X POST "$PASSAGE_BASE_URL/v1/meters" \
  -H "Authorization: Bearer <api-key>" \
  -H "Content-Type: application/json" \
  -d '{"key": "api_calls", "event_name": "api_call", "aggregation": "count"}'
  1. Check usage: GET /v1/customers/cus_42/usage?meter=api_calls&from=2026-11-01&to=2026-12-01.

The header is Idempotency-Key, not X-Idempotency-Key (fixed 2026-10-30). The Authorization header follows the Bearer token scheme. Next: Authentication and API keys.

Links on this page