For the complete documentation index, see llms-docs.txt or the site index llms.txt. Full docs corpus: llms-full-docs.txt. Prefer the markdown version of this page at /docs/setup/backend/credits.md. Product capabilities: skill.md. Docs MCP: /docs/mcp. Site MCP: /mcp.

Credits

Set up, configure, and run the Reloop credits microservice locally.

Subscription tiers, credit balances, usage tracking, and Stripe billing integration.

Overview

PropertyValue
Directoryapps/backend/credits
Port8023
Local URLhttps://local.reloop.sh/api/credits
Swagger UIhttps://local.reloop.sh/api/credits/openapi
StackElysiaJS · PostgreSQL · NATS

Quick start

bun be:credits:dev

Or bun backend:dev / bun dev.

Environment

apps/backend/credits/.env — from bun setup / bun env:setup.

PORT=8023
NODE_ENV=development
INITIAL_CREDITS=100
NATS_URL=nats://localhost:4222
VariableRequiredDefault
PORTYES8023
INITIAL_CREDITSYES100
NATS_URLYESnats://localhost:4222

Commands

CommandDescription
bun be:credits:devStart dev server with hot reloading
bun run --filter=be-credits buildCompile production bundle
bun run --filter=be-credits startRun compiled production build
bun run --filter=be-credits check-typesTypeScript type-check

Architecture

LayerDetail
CreditsTracks balances and blocks sends when credits reach zero
StripeManages subscriptions, invoices, and billing webhooks
EventsPublishes billing.quota-warning and related NATS subjects
Schemaplan, subscription, credit_ledger in packages/db/src/schema/billing.ts

Next

Was this page helpful?

Edit this page