Billing & Credits
Credit-based billing, tier metering, usage quotas, and Stripe integration.
Billing & Credits
Reeve Cloud offers two billing modes: Credits (prepaid, pay-as-you-go) and BYOK (Bring Your Own Key, use your own LLM API keys).
Credit System
Credits are prepaid balances used for LLM API calls when you don't bring your own API keys.
Credit Packs
| Pack | Price | Credits |
|---|---|---|
| Starter | $5 | $5.00 |
| Standard | $25 | $25.00 |
| Power | $100 | $100.00 |
Purchase via the Cockpit at /cockpit/settings/billing or the API:
POST /api/credits/purchase
Authorization: Bearer <session-token>
Content-Type: application/json
{
"amount": 25
}
# Response:
{
"checkout_url": "https://checkout.stripe.com/c/pay_...",
"session_id": "cs_live_..."
}The user is redirected to Stripe Checkout. After payment, a webhook credits their account.
Balance & Usage
GET /api/credits/balance
Authorization: Bearer <session-token>
# Response:
{
"balance": 18.50,
"last_purchase_at": "2026-02-25T10:00:00Z",
"last_deduction_at": "2026-02-27T11:30:00Z"
}Deductions
The gateway deducts credits after each LLM call:
POST /api/credits/deduct
X-Reeve-Services-Token: <service-token>
{
"user_id": "user_abc123",
"amount": 0.05
}Batch deductions for efficiency:
POST /api/credits/deduct/batch
X-Reeve-Services-Token: <service-token>
{
"deductions": [
{ "user_id": "user_abc123", "amount": 0.05 },
{ "user_id": "user_abc123", "amount": 0.12 }
]
}Transaction History
GET /api/credits/history
Authorization: Bearer <session-token>
# Response:
{
"transactions": [
{ "type": "purchase", "amount": 25.00, "created_at": "2026-02-25T10:00:00Z" },
{ "type": "deduction", "amount": -0.05, "created_at": "2026-02-27T11:30:00Z" }
]
}BYOK (Bring Your Own Key)
With BYOK, you provide your own LLM API keys and Reeve makes API calls directly from your gateway container. No credits are deducted.
Configure keys in the Cockpit at /cockpit/settings/models or via config:
{
"providers": {
"anthropic": { "apiKey": "sk-ant-..." },
"openai": { "apiKey": "sk-..." }
}
}BYOK users still need a Reeve Cloud subscription for platform access — only LLM costs are covered by their own keys.
Tier Metering
Reeve Cloud has tier-based access with rolling 30-day usage quotas:
Quota System
The tier gate middleware (core/tier_gate.py) enforces per-feature quotas:
# 23 features with tier-specific limits
QUOTA_REGISTRY = {
"ad_generations": {"free": 10, "pro": 100, "enterprise": None},
"brand_analyses": {"free": 5, "pro": 50, "enterprise": None},
"connector_syncs": {"free": 20, "pro": 500, "enterprise": None},
# ... 20 more features
}How Metering Works
- Every API call to a gated endpoint checks the user's tier
- Usage is tracked in the
tier_usagetable with rolling 30-day windows - If usage exceeds the tier quota, the request is rejected with a 429 status
- Enterprise tier has unlimited access to all features
Gated Endpoints
12+ routers are protected by tier gates:
| Feature | Free | Pro | Enterprise |
|---|---|---|---|
| Ad generations | 10/mo | 100/mo | Unlimited |
| Brand analyses | 5/mo | 50/mo | Unlimited |
| Connector syncs | 20/mo | 500/mo | Unlimited |
| Dashboard refreshes | 50/mo | 500/mo | Unlimited |
| Goal creations | 5/mo | 50/mo | Unlimited |
Usage Tracking
GET /api/tier/usage
Authorization: Bearer <session-token>
# Response:
{
"tier": "pro",
"usage": {
"ad_generations": { "used": 42, "limit": 100, "remaining": 58 },
"brand_analyses": { "used": 12, "limit": 50, "remaining": 38 }
},
"period_start": "2026-01-28T00:00:00Z",
"period_end": "2026-02-27T00:00:00Z"
}Stripe Integration
Billing is powered by Stripe:
- Checkout — Stripe Checkout for credit purchases
- Webhooks —
payment_intent.succeededtriggers credit issuance - Customer portal — Stripe-hosted billing management
Webhook endpoint:
POST /api/credits/webhook
# Stripe signature verified via STRIPE_WEBHOOK_SECRETCredits never expire. Unused credits carry over indefinitely. The only metered limits are tier-based quotas, which reset on a rolling 30-day window.