What you can see
- Ledger: every top‑up, charge, refund, and adjustment, with links back to the originating request/user.
- Charts: revenue, provider cost, and profit over time; usage by model; top users and cohorts.
- Users: active users, balances, total spend, last activity, and status - authorized/connected (Coming soon).
Ledger
Each row represents a financial event.- Types: deposit (top‑up), charge (usage), withdrawal.
- Core fields: id, timestamp, user, paywall, amount, status.
- Metering: prompt_tokens, completion_tokens, total_tokens (when applicable).
- Costs: provider_cost (COGS) and platform_fees (when applicable) to compute profit.
- Metadata: optional JSON for reconciliation (e.g., Stripe payment_intent, checkout_session, your internal ids).
- Use consistent user ids; prefer stable, pseudonymous identifiers.
- Include a requestId in your app and pass it in metadata for safe retries and auditing.
- For manual one‑off charges, record business context in metadata for downstream analytics.
Users view (soon)
- Summary per user: total spend, current balance, last activity, and authorization status.
- Drill‑down: per‑user ledger with filters by date, model, and event type.
- Actions: copy authorization/top‑up links for support, review recent errors, and validate connection.
Charts & KPIs
Track trends and health of your monetization.- Revenue: sum of usage charges for the selected period.
- Provider cost (COGS): cost of model usage at provider rates.
- Profit: revenue minus provider cost (and any applicable platform fees).
- Users: active payers, new payers, ARPU in period (soon).
In streaming requests, final token counts settle at the end of the stream.
Filtering & segmentation (soon)
Use filters across all views to answer precise questions:- Time: today, 7/30/90 days, custom dates, and compare periods.
- Model: e.g.,
openai/gpt-4o-mini
vsanthropic/claude-3.5
. - User attributes: id, status (authorized), high/low balance, new vs returning.
- Event type: deposits, charges, etc.
- Which models drive most revenue and profit this month?
- Who are my top spending users and what is their average cost to serve?
- How many active payers do I have and what is my ARPU?
Reconciliation (Stripe & custom rails)
Stripe top‑ups appear as deposits in the ledger. We recommend storing payment_intent or checkout_session in metadata for each deposit to reconcile with Stripe reports.Your own checkout. After payment success, call
POST /v1/user/balance/deposit
and include your payment id in metadata. Use idempotency for safe retries.- Always log
user
,requestId
, and ledgerid
in your app logs for easy cross‑reference. - Make webhook handlers idempotent and respond only after durable writes.
Export & integrations
- CSV export: Coming soon (download from Ledger and Users views, with column selection and date range).
- Programmatic export: Coming soon (API access for pulling ledger slices into your warehouse).