DEV Community

Joe Davies
Joe Davies

Posted on

Built a CLI that tells me what I'm spending on AI APIs before the invoice does

I kept finishing coding sessions with a small idea what I'd just spent on API calls :'D.

The dashboards from the providers lag, and none of them give you a per-call breakdown tied back to your own code.

So I built Tirith; an open-source CLI that sits as a transparent proxy between your code and any AI API. One import to add, one to remove.

What it does

  • Drops in with a single line; no config changes
  • Works with any provider you're already using (OpenAI, Anthropic, whatever)
  • Tracks cost per call in real time
  • Everything stays local on your machine; no data leaves your laptop

Why a proxy instead of an SDK wrapper

Wrappers break when providers ship new endpoints or change their SDK. A transparent proxy just forwards requests, logs what it sees, and gets out of the way. Provider-agnostic by design.

Try it

MIT licensed. Feedback very welcome; especially edge cases where the proxy behaves weirdly. First release, so I'm expecting rough edges.

Top comments (0)