Skip to main content
Lava supports two ways to route requests through the gateway without charging a customer’s subscription. Use meter-only mode to attribute requests to a specific meter for cost tracking and analytics, or disable billing to preserve full customer context while skipping the subscription charge.
Prerequisites: You need a Lava merchant account with a configured meter and the Node.js SDK installed. For disable billing, you also need an existing customer.

When to Use Each Mode

ModeToken paramsCustomer charged?Customer tracked?Use case
Meter-onlymeter_slug onlyNoNoInternal tools, cost attribution, analytics
Disable billingcustomer_id + meter_slug + disable_billingNoYesFree trials, testing, promotional requests
In both modes, the provider cost is incurred by you as the merchant (as with all gateway requests). The difference from normal customer billing is that no charges are applied to the customer’s subscription. Usage is still tracked and visible in your dashboard.

Meter-Only Mode

Pass only a meter_slug when generating a forward token — no customer_id. Lava attributes the request to the specified meter for cost tracking and analytics, without any customer context.
import { Lava } from '@lavapayments/nodejs';

const lava = new Lava();

const data = await lava.gateway('https://api.openai.com/v1/chat/completions', {
  body: {
    model: 'gpt-4o-mini',
    messages: [{ role: 'user', content: 'Hello!' }],
  },
  meter_slug: 'my-meter',
});

How It Works

  1. Lava validates your secret key and resolves the meter.
  2. The request is forwarded to the AI provider.
  3. Usage (tokens, cost) is recorded and attributed to the meter.
No customer context is involved — meter-only requests don’t require a checkout, customer, or subscription. This makes it ideal for internal usage where you want per-meter cost tracking without customer setup.

Disable Billing

Pass customer_id, meter_slug, and disable_billing: true to route a request with full customer context without charging their subscription. The customer’s identity is preserved in usage records, but no credits are deducted from their plan.
import { Lava } from '@lavapayments/nodejs';

const lava = new Lava();

const data = await lava.gateway('https://api.openai.com/v1/chat/completions', {
  body: {
    model: 'gpt-4o-mini',
    messages: [{ role: 'user', content: 'Hello!' }],
  },
  customer_id: 'conn_abc123',
  meter_slug: 'my-meter',
  disable_billing: true,
});

How It Works

  1. Lava validates your secret key, resolves the customer and meter.
  2. The customer’s subscription balance is not checked or deducted.
  3. The request is forwarded to the AI provider.
  4. Usage is recorded and attributed to the customer.
Subscription entitlements are still enforced when billing is disabled. The meter must be on the customer’s active plan — disable_billing only skips the charge, not authorization.

Common Use Cases

  • Free trials — let new customers use your service before they subscribe.
  • Testing integrations — verify a customer’s setup end-to-end without deducting their credits.
  • Promotional requests — absorb the cost of specific requests without affecting the customer’s plan.
  • Debugging — reproduce a customer’s issue with their full auth context intact.

Comparing All Request Modes

For reference, here is how meter-only and disable billing fit alongside Lava’s other request modes:
ModeToken paramsCustomer charged?Customer tracked?
Gateway (simplest)noneNoNo
Meter-onlymeter_slugNoNo
Customer billingcustomer_id + meter_slugYesYes
Billing disabledcustomer_id + meter_slug + disable_billingNoYes

Next Steps

Node.js SDK

Full SDK reference including all forward token options

Meters

Configure pricing and metering for your API

Checkout

Set up customer checkout to start billing

Usage Analytics

Query and visualize usage data from metered requests