DocsOverview

AI Gateway

Beta. The Langfuse AI Gateway is in public beta and can still change.

AI is being used in many different areas of a company, with engineers using coding agents, often dozens of AI apps running in production, internally or externally. Companies need to keep visibility and control over rising AI usage, answering questions like:

  • Who in our organization uses which models?
  • What do we use it for?
  • What does it cost?
  • Is it secure?
  • How can we optimize it?

The Langfuse AI Gateway is a central chokepoint to govern all AI traffic, easy to host, adopt, and enforce. It can log all requests natively in Langfuse to analyze and make decisions based on AI usage.

If you have feedback, questions, or feature requests, please share them on GitHub.

Gateway analytics page showing total cost, requests, tokens, cost over time, and cost and requests per user

What the Langfuse AI Gateway can do

Most gateways tell you what AI costs. Because every call through the Langfuse AI Gateway becomes a full Langfuse trace, it's more powerful than that.

  • See your spend. Cost and usage for every call land in one AI spend dashboard, by model and provider.
  • Know who spends it. Every key belongs to a person or service and can carry a team or cost center, so AI spend breaks down the way your company is organized.
  • Understand what it's spent on. Each call can be logged as a complete trace. You can see what an application or a team actually did with a model, and use the same search, evaluations, and annotation you already use in Langfuse. Or simply ask Halo: "What does this team use Claude Code for?"
  • Control model usage. Approve models centrally, so expensive or unvetted ones don't creep in unnoticed.
  • Incrementally adopt deeper tracing. Enforce logging every model call by mandating the gateway, and allow teams to incrementally add more detail (for example, tool call executions of complex agents) to AI traces in Langfuse via OpenTelemetry or one of our 50+ integrations. OpenTelemetry distributed tracing merges these traces within Langfuse.
  • Use Langfuse as memory for agents. All data in Langfuse is available via MCP and the CLI, so you can give agents access to search all AI requests they made in the past, which is the foundation for self-improvement loops.
  • Export metrics and raw logs to a data lake. This enables any custom downstream process in finance and data teams.

Getting Started

Depending on your role, you're likely looking to:

For more information on how the gateway, keys, and model routing fit together, read Core Concepts.


Was this page helpful?

Last updated on