# langfuse

> langfuse is an open-source AI tool for developer tools. Rust gateway that proxies OpenAI and Anthropic APIs and records each generation. It is available on API, self-hosted and CLI.

- **Kind:** Tool
- **Pricing:** Open source
- **Platforms:** API, self-hosted, CLI
- **Repository:** https://github.com/langfuse/langfuse/tree/HEAD/ai-gateway
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-18

## About

The README describes this as a standalone service written in Rust that sits between an application or coding tool and the native OpenAI and Anthropic APIs. Requests are authenticated with a gateway key, which Langfuse Web resolves into a provider connection, and responses are relayed as native JSON or server-sent events without rewriting the provider bytes.

Each finalized generation is captured and uploaded to Langfuse over OTLP in batches per project, so token usage and cost can be tracked for calls routed through it. Spend limits per gateway key can be enforced through a Redis counter, and operational logs and OpenTelemetry traces are kept separate from the generation data.

It is aimed at teams that self-host Langfuse and want observability for OpenAI or Anthropic traffic, including Claude Code sessions pointed at the Anthropic namespace, without changing their SDK code beyond the base URL.

## Features

- **Native API passthrough:** Relays OpenAI and Anthropic request and response bodies, including SSE streams, without rewriting provider bytes.
- **Generation capture to Langfuse:** Uploads each finalized generation through OTLP, batched per project, for tracing and cost tracking.
- **Gateway key resolution:** Maps a gateway key to a trusted provider connection through the Langfuse Web service.
- **Spend limits per key:** Counts spend in Redis against daily, weekly, monthly or total limits and returns 429 once reached.
- **Memory-bounded admission:** Reserves memory per request from a configurable budget and returns 503 when it is exhausted.
- **Operational telemetry:** Emits structured logs, request IDs and OpenTelemetry traces and metrics for gateway health.

## Good for

- Tracing OpenAI Responses or Chat Completions calls from an app without changing SDK code
- Routing Claude Code sessions through a monitored Anthropic endpoint
- Capping API spend for individual gateway keys
- Monitoring gateway latency and error rates in Datadog or another OTLP backend

## FAQ

### Does the gateway store or rewrite provider responses?

The README says responses are relayed as native JSON or SSE without rewriting provider bytes, except that streamed Chat Completions requests are asked for usage.

### Which endpoints are supported?

OpenAI namespace: /openai/v1 with responses, responses/compact, chat/completions, decisions, embeddings and models. Anthropic namespace: /anthropic/v1 with messages, messages/count_tokens and models.

### Is there a durable delivery guarantee for generation uploads?

No. The README states there is no durable delivery, and uploads are best-effort.

### Does it need a Redis instance?

Redis is only needed for spend limits. Without LANGFUSE_AI_GATEWAY_REDIS_URL, requests on a key with a spend limit return 503.

### Is langfuse free?

Yes. langfuse is open source, so you can use and self-host it for free.

### What are the best alternatives to langfuse?

The closest alternatives to langfuse are gateway, Llmtee, ShanHaiGateway, bifrost and archestra.

## Where this comes from

- Description: written from the project's README.

## Alternatives

- [gateway](https://ai-powered.com/tools/gateway-10): gateway is an open-source AI tool for developer tools.
- [Llmtee](https://ai-powered.com/tools/llmtee): Llmtee is an open-source AI tool for developer tools.
- [ShanHaiGateway](https://ai-powered.com/tools/shanhaigateway): ShanHaiGateway is an open-source AI tool for developer tools.
- [bifrost](https://ai-powered.com/tools/bifrost-3): bifrost is an open-source AI tool for ai models and llm tooling.
- [archestra](https://ai-powered.com/tools/archestra): archestra is an open-source AI tool for security.
- [Eden AI](https://ai-powered.com/tools/eden_ai): Eden AI is a paid AI tool for developer tools.
- [Aiproxy](https://ai-powered.com/tools/aiproxy): Aiproxy is an open-source AI tool for developer tools.

---
Source: https://ai-powered.com/tools/langfuse-2
