Langfuse is an open-source LLM engineering platform for tracing, evaluating, and debugging LLM applications.
In Langfuse, go to your project’s Settings > API Keys and create a new key pair. Copy both the Secret Key and Public Key.

Go to Settings > Observability and toggle Enable Broadcast.

Click the edit icon next to Langfuse and enter:
https://us.cloud.langfuse.com. Change for other regions or self-hosted instances
Click Test Connection to verify the setup. The configuration only saves if the test passes.

Make an API request through OpenRouter and view the trace in Langfuse.

Langfuse supports rich trace hierarchies and metadata. Use the trace field to customize how your traces appear in Langfuse.
This creates a hierarchical trace structure in Langfuse:
user field maps to Langfuse’s User ID for user-level analyticssession_id field maps to Langfuse’s Session ID for grouping conversationstrace are passed as trace metadata and can be used for filtering and analysis in LangfuseWhen Privacy Mode is enabled for this destination, prompt and completion content is excluded from traces. All other trace data — token usage, costs, timing, model information, and custom metadata — is still sent normally. See Privacy Mode for details.