Shioaji Pro
为 agent 交易铺路:交易终端全程由 coding agent 打造,界面 100% 开源、桌面版内置 AI Agent 与全套专业下单面板 — 这个终端就是能力证明。
AI 翻译
尚未检测到更新。GitHub 发布版本后会显示在这里。
制作者的介绍仅有上面的一句话。 更多详情请阅读仓库 README。 仓库 README ↗
正在加载完整 README。
查看完整 README ↗Live: https://meterdemo.vercel.app · Sample customers · Pricing lab · Solution brief
AI products have a pricing problem: every reply costs money to generate, so on a flat plan the heaviest users can cost more than they pay. MeterDemo shows the fix on Stripe. It meters every AI reply, prices input and output tokens separately (output costs the AI provider about 5x more), and makes sure no usage goes unbilled.
TEST MODE ONLY. Use card
4242 4242 4242 4242, any future date, any CVC. No real money moves, and the app refuses to start with a live Stripe key. Customers in the samples are fictional.
| Problem | On a flat $49/month plan, the sample power user costs $90.03 a month in AI usage: a −88% gross margin. Light users pay $49 for $0.34 of usage and leave. |
| Analysis | The pricing lab runs real metered usage from three customer types through four pricing models and shows revenue, AI cost, Stripe fees and gross margin for each. |
| Solution | Two Stripe Billing Meters (input, output), each with a graduated price and a free allowance, found by lookup key. Checkout, invoice preview, Customer Portal, signed webhooks. |
| Safeguard | Usage reports retry with the same ID (never double-billed); failures are recorded and a reconcile job compares our records with Stripe's meters. |
| Result | Every paying customer at 47–49% gross margin; the lab's v2 bills match Stripe's real invoices to the cent. |
The full write-up: docs/SOLUTION_BRIEF.md. How to present it: docs/TALK_TRACK.md. Terms explained: docs/GLOSSARY.md.
Customer chats
│
▼
/api/chat ── AI model ──► reply + input & output token counts
│
▼ lib/usage-reporting.js: retry, idempotent IDs, record anything unreported
Stripe Billing Meters: ai_input_tokens ai_output_tokens (sum per month)
│
▼
Graduated prices: input: 2,000 free, then $0.25/1K output: 500 free, then $1.00/1K
│
▼
Subscription (from Checkout) ──► month end: invoice ──► card charged
│ │
│ /api/usage: meter totals + Stripe invoice preview ▼
└──────────────────────────────── /api/webhook ◄── invoice.paid / payment_failed
npm run reconcile: our reported totals vs. Stripe's meters; re-sends anything missing
meterdemo_input_tokens_v2, meterdemo_output_tokens_v2) let the app find the current prices, so pricing changes in Stripe need no deploy.There's no database. Stripe holds the customers, subscriptions, usage and invoices; the browser keeps a signed, HTTP-only cookie with its Stripe customer ID.
Scale note: real AI prices are fractions of a cent, so every price and every cost is scaled up 1,000x to make test invoices visible. Both sides use the same scale, so margins are realistic.
| Page | What it shows |
|---|---|
/ | The problem, the solution and the safeguard; start the live demo |
/chat.html | Live demo: chat, input/output usage, Stripe's estimate, Manage billing (Customer Portal) |
/sample.html | Three fictional customers (light, growing, power) with paid invoices, daily usage and per-invoice margin: revenue, AI cost, the card fee Stripe actually charged, gross profit |
/pricing.html | The pricing lab: four pricing models on each customer's real usage, with findings |
以上为 README 的开头部分。其余内容请阅读原文。 查看完整 README ↗