Estúdio Criativo
ReadyToGo Education — 1,207 active studentsPostgreSQL · Supabase
OpenRouter
Nobody could answer.
The problem
An AI creative tool was shipping, but nobody could answer the two questions that decide whether an AI product survives: what does each generation actually cost, and what happens when a provider fails at 2am?
What I built
A single AI gateway. Every outbound call to every provider goes through one place — per-provider timeouts, structured logging, anomaly detection at 40% error rate or 45s latency, and the ability to cut off a provider through a feature flag, without deploying. Twelve egress points migrated, zero direct calls left.
Then per-node telemetry: cost, duration and tokens for each of the 19 node types in the pipeline. Not aggregate — per step. That is what turns “we have an AI feature” into “we know what it costs and what to charge for it.”
Twelve egress points, one path out
The decision that mattered
Slides render in parallel, so summing node durations overstates real elapsed time. The system reports sum_node_ms and wall_ms separately. Measuring the wrong thing confidently is worse than not measuring at all.
slides render in parallel —
summing duration lies
Also shipped
Monthly credit windows with a lifetime ledger as the source of truth. A queue that detects an orphaned job in about two minutes and reprocesses it — without charging the student for the failure. Feature flags with a kill switch. Observable deploys: one endpoint answers which commit is live.