If you're building cost tooling for teams shipping LLM features, you've probably noticed that every attribution solution in this space requires the same architectural tradeoff: you point your base_url at a proxy, and that proxy sees every call before it happens. Developer Mandar V Shinde ran into this pattern repeatedly while working on cost tracking infrastructure—and decided to build something different.
The Proxy Problem
Traditional LLM cost attribution tools work by inserting themselves between your application and the API provider. This gives them visibility into requests before they execute, which is genuinely useful if you want to block or downgrade calls based on cost analysis. But it also adds latency, creates a new failure point, and requires maintaining proxy infrastructure that your team probably doesn't want to own. For teams already deep in the OpenAI or Anthropic SDK ecosystem, ripping out those direct integrations just to track spend feels like using a sledgehammer to hang a picture frame.
How the Wrapper Works
Shinde's solution wraps both the OpenAI and Anthropic SDKs with an async layer that intercepts responses after they return—not requests before they go out. This means your application code stays exactly the same: you're still calling the official SDK methods, just through a thin abstraction that can extract token counts, model identifiers, and timing data from the response metadata. The wrapper maintains compatibility with the underlying SDK APIs while adding instrumentation at the boundary between your code and the API responses.
Why Post-Request Tracking Makes Sense
For many use cases, you don't need to know about a request before it happens—you just need accurate records of what was called and what it cost afterward. Attribution data captured from response metadata gives you exactly that: per-call token usage, model selection, latency measurements, and error rates. This approach trades the ability to pre-empt expensive calls for operational simplicity and zero added latency on the hot path.
Key Takeaways
- Wraps official OpenAI and Anthropic SDKs without replacing them
- Intercepts response metadata rather than request parameters
- No additional network hop or proxy infrastructure required
- Maintains API compatibility with upstream SDKs
The Bottom Line
This is a pragmatic approach that prioritizes operational simplicity over fine-grained pre-call control. If your team needs attribution visibility without the overhead of running a proxy fleet, Shinde's wrapper deserves a look—just make sure post-request tracking gives you enough granularity for your cost analysis needs.