Open Spanner
Open-source usage and metering infrastructure.
Open Spanner records product usage and turns it into queryable buckets, quota state, exports, and threshold signals for the systems around your product.
Use it as metering infrastructure: define the signals your product cares about, send usage from trusted backend services, enforce plan limits, inspect usage, and export clean data to billing, finance, analytics, support, or internal reporting tools.
Open Spanner does not replace payment processing, invoicing, taxes, or customer identity. It gives those systems a reliable usage and quota record.
Start Here
What is Open Spanner?
Understand the product model and where it fits in your stack.
Metering infrastructure
See what Open Spanner owns and what downstream systems still own.
Install Open Spanner
Run Open Spanner with Docker, Docker Compose, or directly from source.
Production deployment
Run the API, workers, Postgres, and published container image with production defaults in mind.
Choosing an SDK
Pick the right client for a backend service or worker.
Your first query
Query daily usage buckets for one subject and meter.
Product Flow
Define meters
Model the signals your product tracks: requests, seats, storage, tokens, jobs, or anything else you meter.
Choose dimensions
Add stable metadata fields for filtering, grouping, and export.
Record usage
Send idempotent usage events from backend services and workers.
Query buckets
Turn raw usage events into windows for reporting, limits, exports, and audits.
Manage plans
Assign subjects to plans, track quota progress, and check remaining entitlement.
Watch thresholds
Create alert rules for usage windows that cross important limits.
Explore use cases
See how API, AI, storage, seat, job, feature, and backfill metering fit real products.
Configure auth
Use dashboard sessions for people and API keys for services.
Share a workspace
Invite teammates, assign roles, and switch between isolated workspaces.
Common Workflows
Meter an API endpoint
Record request usage from a backend API handler.
Retry usage writes safely
Use idempotency keys so retries do not double-count usage.
Export usage
Produce CSV usage data for downstream billing, analytics, or audits.
Check entitlements
Gate product actions against plan limits before recording usage.