ShipGauge

Margin & StackLedger

Map customer MRR to LLM cost and export for accounting

Understand margin = customer revenue − LLM spend for each customer_id.

Prerequisites

  • Pro or Team plan (customer cost / margin feature)
  • Events that include customer_id
await sg.record({
  feature_id: "chat",
  model: "gpt-4o-mini",
  input_tokens: 100,
  output_tokens: 40,
  customer_id: "cus_123",
});

Margin view

  1. Open Project → Margin.
  2. Map each customer_id to monthly MRR (USD), or sync from Stripe when configured.
  3. Inspect gross margin on a rolling window (typically 30 days).

StackLedger

For indie operators linking LLM burn into bookkeeping:

  1. Settings → Integrations → set StackLedger project id.
  2. Ensure server env STACKLEDGER_API_URL + STACKLEDGER_API_KEY (hosted stack handles this for you when bundled).
  3. Export Schedule C–friendly CSV via the Margin export control, or:
GET /api/projects/{projectId}/export?type=stackledger

Team RBAC note

On Team plans, member roles are read-mostly on dashboards; admin manages billing, invites, and integrations.

Next