Your OpenAI dashboard says you spent $2,000. CostKey tells you generateSummary() in src/features/search.ts:47 spent $1,200 of that — with one CLI command.
Open source SDKs on GitHub · npm + PyPI
Already using Portkey, Helicone, or LiteLLM? CostKey runs on top. Same setup command. No proxy changes.
Spend trends, request traces, prompt metadata, tool calls, agent runs, deploy diffs, and anomaly alerts. Everything auto-populated from your existing code.
Not the model. The line of code.
Private model? Internal gateway? Six lines.
Roll spend up by feature, product, or customer. For the bill your manager actually reads.
One request. All its AI calls. Grouped.
Prompts, system prompts, responses, tool calls, provider metadata, agent runs, retries, and errors all land on the same trace.
No proxy. Credential scrubbing by default. Use hooks to redact or drop anything sensitive.
Other tools need you to rewrite your codebase. CostKey is one setup command. And it sees deeper.
| CostKey | Portkey / Helicone | LiteLLM | |
|---|---|---|---|
| Integration | 1 CLI command. No proxy changes | Rewrite all AI calls to use their SDK | Replace all imports |
| How it works | Patches fetch/httpx invisibly | Proxy or SDK wrapper | Proxy gateway |
| Latency added | 0ms | 20-50ms per call | Variable |
| Cost per function | Automatic. File, function, line | Manual tags only | Manual tags only |
| Catch runaway loops | Per-function anomaly detection | Global alerts | ✗ |
| Streaming TTFT + TPS | ✓ | ✓ | ✗ |
| Prompt + tool capture | ✓ with scrubbing hooks | ✓ proxy-side | ✓ |
| Data privacy | You control what's sent | All data flows through proxy | All data flows through proxy |
| Price | Free | $49+/mo | Free (self-host) |
Authenticate in the browser, create a project, write your DSN, detect the framework, and get the exact init snippet or no-code sidecar preload.