Lago × Metabase

How to build Lago billing dashboards in Metabase

Lago is an open-source metering and usage-based billing platform — events, billable metrics, plans, invoices, and prepaid wallets. Metabase is where you turn that into shared dashboards for usage revenue, MRR, and invoicing. Because Metabase reads from SQL databases, the reliable way to connect them is a small pipeline: sync Lago into a database or warehouse on a schedule, then point Metabase at it. This guide walks through that path end to end — including a free option with no paid connector.

Heads up: Metabase connects to SQL databases and warehouses — it does not ship a native Lago connector. For dashboards that need history, sync Lago (via its API and webhooks) into a database — or, if you self-host, query its Postgres via a read replica.

How do you connect Lago to Metabase?

Metabase connects to SQL databases and warehouses — not to SaaS APIs directly, and there's no native Lago connector. So connecting Lago to Metabase means one thing: run a small pipeline that copies Lago data into a database on a schedule, then connect Metabase to that database. If you self-host Lago, you can also point Metabase at a read replica of its Postgres. Once the data lands, the models, metrics, and SQL later in this guide all work.

The good news: this doesn't require a paid tool. Use a managed connector if you want zero maintenance, or a free, code-based sync you host yourself — both are covered in Build the pipeline below, and in more depth in our guide to building a data pipeline.

What can you analyze from Lago data in Metabase?

  • Usage revenue — metered consumption by billable metric
  • Recurring MRR — subscription plan charges over time
  • Invoices and fees — invoiced revenue by fee type
  • Wallets and credits — prepaid balance and consumption
  • Overage — usage beyond included allowances
  • Coupons and credits — discounts and their revenue impact

Which Lago dashboards should you build in Metabase?

For: Finance, product

Usage & billable metrics

What drives usage-based revenue.

  • Metered usage by billable metric over time (line)
  • Usage revenue by metric (bar)
  • Customers by usage tier (table)
  • Overage vs. included usage (stacked bar)
For: Finance, RevOps

Recurring & total revenue

Recurring plan charges plus usage on top.

  • MRR from recurring plan charges (number + trend)
  • Recurring vs. usage revenue split (stacked bar)
  • Net new MRR per month (bar)
  • Revenue by plan (bar)
For: Finance, ops

Invoices & fees

Billed amounts and their composition.

  • Invoiced revenue by month (bar)
  • Fees by type: subscription, charge, add-on (stacked bar)
  • Invoice status and AR (table)
  • Credits and coupons applied (table)
For: Finance, product

Wallets & prepaid credits

Prepaid balance and how fast it burns.

  • Wallet balances outstanding (number)
  • Credit top-ups vs. consumption (dual line)
  • Burn rate by customer (table)
  • Customers near zero balance (table)

How do you build the Lago → Metabase pipeline?

For dashboards that need history and reliability, land Lago data in a database first, then connect Metabase to that database.

No paid tool required. A fully free stack: a small dlt or hand-written script (extract) → a free Postgres database like Neon or Supabase (load) → a scheduler such as GitHub Actions cron (host) → Metabase (visualize). For hosting and scheduling details, see our data pipeline guide.

Connector options

  • dlt (free, code) — wrap the Lago API in a small Python pipeline for incremental, no-vendor loads. The lightest path to a maintainable sync.
  • Lago API (free, raw) — paginate customers, subscriptions, invoices, fees, and wallets into your own pipeline.
  • Webhooks (events) — stream invoice and subscription events into a table for near-real-time dashboards.
  • Postgres read replica (self-hosted) — if you run Lago yourself, point Metabase at a read replica of its database.

Notes

  • Land raw tables first, then build clean models on top.
  • Amounts are in _cents fields — divide in a model layer.
  • Keep usage (charge) fees separate from subscription fees.
  • Model wallet balances and transactions separately from invoiced revenue.

Can you generate a Lago dashboard with AI?

Yes — and once Lago data is synced into a database, this is the fastest way to a strong first draft. First give an AI assistant a way to read your Metabase schema and create questions and dashboards, then paste the prompt below. It builds the dashboard from your database tables and tells the agent to skip metrics the schema can't support instead of faking them.

Two ways to let an assistant query and build in Metabase

Both connect to a Metabase instance that's already pointed at your synced database — the pipeline above moves the data; these just let the assistant read and write Metabase. Pick whichever fits your setup:

Metabase MCP

Best for
Chat clients (Claude, Cursor, Codex)
Enable
Admin → AI → MCP
Endpoint
https://<your-metabase>/api/metabase-mcp
Auth
OAuth handled by Metabase

Metabase CLI

Best for
Terminal agents, scripts, and CI
Install
npm install -g @metabase/cli
Auth
Browser OAuth (v62+) or an API key
Docs
@metabase/cli

Set up the Metabase MCP server

Enable it under Admin → AI → MCP, then point your client at the endpoint:

ClaudeClaude Code CLI
# Metabase built-in MCP (replace with your instance URL)
claude mcp add --transport http metabase https://your-metabase.example.com/api/metabase-mcp
Cursor~/.cursor/mcp.json or .cursor/mcp.json
{
  "mcpServers": {
    "metabase": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://your-metabase.example.com/api/metabase-mcp"]
    }
  }
}

Clients with native remote support can use a "url" field instead of the mcp-remote bridge. Confirm the current endpoint in the Metabase MCP docs.

Set up the Metabase CLI

Install it globally, then authenticate once (the binary is mb):

Install & authenticateshell
# Install the CLI (the binary is `mb`)
npm install -g @metabase/cli

# Authenticate once — opens your browser on Metabase v62+, or use an API key
mb auth login --url https://your-metabase.example.com
mb auth status

On Metabase v62+ mb auth login opens your browser; older servers fall back to an API key. A terminal-based assistant can then inspect your schema (mb db schemas, mb table get --include fields) and create content (mb card create, mb dashboard create) against the synced tables.

Prompt: build the Lago Billing Overview dashboard

With MCP or the CLI connected, paste this into your assistant to generate the dashboard:

Prompt for creating a Lago Billing Overview dashboard
Create a polished Metabase dashboard for Lago usage-based billing analytics
using the available Lago tables in this database.

Goal: Help finance and product leaders understand usage-based revenue, recurring
MRR, invoices, and prepaid credit (wallet) consumption from Lago data.

First, inspect the schema and identify the available Lago tables. Do not assume
exact table names. Map the raw data into these analytical concepts where
possible: Customers, Subscriptions, Plans, Billable metrics, Events (usage),
Invoices, Fees, Wallets/Credits, and Coupons.

Important:
- Build the dashboard from durable database/warehouse tables (Lago API/webhooks,
  or its Postgres if self-hosted).
- Separate recurring subscription revenue (MRR) from usage-based (metered)
  revenue; document the rating logic.
- Report usage against included allowances so overage is visible.
- Track wallet (prepaid credit) balances and consumption separately.
- Report in a single reporting currency.
- Do not claim Metabase connects natively to Lago unless that is explicitly true
  in this environment.

Dashboard title: Lago Billing Overview

Sections:
1. Executive summary (KPI cards): MRR; Usage revenue this month; Invoiced
   revenue; Outstanding wallet balance; Net new MRR; Overage revenue.
2. Usage & billable metrics: Usage by metric over time; Usage revenue by metric;
   Overage vs. included.
3. Recurring & total revenue: MRR from recurring charges; Recurring vs. usage
   split; Revenue by plan.
4. Invoices & fees: Invoiced revenue; Fees by type; AR.
5. Wallets & credits: Wallet balances; Top-ups vs. consumption; Burn rate.

Filters: Plan, Billable metric, Customer, Currency, Date range.

Before finalizing, create or recommend reusable Metabase models:
modeled_lago_usage, modeled_lago_invoices, modeled_lago_wallets, and
modeled_lago_mrr (a monthly recurring-MRR model).

Output: Build the dashboard if you have permission; otherwise provide the exact
questions, SQL, model definitions, and layout. Include caveats for any metric
that cannot be calculated from the available schema. Reconcile totals against
Lago. Keep it practical, dense, and executive-readable. Avoid vanity metrics.

How should you model Lago data in Metabase?

Core tables

ConceptGrainKey columns
customersone row per customerid, external_id, created_at, currency
subscriptionsone row per subscriptionid, customer_id, plan_id, status, started_at, terminated_at
billable_metricsone row per metricid, code, name, aggregation_type
eventsone row per usage eventtransaction_id, external_subscription_id, code, properties, timestamp
invoicesone row per invoiceid, customer_id, total_amount_cents, status, payment_status, issuing_date
feesone row per feeid, invoice_id, charge_id, fee_type, amount_cents
walletsone row per walletid, customer_id, balance_cents, status

Modeling advice

  • Build a modeled_lago_mrr table from recurring subscription fees, excluding usage charges.
  • Keep usage rating in one model so overage and included allowances are auditable.
  • Aggregate raw events to the billable-metric grain for usage analysis.
  • Model wallets and wallet transactions separately from invoices.
  • Reconcile modeled revenue against Lago before trusting the numbers.

Which Lago metrics should you track in Metabase?

MetricDefinitionNotes
Usage revenueRated metered consumption (charge fees).By billable metric.
MRRRecurring subscription fees, normalized monthly.Exclude usage charges.
Invoiced revenueTotal billed in a period.Recognize per your accounting policy.
Overage revenueUsage beyond included allowance.Signals upsell opportunity.
Wallet balanceOutstanding prepaid credits.Track consumption/burn rate.
Churn rateTerminated ÷ active subscriptions.Split voluntary vs. failed payment.

What SQL powers Lago dashboards in Metabase?

These assume the modeled tables above (PostgreSQL dialect, amounts in cents). Adjust identifiers to match your schema.

Usage revenue by billable metricPostgreSQL

Rated metered consumption, grouped by metric.

-- Metered usage revenue by billable metric
SELECT
  date_trunc('month', f.created_at) AS month,
  bm.name                           AS billable_metric,
  ROUND(SUM(f.amount_cents) / 100.0, 2) AS usage_revenue
FROM fees f
JOIN charges c          ON c.id = f.charge_id
JOIN billable_metrics bm ON bm.id = c.billable_metric_id
WHERE f.fee_type = 'charge'
GROUP BY 1, bm.name
ORDER BY 1, usage_revenue DESC;
Recurring MRR and ARRPostgreSQL

From subscription fees, excluding usage charges.

-- Recurring MRR from subscription fees (excludes usage charges)
SELECT
  ROUND(SUM(mrr), 2)       AS mrr,
  ROUND(SUM(mrr) * 12, 2)  AS arr,
  COUNT(*)                 AS active_subscriptions
FROM modeled_lago_mrr
WHERE month = date_trunc('month', CURRENT_DATE);
Wallet balances and consumptionPostgreSQL

Prepaid credit outstanding and how much has been used.

-- Prepaid credit balance and consumption
SELECT
  w.customer_id,
  ROUND(w.balance_cents / 100.0, 2)                       AS balance,
  ROUND(SUM(wt.credit_amount) FILTER (
    WHERE wt.transaction_type = 'outbound') / 100.0, 2)   AS consumed_credits
FROM wallets w
LEFT JOIN wallet_transactions wt ON wt.wallet_id = w.id
WHERE w.status = 'active'
GROUP BY w.customer_id, w.balance_cents
ORDER BY balance ASC;

What are common mistakes when analyzing Lago in Metabase?

Running dashboards off a one-time CSV export.→ Schedule the sync so data stays fresh — a manual export goes stale the moment someone acts on it.
Folding usage charges into MRR.→ MRR is recurring subscription revenue — keep metered charge fees in a separate usage-revenue line.
Analyzing raw events without aggregating.→ Roll events up to the billable-metric grain, or usage numbers are noise.
Mixing wallet balances into revenue.→ Prepaid credits are a liability until consumed — model wallets separately from invoiced revenue.
Never reconciling with Lago.→ Sanity-check modeled usage and invoiced revenue against Lago's own reports before trusting them.

Related analytics

Related metrics

Related integrations

FAQ

Does Metabase connect natively to Lago?
No. Metabase reads SQL databases and warehouses. Sync Lago into a database first (its API and webhooks) — or, if you self-host Lago, point Metabase at a read replica of its Postgres.
How do I separate usage revenue from MRR?
Lago fees carry a fee_type. Treat subscription fees as recurring MRR and charge fees as usage revenue, and keep the rating logic in one modeled layer so the two never blur.