Credits
Set up, configure, and run the Reloop credits microservice locally.
Subscription tiers, credit balances, usage tracking, and Stripe billing integration.
Overview
| Property | Value |
|---|---|
| Directory | apps/backend/credits |
| Port | 8023 |
| Local URL | https://local.reloop.sh/api/credits |
| Swagger UI | https://local.reloop.sh/api/credits/openapi |
| Stack | ElysiaJS · 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
| Variable | Required | Default |
|---|---|---|
PORT | YES | 8023 |
INITIAL_CREDITS | YES | 100 |
NATS_URL | YES | nats://localhost:4222 |
Commands
| Command | Description |
|---|---|
bun be:credits:dev | Start dev server with hot reloading |
bun run --filter=be-credits build | Compile production bundle |
bun run --filter=be-credits start | Run compiled production build |
bun run --filter=be-credits check-types | TypeScript type-check |
Architecture
| Layer | Detail |
|---|---|
| Credits | Tracks balances and blocks sends when credits reach zero |
| Stripe | Manages subscriptions, invoices, and billing webhooks |
| Events | Publishes billing.quota-warning and related NATS subjects |
| Schema | plan, subscription, credit_ledger in packages/db/src/schema/billing.ts |
Next
Was this page helpful?
- Need help? Contact Support.
- Chat with Reloop developers on Discord.
- Check out our changelog.
- Questions? Contact Sales.
- LLM? Read llms.txt.