Launching today
CostKey - Know which feature costs what
Your AI bill, broken down by function. Automatically.
5 followers
Your AI bill, broken down by function. Automatically.
5 followers
CostKey shows which function in your codebase costs what. Automatically. Add one line of code and every AI call gets mapped to the business logic function that triggered it. Cost per function, cost per deploy, spike detection. 15 providers including OpenAI, Anthropic, Google. Works through Portkey and Helicone. Python and TypeScript. Free.






Hey everyone! I'm Naman, the maker of CostKey.
I've been using Portkey for AI observability and honestly, it drove me to build this.
To get Portkey working, I had to rewrite every single AI call in my codebase to use their SDK.
New provider? Rewrite again. Want to switch from Anthropic to Google? Rewrite again. They still don't support Vertex AI properly, so if you're on Google Cloud, good luck.
Then the tagging problem. Want to know which feature costs what? Manually tag every call with metadata. Have a function that calls three different LLMs through a retry wrapper? Tag each one. Refactor your code? Update all the tags. Miss one? Your cost dashboard has a gap. Across a team of 10 engineers, tags are always stale.
Spike detection? You're setting up static thresholds on global spend. "Alert me if daily cost exceeds $500." Cool, but which function caused it? Was it the search pipeline or the document processor? You don't know until you dig through logs.
CostKey takes a completely different approach. One line of code. It patches fetch/httpx invisibly, intercepts AI calls at the runtime level, and uses stack trace analysis to automatically map each call to the business logic function that triggered it.
Not your wrapper. Not your retry utility. The actual function. No proxy. No rewrites. No manual tags. Switch providers whenever you want, nothing to change. It even works on top of Portkey and Helicone - keep your existing setup, just add one line.
Free to start. Takes 30 seconds. costkey.dev