Rebuilding 36 AI Agents on LangGraph.js to See What Each One Costs

We rebuilt 36 AI agents alongside the originals to see what each one costs in model use, without logging prompts or answers at the gateway.

A laptop on an office desk showing a simple dashboard of colored horizontal bars

A model bill tells you what you spent. It may not tell you which AI agent ran up the cost. We wanted to see how much of the bill came from each agent without keeping a copy of what people asked or what the model said.

What we rebuilt on LangGraph.js

Our founder rebuilt 36 AI agents from his own production systems using LangGraph.js. The rebuilds run on Cloudflare Workers alongside the originals. They did not replace them, and this was not a client deployment.

Why we put model calls through one gateway

Every model call from the 36 rebuilds goes through Cloudflare AI Gateway. Each call carries the agent’s name. That lets us see token use and model cost for each agent in one place. Tokens are the units a model counts as it processes a request and produces an answer.

Gateway request logging is off for those calls. The gateway records token use and cost, but it does not store prompts or answers in that log. We can see what each agent uses without keeping the contents of the exchange there.

What the audit found and where we made an exception

We checked the code for all 36 rebuilds and found no model calls that bypassed the gateway. We deliberately left one real-time call assistant out of the gateway setup because response time matters most while someone is on a call. That is a case where we chose to leave the assistant out of the shared cost view rather than put the gateway in its call path.

API keys live only in Bitwarden, a secure vault. None of the rebuilds stores a key in its own settings.

What this gives us now

We can see how much of the model bill each rebuilt agent accounts for. We also know what the gateway log leaves out and where the keys are kept. The rebuilds give us a clearer view of spending. They do not show that we reduced it.

Start with one AI workflow

This is the kind of work we take on through AI consulting at Safire Business Services. Start with our $250 assessment. Bring one AI workflow and the questions you want answered about what it costs, what gets logged, or where its keys are kept.

© 2026 2057 Holdings LLC dba Safire Business Services 820 W Danforth Rd #1075, Edmond, OK 73003 (405) 766-5105 info@safire.llc

Privacy Terms