CostKey

CostKey vs Langfuse

CostKey is built for agents in production: why a run failed, the code behind every call, and budgets that stop spend before the bill.

Langfuse is a popular LLM engineering platform with tracing, prompt management and evaluations. The difference is focus: CostKey is built for agents running in production, where you need to know which runs failed and why, which line of code made each call, and what it all cost before the bill arrives.

CostKey and Langfuse side by side

CostKeyLangfuse
Self-hostingOne command with Docker (Postgres)Docker or Kubernetes (Postgres, ClickHouse, Redis, object storage)
How calls are capturedSDK watches the calls your app already makes; frameworks add spansSDK decorators, framework integrations and OpenTelemetry
The line of code behind a callYesNo
Cost for non-token units (characters, audio seconds, searches)45+ providers priced per componentToken cost; custom model prices
Budgets and a kill switchYesNo
Datasets and evalsLabel calls from production runs; evals run from your own code (TypeScript)Datasets, experiments and annotation
Browser agent replayPlaywright and Puppeteer runs, plus screenshot replay for computer-use agentsNot listed
Prompt management and playgroundNoYes

Langfuse details from langfuse.com and its self-hosting docs, checked 2026-10-20.

Where CostKey is different

From a failed run to the line of code

Every model call carries the stack it came from. A run page shows the span tree, the failing step and the code behind it, including calls the framework made on its own tasks, which are attributed to the code that started the agent.

Spend you can control

Budgets cover any agent, feature, customer, model or provider, across API keys. When one runs out, the kill switch refuses the next call before the provider bills it. Spikes and failures go to Slack and email.

The whole bill, not only tokens

CostKey prices 45+ providers per component: cached input, reasoning, audio seconds, characters for speech, searches and requests. Voice agents on ElevenLabs, Deepgram or Cartesia are priced like any other call.

Smaller to run

Self-hosted CostKey needs Postgres and one container. Langfuse v3 adds ClickHouse, Redis and object storage.

Where Langfuse is ahead

Langfuse has prompt management, a playground, human annotation and a large community. CostKey has datasets from labelled production calls and evals that run from your own code, but no prompt management. If your team iterates on prompts offline, Langfuse covers more of that today.

Questions

Can I run CostKey next to Langfuse?

Yes. CostKey's SDK observes HTTP calls and does not change them, so it works alongside Langfuse or any other tracer.

Does CostKey support OpenTelemetry?

Yes. The OpenTelemetry bridge turns OTel spans into CostKey spans, and model calls inside them are attributed and priced.

How does CostKey price calls?

From a price table covering 45+ providers, per component: input, cached input, output, reasoning, audio, characters, searches and requests. Self-hosted servers fetch new prices automatically.

Try it on your own machines

One command starts Postgres, the server and the console with Docker.

bash
curl -fsSL https://costkey.dev/install.sh | sh