Skip to main content

At a glance

Credentials

Set these per environment. See Connect an integration.
VariableRequiredDescription
LANGFUSE_PUBLIC_KEYYesLangfuse project public key (starts with pk-lf-), used as the HTTP Basic username Docs.
LANGFUSE_SECRET_KEYYesLangfuse project secret key (starts with sk-lf-), used as the HTTP Basic password Docs.

Setup

  1. Create a Langfuse account: Sign up at https://cloud.langfuse.com (EU) or https://us.cloud.langfuse.com (US) - the free Hobby plan is enough for testing. Self-hosting is also supported.
  2. Create project API keys: In your Langfuse project, open Settings → API Keys and create a key pair. You get a public key (pk-lf-…) and a secret key (sk-lf-…).
  3. Store the keys: Add LANGFUSE_PUBLIC_KEY=pk-lf-… and LANGFUSE_SECRET_KEY=sk-lf-… to your .env file. The API uses HTTP Basic auth with the public key as username and secret key as password.
  4. Verify access: Run the List Traces tool. If your project is in the US region, pass host us.cloud.langfuse.com; EU projects use the default cloud.langfuse.com.
  • API keys are project-scoped - create separate keys per project/environment
  • All tools take a ‘host’ parameter (default cloud.langfuse.com for EU); US cloud is us.cloud.langfuse.com and self-hosted deployments use their own domain
Provider API reference: https://api.reference.langfuse.com

Tools

ToolAccessDescription
List TracesReadList traces in the Langfuse project with optional filters
Get TraceReadGet a single trace with its full observation tree and scores
List ObservationsReadList observations (spans, generations, events) with optional filters
Create ScoreWriteAttach a score (evaluation result) to a trace or observation

Example prompts

  • List my most recent Langfuse traces and summarize latency, errors, and usage patterns.
  • Look up a Langfuse trace I specify and attach an accuracy score with a short comment.