Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Billing is ready to take real money, and stays on Stripe's test key until the switch. The g1t plan is $21 a month, all-in, with $10 of usage included: the card processing fee is part of the price, and no payment carries a fee line any more (old fee rows still read as they were). Card, billing address, tax IDs, invoices and cancelling are on Stripe's billing page (Manage billing), whose configuration billing keeps in step; Checkout asks for the billing address and a tax ID; g1t's Billing page keeps usage, the spend limit, budget alerts and prepaying. Members other than owners and billing managers no longer see billing details or invoices, from the page or the API. | 1 | -- Search embeddings, reported to billing (src/embed-billing.ts): each |
| 2 | -- workspace's month of embedding tokens (`doc_embed_usage`) goes to | |
| 3 | -- billing as source `context` at Workers AI's price, and a workspace | |
| 4 | -- without the plan is held to a monthly token budget. | |
| 5 | -- | |
| 6 | -- Usage is kept by workspace id; billing knows workspaces by slug. The slug | |
| 7 | -- is noted whenever the service looks a workspace up, with the plan billing | |
| 8 | -- last said it is on (NULL before it has: held to the budget like a free | |
| 9 | -- one) and the month's tokens last reported. | |
| 10 | CREATE TABLE workspace_billing ( | |
| 11 | workspace_id TEXT PRIMARY KEY, | |
| 12 | slug TEXT NOT NULL, | |
| 13 | -- 'free' or 'paid'. | |
| 14 | plan TEXT, | |
| 15 | plan_at TEXT, | |
| 16 | noted_month TEXT, | |
| 17 | noted_tokens INTEGER NOT NULL DEFAULT 0, | |
| 18 | noted_at TEXT | |
| 19 | ); |