Skip to main content
This template builds pay-as-you-go billing like Google BigQuery with Lago: no platform fee, a free first tier, then a price per unit of data processed. It suits data and infrastructure companies that charge on volume processed. Legacy (v1): Clone Google BigQuery pricing with subscriptions.

Pricing structure

This template makes the first 10 TiB of each month free.

How it maps to Lago

Get started

1

Set up Lago

Use https://api.eu.getlago.com for the EU cluster. API endpoints live under /api/v2 and require the product catalog to be enabled on your organization.
2

Create a billable metric

Refer to the API reference.
3

Create a metered product

4

Create a rate card

The graduated rate prices the first 10 TiB at $0 and every TiB above at $6.25. Do not send from_value. The last tier has to_value: null.
Refer to the API reference and the graduated model.
5

Create a plan and apply the rate card

Refer to the API reference and the plans guide.
6

Create a customer

An existing external_id returns 422 instead of updating the customer. Refer to the API reference to create a customer.
7

Create a contract

Replace __PLAN_CODE__ with bigquery_payg.
The plan supplies the contract’s initial applied rate cards. A future started_at creates a pending contract that becomes active on that date. Only one pending or active contract can use a given external_id at a time. Refer to the API reference to create a contract.
The example dates are in the future. To test right away, set each rate’s effective_from to today and omit started_at, which defaults to now.
8

Ingest usage via events

Refer to the API reference and the usage ingestion guide.
9

Monitor current usage

Track usage across the contract’s open billing periods.
The response returns amount_cents, taxes_amount_cents, total_amount_cents and a rate_cards array with usage per applied rate card. Pending contracts have no usage. Totals can span several invoices, so this is not a preview of one invoice. Filter with rate_card_code, product_code, product_filter_code or product_type. Refer to the API reference to get current usage.

Worked example

Over one full monthly period, the customer processes 25 TiB.

What changed from v1

  • The v1 template granted $300 of free credits through a wallet that expired after 90 days. The v2 API does not document wallets, so this template omits the credit grant.
  • The charge becomes a rate card and a graduated rate. Tiers set to_value only.
  • Events target external_contract_id instead of external_subscription_id.

Graduated model

Price quantity across tiers.

Rate cards

Currency, billing timing and proration per product or filter.

Contracts

Apply a plan to a customer.

Retrieve current usage (API)

GET /api/v2/contracts/{external_id}/current_usage