Why I Didn't Put a Proxy Between My App and OpenAI
Every AI cost-attribution tool I looked at works the same way. You point base_url at their gateway, they see every request before it happens, and in exchange you get real-time blocking if a call is about to blow your budget. That's a fair trade for a lot of teams.
It was not the trade I wanted.
I was building cost tooling for teams shipping LLM features, and the thing that kept nagging at me was uptime. The moment you route through a gateway, that gateway's reliability becomes your reliability. Every request now has a network hop it did not used to have, and a dependency that didn't used to exist. For teams that just want to know what a feature costs, not stop a call mid-flight, that felt like the wrong price to pay.
So instead of a proxy, I wrote a wrapper.
cognocient wraps the OpenAI and Anthropic Python...
Copyright of this story solely belongs to hackernoon.com. To see the full text click HERE