Define success.
A small wrapper calls your real application with fixed cases and checks whether it achieved its purpose.
Write an operation ↗MarginCI runs the same declared operation against two revisions, meters supported paid APIs, and fails CI when cost per successful operation exceeds your threshold.
02 / THE ECONOMIC CHECK
This declared workload completes 20 cases on both revisions. The candidate costs 72.96% more per success, above its 20% limit.
Synthetic, executable fixture. Configured values, not provider prices or customer savings.
Reproduce the local fixture ↗MarginCI — research
Declared workload: 20 cases
Baseline: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Candidate: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
BASELINE CANDIDATE
successful 20/20 20/20
openai $1.820000 $3.110000
exa $0.140000 $0.280000
known value $1.960000 $3.390000
cost / success $0.098000 $0.169500
measured regression 72.96%
allowed regression 20.00%
Values follow frozen configured rates / allowed provider estimates; not settled invoice charges.
FAIL
Verdict applies to the declared MarginCI workload. It is not an estimate of unseen production traffic.
Exit: 1
03 / A SMALL, EXPLICIT CONTRACT
For developers shipping bounded Node and TypeScript operations that call paid APIs. Bring an operation and a meaningful success check.
A small wrapper calls your real application with fixed cases and checks whether it achieved its purpose.
Write an operation ↗Freeze the declared workload, rates and success wrapper. Run baseline and candidate in separate local processes.
Read the comparison contract ↗Only a complete PASS approves the economic check. Failed attempts keep their spend. Unknown usage stays unknown.
Add the CI check ↗Supported completions and final-usage streams.
Explicit configured model rates.
Supported v2 batch creation and terminal settlement.
Configured credit value.
Supported search responses.
Opted-in estimates or configured rates.
One owned Node process per attempt. Tested on macOS arm64 with Node 25.3.0. No arbitrary child work, workers, queues or browser traffic. The spend guard limits modeled value; it cannot guarantee a provider invoice cap.
↗PRIVATE ALPHA / OWNER APPROVAL PENDING
Review the setup, supported boundary and retained data before trying MarginCI in your repository. Distribution is pending a deliberate license and release decision.