Monetising APIs with Gravitee: fixed plans and usage-based billing with Stripe
Sam
Summary
I created this short video to demonstrate how to monetize existing APIs using Gravity without writing any custom code. I show two pricing models – a fixed‑tier plan where developers select a monthly subscription and receive an API key instantly, and a usage‑based plan where each call beyond the allowance generates a charge. The architecture relies on Gravity’s gateway and Stripe: when a developer subscribes to a paid tier, Gravity holds the subscription, fires a webhook to a small billing API that creates a Stripe customer and checkout page, then Stripe notifies the billing API on payment, which activates the API key. I configure three fixed plans (bronze free, silver, gold) with quota policies enforced at the gateway, and I walk through the portal flow, including quota‑exceeded prompts, upgrade links, and the Stripe mock payment process. I then switch to a usage‑based plan, showing how calls are logged, thresholds trigger billing, and alerts are sent at 80% and 100% usage. I discuss safety limits (e.g., a 1,000‑call monthly cap) and note that analytics and billing data are stored in Gravity’s own database, with optional live reporting. Finally, I explain that the entire setup lives as Kubernetes resources, deployable via a pull‑request or Terraform, and I invite anyone with Gravity assets to contact me for a walkthrough.