Nano
Nano는 일상 결제와 비즈니스, 소프트웨어용 디지털 화폐이며 지갑·생태계·AI 연동을 제공합니다
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기Open-source per-user AI cost and margin tracking for subscription apps. Matches each user's AI cost to what they pay you (RevenueCat, Stripe). TypeScript and Python SDKs.
저장소 README에서 가져옴
README 전체를 불러오는 중입니다.
README 전문 보기 ↗See the AI cost of every single user. FiscaLLM adds up what each user costs you in AI and sets it next to what they pay you, so you can see who is profitable and who is losing you money.
Open source (MIT) and free. Use the hosted service at fiscallm.com (free under fair use, best effort), or run your own.
Live demo (no sign-up) · Docs · How it works · What it covers · Accuracy · Roadmap (board) · Changelog · Self-hosting · Contributing
Sample data from the demo, not a real customer.
Create an app at fiscallm.com (or your own copy) and copy the ingest key.
Add one line after each AI call (it reads only the model name and token counts, never prompts or answers):
import { createMeter } from "fiscallm"; // npm install fiscallm (Python: pip install fiscallm)
const meter = createMeter({ apiKey: process.env.FISCALLM_KEY, waitUntil });
const res = await openai.chat.completions.create({ model, messages });
meter.trackOpenAI(res, { userId, feature: "chat" });
Connect revenue: press Connect RevenueCat (one click: adds the webhook and imports past subscribers), paste a Stripe webhook URL, or send payments yourself with the revenue API.
No AI key handy? FISCALLM_KEY=fsk_... node examples/send-sample-data.mjs fills a test app with sample users so you can see it working.
AI apps charge a flat price but pay a variable cost. One user costs $0.20 a month in AI, another costs $25. Your AI provider's bill shows tokens, your subscription tool shows payments, and neither shows the user.
import { createMeter } from "fiscallm";
const meter = createMeter({ apiKey: process.env.FISCALLM_KEY, waitUntil });
const res = await openai.chat.completions.create({ model, messages });
meter.trackOpenAI(res, { userId, feature: "chat" });
from fiscallm import Meter
meter = Meter(api_key=os.environ["FISCALLM_KEY"])
res = client.chat.completions.create(model=model, messages=messages)
meter.track_openai(res, user_id=user_id, feature="chat")
trackRevenue / track_revenue.jobId and report each job as pending, captured or refunded with meter.trackJob / track_job. The Jobs page shows the AI cost of refunded jobs and of jobs that never resolved, per user.meter.check(userId) before an AI call (TypeScript, Python). It says no once the user reaches the amount, If FiscaLLM is slow or down, a user it already refused stays refused; anyone else is allowed by default (or refused, with checkOnError: "deny"). An optional local limit counts each user's calls and tokens in your process, so a runaway loop is stopped even with no network.Cost is priced on arrival: exact costUsd if given, otherwise per-token (input, output, cache read and cache write priced separately) or per-unit (images, audio, video) from a price table. Unknown models are flagged as unpriced, never counted as zero.
Net revenue is price × (1 − tax − store commission).
| Path | What it is |
|---|---|
apps/web | Next.js site and dashboard |
apps/api | Hono API: ingest, RevenueCat webhook and OAuth callback, revenue API, cron jobs |
packages/shared | Drizzle schema, pricing, metrics, alerts |
packages/sdk | TypeScript SDK (fiscallm on npm) |
packages/sdk-python | Python SDK (fiscallm on PyPI) |
Stack: TypeScript, Next.js, Hono, Postgres (Supabase) with Drizzle, hosted on Vercel.
FISCALLM_KEY=fsk_... node examples/send-sample-data.mjs fills the dashboard with sample users (one heavy user who loses money).pnpm install
pnpm dev:web # http://localhost:3000
pnpm dev:api # http://localhost:8787/api/health
pnpm test
Copy .env.example to apps/web/.env.local and packages/shared/.env and fill in the values.
pnpm db:generate
pnpm db:migrate
Issues and pull requests are welcome. Read CONTRIBUTING.md first (it includes a short contributor agreement). The plan, including what we only build if there is demand, is in ROADMAP.md, with a public board. Vote with a 👍 on roadmap issues or share ideas in Discussions.
Where help is most wanted: prices for more models and providers (data only, no code knowledge needed), connectors for other billing systems (Adapty, Superwall), examples for AI frameworks, and a comparison of computed costs with a real provider invoice. See the good first issues.
Built and maintained by Mayur as an independent, open-source side project. Questions, bugs and ideas: open an issue or email [email protected].
Thank you to everyone who helps. Contribute: a good place to start is an issue labelled good first issue.
MIT. See LICENSE.