← Marketplace
1 agent
2 scripts1 dataset1 loader
Metering & Billing Loop
FREEby YOKE Templates5 tiles · 4 wires
A self-contained usage-metering loop: a periodic meter feeds a ledger script, a balance view tracks spend, and a credit gate pauses the worker at the low-water mark.
Run Metering & Billing Loop using Yoke Credits. Compute, AI calls, and retained storage are metered. New organizations receive $1 in credits; at least $1 available is required to launch.
No subscription · pause whenever you like
The board
commsdatarelation
What's inside
- agent
- WORKER
- scripts
- LEDGER, CREDIT-GATE
- dataset
- BALANCE
- loader
- METER
Swarm file
View the swarm file (77 lines)
# lifecycle.swarm.toml — the METERING LOOP as a declarative swarm config. # Infrastructure-as-code for the internal lifecycle loop (no external money/AWS): # # [METER trigger] ──▶ [LEDGER script] ──▶ (BALANCE View) ◀── [CREDIT-GATE script] ──▶ [WORKER] # periodic usage debit ×markup balance balance ≤ low-water? paused # → halt # # Node KIND is from template_id; wire KIND is DERIVED from endpoint kinds: # meter→ledger Trigger→Script = Comms (the metering event feed) # ledger→balance Script→Dataset = DataAccess (write the running balance) # gate→balance Script→Dataset = DataAccess (read the balance) # gate→worker Script→Agent = Comms (the halt/pause signal) # # The script modules (yoke_ledger.wasm, yoke_credit_gate.wasm) are attached at # provision time (SetScriptModule) — grid layout is declarative; bytes are not. [[agents]] id = "meter" name = "METER" gx = 2 gy = 3 width = 2 height = 2 template_id = "builtin-loader" # cron Trigger: periodic usage rollup [[agents]] id = "ledger" name = "LEDGER" gx = 6 gy = 3 width = 2 height = 2 template_id = "builtin-script" [[agents]] id = "balance" name = "BALANCE" gx = 6 gy = 6 width = 2 height = 2 template_id = "builtin-dataset" # the balance View both scripts share [[agents]] id = "gate" name = "CREDIT-GATE" gx = 10 gy = 3 width = 2 height = 2 template_id = "builtin-script" [[agents]] id = "worker" name = "WORKER" gx = 10 gy = 6 width = 2 height = 2 # no template_id → an Agent: the thing that gets paused when credit runs out [[wires]] from = "meter" to = "ledger" [[wires]] from = "ledger" to = "balance" [[wires]] from = "gate" to = "balance" [[wires]] from = "gate" to = "worker"