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 telemetry per step: the pipeline breaks a generation into 19 kinds of step, and each one records its own cost, duration and tokens. 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
- 01Per-provider timeout
- 02Structured logging
- 03Anomaly detectionerror ≥ 40% · latency ≥ 45s
- 04Kill switchfeature flag · no deploy
- Provider 01live
- Provider 02live
- Provider 03cut · no deploy needed
The decision that mattered
Slides render in parallel, so summing node durations overstates real elapsed time. The system reports the sum of the steps and the wall-clock time as two separate numbers. 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 every movement written to a permanent log that is the source of truth — the balance is never a field someone can edit. 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.
