01Clone it
One repo, everything wired.
Auth, Stripe subscriptions, credits, AI images — working, tested, MIT. Clone it and build YOUR product.
Open-source GitHub repo by Nikandr Surkov

Plain words
Three steps
01One repo, everything wired.
02Stripe and a database. That's it.
03Your product on a proven core.
Sample generations
Six prompts through the same pipeline you get — 1 credit each.






Ledger of features
Tested, idempotent, boring on purpose. Vibe-code the product on top.
01Email, Google, GitHub, magic links — sessions in your Postgres.
02Raw-body signatures, one sync writer, idempotency keys everywhere.
03Atomic spends, automatic refunds. Balance is a SUM, not a hope.
04Prompt → spend → image → history. Swap models with one env string.
05AGENTS.md, scoped rules, skills, hooks that block broken code.
06Vitest and Playwright against real Postgres, on every push.
AI-native
One AGENTS.md briefs Claude Code, Cursor, Codex, Copilot — guardrails included.
Pricing
One config file drives pricing, checkout, and webhook grants. Start free.

This repo is complete
Pro is what comes after product-market fit.
Auth, subscriptions, credits ledger
Full
AI generation
1 image provider
Async job pipeline · webhooks · auto-refund
Not included
Gallery + R2 storage · teams · admin
Not included
MCP server + extended agent skills
Core set
Auth, subscriptions, credits ledger
+ rollover, meters, packs
AI generation
Image + video + audio × 7 providers
Async job pipeline · webhooks · auto-refund
Inngest, durable
Gallery + R2 storage · teams · admin
Included
MCP server + extended agent skills
Full suite
Asked before you asked
The billing and ledger core is tested against real Postgres, with CI gates on every push.
pnpm, Docker for Postgres, Stripe test keys. AI generation runs free with AI_MOCK=true.
Columns can't survive webhook retries or races. Append-only rows with idempotency keys can — the database enforces it.
AGENTS.md briefs them, scoped rules guard the money paths, hooks block completion until typecheck passes.
MIT. Clone it, rename it, sell what you build. Attribution appreciated, not required.
Multi-provider media generation, durable job pipeline, gallery, teams, admin, MCP server. One link: nikandr.com.
Closing entry