Skip to content
Beta — Truss is in public beta. Documentation is actively updated but may not reflect the latest changes. Report issues on GitHub.

Billing

Truss includes a built-in billing system with plan tiers, usage metering, and quota enforcement. The billing module is fully managed from the dashboard and API.

Plan Tiers

Truss offers four plan tiers. Each tier defines limits for database size, storage, authentication MAU (monthly active users), API requests, branches, and webhooks.

FeatureStarter ($9/mo)Pro ($29/mo)Team ($89/mo)Business ($299/mo)
Projects1525Unlimited
Database size1 GB15 GB100 GB500 GB
Storage2 GB150 GB500 GB2 TB
Auth MAU2,000100,000500,0002,000,000
Bandwidth5 GB100 GB500 GB5 TB
Database branches0520Unlimited
API rate limit / min1001,0005,00050,000
Seats115 (+$15/seat)10 (+$15/seat)
Feature flags1575300Unlimited
Flag segments1030150Unlimited
Flag evaluations / mo100K2M10MUnlimited
Flag log retention7 days30 days90 days365 days
Gateway rules50150500Unlimited

Plans are enforced server-side. When a quota is exceeded, the API returns 403 Forbidden with a reason field explaining which limit was hit.

Checking your current plan

Terminal window
curl http://localhost:8787/api/billing/plan

Returns the active plan tier, current usage, limits, and billing period dates.

Switching plans

Plan changes are handled through the checkout flow. From the dashboard, navigate to Billing and click the plan you want to switch to.

Usage Metering and Quotas

Truss continuously tracks usage across several dimensions:

Database size

Measured via pg_database_size(). Checked on every write operation and periodically in the background.

Storage size

Measured by summing object sizes across all S3 buckets for the tenant.

Auth MAU

Counted by querying Ory Kratos for unique identities that had at least one session in the current billing period.

API requests

Tracked in-memory per billing period. The counter increments on every /v1/* request.

Quota enforcement

Terminal window
# Check a specific quota
curl http://localhost:8787/api/billing/quota?resource=branch

Returns:

{
"allowed": true,
"current": 2,
"limit": 5,
"resource": "branch"
}

When allowed is false, the response includes a reason string (e.g., "Branch limit reached (5/5). Upgrade to Team for 20 branches.").

Usage snapshots

Truss periodically writes usage snapshots for historical billing reports and trend charts in the dashboard.

Terminal window
curl http://localhost:8787/api/billing/usage

Returns current-period usage across all metered dimensions.

Booster Packs

Booster packs let you add capacity to a specific resource without upgrading your entire plan. They are one-time purchases that extend your limits for the current billing period.

Available boosters:

BoosterAmountDescription
Extra storage+10 GBExtends S3 storage quota
Extra MAU+5,000Extends authentication MAU quota
Extra API requests+500,000Extends monthly API request quota
Extra branches+5Extends database branch quota

Purchasing a booster

From the dashboard, navigate to Billing > Boosters and click the booster you need.

Viewing active boosters

Terminal window
curl http://localhost:8787/api/billing/boosters

Returns all active boosters for the current billing period with their quantities and expiry dates.

How boosters affect limits

Boosters are additive. If your Pro plan includes 25 GB of storage and you purchase an extra 10 GB booster, your effective limit becomes 35 GB.

Billing Dashboard

The billing panel in the dashboard provides a comprehensive view of your account:

Overview

  • Current plan — your active tier with a summary of included limits
  • Billing period — start and end dates of the current cycle
  • Payment method — managed via the customer portal

Usage meters

Visual progress bars for each metered resource:

  • Database size (current / limit)
  • Storage size (current / limit)
  • Auth MAU (current / limit)
  • API requests (current / limit)
  • Branches (current / limit)
  • Webhooks (current / limit)

Each meter is color-coded:

  • Green — under 60% usage
  • Amber — 60-85% usage
  • Red — over 85% usage

Plan comparison

A side-by-side comparison of all plan tiers, highlighting your current plan and showing upgrade paths.

Invoice history

Past invoices and payment history are accessible via the customer portal link in the billing panel.

Settings (Key-Value Store)

Billing and account settings are stored as key-value pairs. The API provides helpers for reading and writing settings:

Terminal window
# Get all settings
curl http://localhost:8787/api/billing/settings
# Update a setting
curl -X PUT http://localhost:8787/api/billing/settings \
-H "Content-Type: application/json" \
-d '{"key": "org_name", "value": "Acme Corp"}'

Common settings keys include: plan_id, org_name, billing_email.

Audit Logging

Truss maintains a cross-module audit trail. Every significant action is logged with context.

What gets logged

  • Authentication — user creation, deletion, state changes, session revocations
  • Authorization — permission checks, tuple modifications, OPL updates
  • Database — branch creation/deletion, backup creation/restore, schema changes
  • Billing — plan changes, booster purchases, quota enforcement events
  • Storage — bucket creation/deletion, policy changes
  • API keys — key creation, revocation
  • Webhooks — creation, deletion, test fires, enable/disable

Viewing audit logs

Terminal window
curl "http://localhost:8787/api/billing/audit-logs?limit=50&offset=0"

Each log entry includes:

  • action — the action type (e.g., branch.create, key.revoke, plan.change)
  • actor — who performed the action (user ID or system)
  • target — what was affected (resource type and ID)
  • metadata — additional context as JSON (e.g., old plan, new plan)
  • created_at — timestamp

Filtering

Terminal window
# Filter by action type
curl "http://localhost:8787/api/billing/audit-logs?action=branch.create"
# Filter by date range
curl "http://localhost:8787/api/billing/audit-logs?from=2025-01-01&to=2025-01-31"
# Search by keyword
curl "http://localhost:8787/api/billing/audit-logs?search=backup"

Dashboard

The Settings > Audit Log panel provides a filterable, paginated view of all audit entries with:

  • Action type filter dropdown
  • Free-text search
  • Date range picker
  • Expandable rows showing full metadata JSON

Retention

Audit logs are retained indefinitely by default. You can configure a retention period by setting the audit_log_retention_days key in billing settings.