flagon-io/g1t

public

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t/services/billing/wrangler.jsonc

93 lines4,419 bytesCodeBlame
1{
2 "$schema": "../../node_modules/wrangler/config-schema.json",
3 "name": "g1t-billing",
4 "account_id": "1e6f2cffa3f445920836e8ebe446bb58",
5 "compatibility_date": "2026-09-26",
6 // Runs next to its database: a request makes several queries in turn,
7 // and each would otherwise cross the distance to it.
8 "placement": { "mode": "smart" },
9 "main": "build/index.js",
10 "build": { "command": "cargo install -q worker-build@0.8.7 && worker-build --release" },
11 // Reached only through service bindings.
12 "workers_dev": false,
13 "d1_databases": [
14 {
15 "binding": "DB",
16 "database_name": "g1t-billing",
17 "database_id": "695a6979-fd07-4850-bc97-904a6b4b7a04",
18 "migrations_dir": "migrations"
19 }
20 ],
21 // Identity emails owners as their workspace nears its usage limit.
22 // Repos says which repositories are public (the open-source pool pays
23 // for work on those) and what private ones hold (the storage meter).
24 "services": [
25 { "binding": "IDENTITY", "service": "g1t-identity" },
26 { "binding": "REPOS", "service": "g1t-repos" }
27 ],
28 // Events from the bus: a workspace renamed moves its billing to the
29 // new slug (src/rename.rs).
30 "queues": {
31 "consumers": [{ "queue": "g1t-events-billing", "max_batch_size": 20, "max_batch_timeout": 1 }]
32 },
33 "vars": {
34 // What is added to a model run's cost, in percent: g1t's overhead for
35 // running and building it. The price book's markups are the same.
36 "MARGIN_PERCENT": "20",
37 // While g1t is being built out, workspaces pay nothing: runs are
38 // recorded with what they cost, and nothing is charged. Set to
39 // "false" when pricing starts.
40 // Off: workspaces are charged as their account's terms say. g1t's own
41 // (syntaqx) is comped in sudo.g1t.sh, not by this switch.
42 "FREE_WHILE_BUILDING": "false",
43 // How far a workspace's unpaid usage may go before its work stops
44 // (see src/limits.rs): $3 before any live payment, then twice what
45 // it has paid, between $25 and $1,000. Comped and custom terms are set
46 // per account in sudo.g1t.sh.
47 "LIMIT_NEW_MICROS": "3000000",
48 "LIMIT_PAID_MIN_MICROS": "25000000",
49 "LIMIT_PAID_MAX_MICROS": "1000000000",
50 // Trial credit, so people can try g1t without a key or a card: each
51 // new workspace gets this much usage credit ($1), once, granted the
52 // first time it uses something, out of a pool for everyone ($40)
53 // that resets each calendar month (UTC). When a month's pool is
54 // given out, new trials wait for the next month. Either at 0 turns
55 // new trials off. See src/credits.rs.
56 "TRIAL_WORKSPACE_MICROS": "1000000",
57 "TRIAL_MONTHLY_POOL_MICROS": "40000000",
58 // g1t's open-source pool: sandbox time and model cost for work on
59 // public repositories, up to $10 a month in all and $1 a month for
60 // any one repository. Past either, the workspace pays as usual.
61 "OSS_POOL_MICROS": "10000000",
62 "OSS_REPO_MICROS": "1000000",
63 // The Team plan: $20 a month per workspace, never per person, with
64 // $5 of usage credit a month (drawn first; it does not roll over),
65 // 50 GB of private storage and a year of audit log.
66 "TEAM_MONTHLY_CENTS": "2000",
67 "TEAM_INCLUDED_MICROS": "5000000",
68 "TEAM_PRIVATE_STORAGE_BYTES": "50000000000",
69 "TEAM_AUDIT_RETENTION_DAYS": "365",
70 // Without Team: 1 GB of private storage free (charged past it at
71 // cost plus the margin), and 30 days of audit log.
72 "FREE_PRIVATE_STORAGE_BYTES": "1000000000",
73 "AUDIT_RETENTION_DAYS": "30",
74 // No card is charged less than $5, so a payment's fee is never most
75 // of it: smaller amounts carry over to the next invoice.
76 "MIN_CHARGE_MICROS": "5000000",
77 // The Deployments plan's monthly price, in cents. Turning the
78 // feature on starts it; FREE_WHILE_BUILDING does not cover it. It
79 // includes 200 build minutes a month (about $0.25 of it at cost).
80 "DEPLOYMENTS_MONTHLY_CENTS": "500",
81 "DEPLOYMENTS_BUILD_SECONDS": "12000",
82 // Where the keeper reads what g1t pays (src/keeper.rs). Its token,
83 // CLOUDFLARE_USAGE_TOKEN, is a secret: Billing, Account Analytics
84 // and AI Gateway, read only.
85 "CLOUDFLARE_ACCOUNT_ID": "1e6f2cffa3f445920836e8ebe446bb58",
86 "AI_GATEWAY_ID": "g1t"
87 },
88 // Settling runs every 15 minutes; checking costs daily (keeper::DAILY).
89 "triggers": { "crons": ["*/15 * * * *", "17 4 * * *"] },
90 // Secret: STRIPE_SECRET_KEY. Without it nothing is charged and the
91 // runner decides who may start agents some other way.
92 "observability": { "enabled": true }
93}