---
title: Analytics
seoTitle: "Langfuse AI Gateway analytics: cost and usage per user, key, and model (beta)"
description: Track cost, requests, and tokens of the Langfuse AI Gateway per user, API key, and model, and build your own dashboards in the gateway's ingestion project.
---

# Analytics

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

The **Analytics** page shows what your organization spends on the gateway and who uses it.

You can find it under **Organization settings → AI Gateway → Analytics**. What you see depends on your role:

- **Owners and admins** see all gateway usage in the organization, including the **User** filter and cost and requests per user.
- **People with the AI Gateway role** see only requests made with their own gateway keys.

  ![Gateway analytics page showing total cost, requests, tokens, cost over time, and cost and requests per user](/images/docs/ai-gateway/analytics.png)

## Charts are only using gateway data [#data-source]

The charts read the generations the gateway records in its [ingestion project](/docs/gateway/get-started/admin-setup#configure-the-gateway). Only calls made with a gateway key are considered. SDK traces sent to the same project don't impact gateway analytics numbers.

  Analytics need recorded traces. `USAGE` [ingestion
  mode](/docs/gateway/features/tracing#ingestion-modes) is enough. On
  self-hosted Langfuse with ingestion mode `NONE`, the page shows "Gateway
  requests are not recorded" instead of charts. Cost is subject to the [known
  cost bugs](/faq/all/ai-gateway-known-limitations).

## Build your own dashboards [#custom-dashboards]

Gateway traces are regular Langfuse traces, so admins and owners can build their own [custom dashboards](/docs/metrics/features/custom-dashboards) in the ingestion project:

- To limit a chart to gateway traffic, filter on the metadata key `langfuse.gateway.api_key.id`.
- To chart a single team or cost center, add [key metadata](/docs/gateway/features/api-keys#key-metadata) when you create keys and filter on `langfuse.gateway.api_key.metadata.<key>`.

<!-- agent-instructions -->

---

## Agent Instructions

This page is part of the [Langfuse](https://langfuse.com) documentation, published as plain Markdown for AI agents. Every page is available as Markdown by appending `.md` to its URL, or by sending an `Accept: text/markdown` header. This page: `https://langfuse.com/docs/gateway/features/analytics.md`.

### Querying these docs

If the answer is not on this page, query the documentation instead of guessing:

- **Semantic search** across all Langfuse docs, returning an answer with the relevant pages and excerpts. Ask a specific, self-contained question:

  ```bash
  curl -sG "https://langfuse.com/api/search-docs" --data-urlencode "query=How do I trace a LangGraph agent?"
  ```

- **Index of every page**: <https://langfuse.com/llms.txt>, with per-section indexes [llms-docs.txt](https://langfuse.com/llms-docs.txt), [llms-integrations.txt](https://langfuse.com/llms-integrations.txt), and [llms-self-hosting.txt](https://langfuse.com/llms-self-hosting.txt).

### Before writing Langfuse code

- **Install the [Langfuse Agent Skill](https://langfuse.com/docs/api-and-data-platform/features/agent-skill).** It encodes Langfuse's own best practices for instrumentation, prompt management, and evaluation, and materially improves results.
- **Read [What does a good trace look like?](https://langfuse.com/docs/observability/best-practices.md)** before instrumenting an application.
- **Verify endpoints, parameters, and response fields** against the [API reference](https://api.reference.langfuse.com) instead of inferring them from code examples.
- **Use the [Langfuse CLI](https://langfuse.com/docs/api-and-data-platform/features/cli)** (`npx @langfuse/cli api <resource> <action>`) to read or write traces, prompts, datasets, and scores from the terminal.

Found an error in these docs? Please open an issue at <https://github.com/langfuse/langfuse-docs/issues>.
