---
title: "API Monetization"
description:
  "Price, bill, and meter your APIs from the gateway. Subscriptions, plan-scoped
  API keys, real-time metering, soft/hard quota enforcement, and a self-serve
  developer-portal pricing page."
canonicalUrl: "https://zuplo.com/features/api-monetization"
sourceUrl: "https://zuplo.com/features/api-monetization"
pageType: "feature"
generatedAt: "2026-08-03"
---

# API Monetization

> Turn API traffic into revenue: meter usage, sell plans, and enforce quotas
> directly on the gateway you already run. Subscriptions, plan-scoped API keys,
> real-time metering, soft/hard quota enforcement, and a self-serve
> developer-portal pricing page — no custom billing service to build. Included
> on Free and Builder plans; available on Enterprise.

## Why this matters

Billing logic doesn't belong in your API code. Every API team that wants revenue
ends up building the same metering, billing, and entitlement plumbing —
multiplied across thousands of teams, that's an enormous waste. The gateway
already sees every request, so it should be the meter, the entitlement check,
and the bridge to billing.

Problems teams hit without this:

- **Billing plumbing = your weekend** — Building a metering pipeline, batch
  jobs, billing reconciliation, and a usage dashboard yourself. Three sprints
  in, you're maintaining a billing system, not shipping the API.
- **Billing leakage eats 10–20% of API revenue** — Plan limits live in your
  docs, not your gateway. Customers blow through quotas, sales has to chase, and
  every "upgrade conversation" is two weeks of Slack instead of a button click.
- **Metering and access tied to two systems** — Your billing system knows the
  subscription; your gateway knows the request. They drift — a customer
  downgrades, the gateway forgets, and they get pro features for another month.
- **AI cost passthrough is a math problem** — Each LLM call costs a different
  amount; your customer sees it as a request, you see it as $0.04. Multiply by a
  thousand customers and the gross-margin spreadsheet gets worse every quarter.

## What you get

A complete monetization stack, built into the gateway:

- **Billing wired up from day one** — Subscriptions, invoicing, payments, plan
  changes, proration, and cancellation are handled out of the box. Zuplo manages
  entitlement and metering at the edge and stays in sync with your payment
  provider automatically.
- **Real-time metering, not batch jobs** — Every request increments your meters
  in real time at the edge. No nightly reconciliation, no delay between usage
  and bill — the gateway is the meter.
- **Self-serve pricing page included** — Drop `zuploMonetizationPlugin` into
  your developer portal and a Pricing page, Subscription Management, and Usage
  Dashboard appear. Customers subscribe, upgrade, and watch their quota without
  a sales touch.

## Compose any pricing model from the same primitives

Meters count things. Features connect meters to your product catalog. Plans
bundle features into rate cards with prices and entitlements. Free tiers,
pay-as-you-go, quotas with overages, credits, multi-currency — all built from
the same building blocks.

`MonetizationInboundPolicy` per route:

```json
{
  "name": "monetize-route",
  "policyType": "monetization-inbound",
  "handler": {
    "export": "MonetizationInboundPolicy",
    "module": "$import(@zuplo/runtime)",
    "options": {
      "cacheTtlSeconds": 60,
      "meters": {
        "api_requests": 1
      }
    }
  }
}
```

Multi-meter charge from your handler:

```typescript
import { MonetizationInboundPolicy } from "@zuplo/runtime";

// Inside an LLM route handler
const tokens = countTokens(prompt) + countTokens(completion);
MonetizationInboundPolicy.setMeters(context, {
  api_requests: 1,
  tokens, // billed at rate-card rate
});
```

Building blocks included:

- Subscriptions & billing
- Plan-scoped API keys
- Real-time meters · 7 aggregations
- Soft/hard limit per feature
- Self-serve pricing + checkout
- Multi-currency · multi-cadence

Further reading:
[Monetization quickstart](https://zuplo.com/docs/articles/monetization/quickstart),
[Billing integration docs (Stripe)](https://zuplo.com/docs/articles/monetization/stripe-integration).

## What makes Zuplo different

Monetization that feels like a feature, not a project:

- **First-party, not a passthrough** — `MonetizationInboundPolicy` isn't a
  Stripe SDK wrapper. It's a meter, a quota engine, an entitlement check, and an
  API key gate, all running in the same edge runtime as the rest of your
  gateway, with Stripe as the billing system of record.
- **Bill on any unit that costs you** — Requests, tokens, GB transferred,
  compute credits, rows returned, AI calls, custom metrics from your backend —
  each maps to its own meter and rate card, and one request can charge multiple
  counters.
- **Plan-scoped API keys** — Subscribing generates an API key tied to the plan.
  Plan changes update entitlements without rolling the key. Cancellation revokes
  the key at period end, after Stripe finishes billing.
- **Soft + hard limits, configured per feature** — Hard limit on the trial tier
  returns 429 at the cap. Soft limit on the paid tier bills the overage at the
  rate-card rate. Both behaviors can live in the same plan config.

## What teams use this for

- **"Free tier with 1k calls, paid tier with 5k calls + overage."** Set up two
  plans — a free Developer tier capped at 1k calls/month, and a $9.99/mo Pro
  tier with 5k calls included plus per-call overage. Customers subscribe through
  your developer portal, checkout is handled for you, and Zuplo issues a
  plan-scoped API key. Live in an afternoon.
- **"Charge customers for the AI tokens our backend actually used."** Your
  backend returns the real token count in a response header (e.g.
  `x-tokens-used: 1834`). The gateway reads it, charges the customer for that
  exact amount on the tokens meter, and strips the header before the response
  goes out. No client-side math, no double-counting, no separate billing
  service.
- **"Support needs to suspend a customer or move them to a different plan."**
  From the admin UI or the Monetization API: suspend a consumer instantly (every
  request returns 403), migrate them between plans (entitlements update without
  rolling the key), or override a single customer's quota for one cycle.
  Customer ops doesn't need an engineering ticket.
- **"API access has to follow our existing subscription system, not Stripe."**
  Write a small custom policy that checks your subscription system (MemberStack,
  Salesforce, your own DB) before each request and denies access when the parent
  subscription lapses. Zuplo still meters and rate-limits, but entitlement is
  gated by the system you already bill from.

## FAQ

**How do I monetize an API?** API monetization means charging customers for the
API calls or compute they consume. With Zuplo you set this up in three steps:
define your plans and pricing in your gateway config, connect a payment
provider, then put a monetization policy on the routes you want to bill.
Customers subscribe through a self-serve pricing page, get an API key tied to
their plan, and Zuplo handles entitlement, metering, and billing on every
request — no custom billing service to build or maintain.

**Can I use Stripe to bill API customers?** Yes. Connect a restricted Stripe
key, define your products and prices in Zuplo, and customers pay through Stripe
Checkout. Zuplo is the source of truth for usage and entitlement; Stripe is the
source of truth for payment state. Subscriptions, invoicing, proration, refunds,
and dunning all run through Stripe; the gateway syncs lifecycle events
automatically.

**How do I add a free tier and paid plans to my API?** Define each tier as a
plan in Zuplo with its own quota, rate limits, and rate-card pricing — for
example, a Free plan capped at 1,000 calls/month and a Pro plan with 50,000
calls included plus per-call overage. Drop the plans into your developer portal
and customers can subscribe themselves. Upgrades, downgrades, and cancellations
happen through the portal without a sales touch.

**How do I bill API customers by tokens or other custom usage units?** Most APIs
cost more than just "requests" — AI tokens, GB transferred, rows returned,
compute credits. Zuplo lets you define a meter for any unit and charge multiple
meters per request. Have your backend return the actual usage in a response
header (e.g. `x-tokens-used: 1834`); the gateway reads it, charges that exact
amount, and strips the header before the response leaves. Cost passthrough for
AI workloads stops being a spreadsheet exercise.

**What's the difference between soft and hard usage limits?** Hard limits cut
customers off at the cap — every request after the limit returns 429 until the
next cycle. Soft limits let traffic through but charge per-unit overage at your
rate-card rate. Most teams use hard limits on free trials (so they don't run up
a bill) and soft limits on paid plans (so customers don't hit a wall
mid-integration). You can mix both per-feature inside the same plan in Zuplo.

**How do customers see their API usage and remaining quota?** Zuplo's developer
portal includes a customer-facing usage dashboard out of the box — they see
current-period consumption per metered feature, progress bars to their quota,
the API keys they've issued, and their next invoice estimate. Enable the
monetization plugin in your portal config and the UI is wired up automatically.
Customers debug their own rogue scripts; your support team stops fielding "how
much have I used" tickets.

**What's the best API gateway for SaaS monetization?** Most API gateways stop at
routing, auth, and rate limits — for monetization you bolt on Stripe, build a
metering pipeline, and reconcile usage to invoices yourself. Zuplo includes
monetization as a first-class feature: subscriptions, real-time metering at the
edge, plan-scoped API keys, soft/hard quotas, and a self-serve pricing page in
the developer portal. AccuWeather replaced its Apigee + custom-billing stack
with Zuplo and shipped a ChatGPT app on top in three clicks.

**How fast can I add monetization to an existing API?** Most teams launch a paid
plan in days, not months. Sign up for a free Zuplo project, point it at your
existing API as the origin, connect Stripe, and define plans matching the
pricing you already want to charge. Existing routes don't need to change — Zuplo
adds metering and entitlement in front of them. Talk to a Zuplo expert if you
want a guided rollout that mirrors your current pricing model exactly.

**Can I use API Monetization in production today?** Yes. Fixed monthly quotas,
quotas with overages, and pay-as-you-go billing models are all production-ready.
Core billing flows — subscriptions via Stripe, real-time metering, quota
enforcement, and plan-scoped API keys — are used by teams handling real payments
today. When you're ready to go live, email sales@zuplo.com with your account
slug, project slug, Stripe account ID, and target go-live date, and the Zuplo
team will confirm your configuration and enable your project for live billing.

**What does API Monetization cost?** The Free tier and the Builder tier
($25/month) each include 100,000 monetization events per month — one event per
metered API request — at no extra cost. Enterprise plans offer monetization as
an add-on with custom event limits. There is no separate monetization fee on
Free or Builder. Check the [pricing](/pricing) page for full plan details.

## Next steps

- Start a free Zuplo project: https://portal.zuplo.com/signup
- Read the monetization docs: https://zuplo.com/docs/articles/monetization
- Read the monetization quickstart:
  https://zuplo.com/docs/articles/monetization/quickstart
- Read the Stripe billing integration docs:
  https://zuplo.com/docs/articles/monetization/stripe-integration
- Get a pricing demo: /schedule-call
- See plan pricing: /pricing
