stripe-billing

stripe-billing is a cursor rule for Cursor from airweave-ai/airweave. It costs 0 tokens per session (2,873 once invoked), scanned A, original, MIT.

Rules for handling Airweave subscription payments and monthly usage measurement through Stripe, a payment service. They cover monthly plans and yearly prepayment for selected plans.

In plain words
What is it for?
Use them when changing billing endpoints, plan decisions, usage records, upgrades, downgrades, or yearly subscription handling.
Why use it?
They define when upgrades take effect, when downgrades happen, and how yearly payments become monthly account credit, avoiding inconsistent billing behavior.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: positional $N argument.

Good fit Use them when changing billing endpoints, plan decisions, usage records, upgrades, downgrades, or yearly subscription handling.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/airweave-ai/airweave/stripe-billing
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/airweave-ai/airweave

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for stripe-billing

README.md
[![agentmods](https://agentmods.dev/badge/rules/airweave-ai/airweave/stripe-billing/github.svg)](https://agentmods.dev/rules/airweave-ai/airweave/stripe-billing)
Your own site
<a href="https://agentmods.dev/rules/airweave-ai/airweave/stripe-billing"><img src="https://agentmods.dev/badge/rules/airweave-ai/airweave/stripe-billing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for stripe-billing

Your own site · 80×15
<a href="https://agentmods.dev/rules/airweave-ai/airweave/stripe-billing"><img src="https://agentmods.dev/badge/rules/airweave-ai/airweave/stripe-billing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 2,873 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.02873
Opus 5 $0.00000 $0.01437
Sonnet 5 $0.00000 $0.00575
Haiku 4.5 $0.00000 $0.00287

Measured 9d ago against content hash b6fb7b219e34, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

stripe-billing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/stripe-billing.mdc · 214 lines

How it starts

The opening of the file, as written. The whole thing — 214 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Airweave Stripe Billing Rules

Overview

Airweave supports two ways to pay for subscription plans while always metering usage monthly:

  • Monthly subscription (normal Stripe subscription, monthly billing)
  • Yearly prepay with monthly usage (customer prepays a discounted annual amount, we apply a 20% coupon for 12 months, draw down from Stripe customer balance monthly; after 12 months, coupon expires and subscription defaults to standard monthly pricing of the same plan)

Plans: developer (free, $0 subscription), pro, team, enterprise (handled outside Stripe). Only pro and team support yearly prepay.

Key principles:

  • Upgrades apply immediately with proration (never wait), so customers can use higher limits right away
  • Downgrades are scheduled at the end of the billing period (monthly or yearly if on yearly prepay)
  • Yearly prepay is implemented via one-time payment → credit balance + 20% coupon for 12 months → normal monthly after expiry

Architecture

  • API endpoints: airweave/api/v1/endpoints/billing.py
  • Service orchestrator: airweave/billing/service.py
  • Business rules: airweave/billing/plan_logic.py
  • DB transactions (periods/usage/records): airweave/billing/transactions.py
  • Stripe client (SDK wrapper): airweave/integrations/stripe_client.py
  • Webhook processor: airweave/billing/webhook_handler.py
  • Frontend flows: frontend/src/pages/Onboarding.tsx, frontend/src/components/settings/BillingSettings.tsx

Data model highlights:

  • Organization billing state stored in OrganizationBilling with fields like billing_plan, stripe_customer_id, stripe_subscription_id, has_yearly_prepay, pending_plan_change, current_period_start/end, etc.
  • Billing periods tracked in BillingPeriod with status transitions (ACTIVE → COMPLETED, GRACE, ENDED_UNPAID) and associated Usage rows.

Endpoints

  • POST /billing/checkout-session → Monthly subscription checkout (Stripe Subscription mode). Requires plan and success/cancel URLs.
  • POST /billing/yearly/checkout-session → Yearly prepay checkout (Stripe Payment mode). Creates a one-time checkout for the full-year prepaid amount, records intent, and a 12-month 20% coupon to be applied post-payment.
  • POST /billing/update-plan → Update plan and optionally the period (monthly|yearly). Business rules ensure upgrades are immediate and downgrades are scheduled.
  • GET /billing/subscription → Returns SubscriptionInfo: plan, status, period boundaries, limits, yearly flags, pending plan changes, etc.
  • POST /billing/cancel → Cancel at period end.
  • POST /billing/reactivate → Clear cancellation.
  • POST /billing/cancel-plan-change → Clear a scheduled plan change.
  • POST /billing/portal-session → Stripe Customer Portal session.
  • POST /billing/webhook → Stripe webhook receiver (signature-verified).

Read the full file on GitHub · 214 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 214 lines · 2,873 tokens per session scan A b6fb7b219e34

Subscribe to this mod's changes

stripe-billing is a cursor rule published in the GitHub repository airweave-ai/airweave (6,565 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,873 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.