Connect a Langfuse project
You need a Langfuse project member who can create API keys and a Weave admin to connect them.- In Langfuse, open Project settings → API keys and click Create new API keys. Copy the public key (
pk-lf-...) and secret key (sk-lf-...). - In Weave, open Data → Langfuse and click Connect Langfuse.
- Enter a connection name, the Langfuse host, and both keys, then click Save. The host defaults to
https://cloud.langfuse.com; usehttps://us.cloud.langfuse.comfor the US region, or your own URL for self-hosted Langfuse.
- Weave re-reads the last 3 days of generations on every scheduled sync, so late-arriving usage is picked up. To import older history, ask Weave support for a backfill.
- If the keys are revoked, the connection shows Action required. Create new keys in Langfuse and use Replace keys.
- Disconnecting erases the stored secret key in Weave. Delete the key in Langfuse separately.
Weave reads generations through the Langfuse observations API v2. Self-hosted Langfuse must run v4 or later.
What Weave stores
Weave stores one row per Langfuse generation: its ID, start time, model,userId, sessionId, input, output, and cache token counts, and Langfuse’s calculated total cost. Weave never stores prompts, completions, or metadata.
How usage is attributed
Langfuse’suserId is whatever your application sends. Weave attributes a generation to a member only when its userId is exactly that member’s email address (compared case-insensitively). To get per-person reporting, set the Langfuse userId to the user’s work email.
Generations with any other userId, or none, still count toward organization-wide AI tool costs but don’t appear in per-person token or session reports.
Avoiding double counting
Langfuse often observes calls that Weave already reports from another source, such as the Weave Router, OpenRouter, the AI Gateway, or the Claude Code, Cursor, and Codex integrations. Weave keeps each source’s data separate and removes the overlap at reporting time:- A generation whose
sessionIdmatches a session that another source already reports is skipped. - A generation that matches a gateway or OpenRouter request within a few seconds, with the same output tokens and prompt size, is skipped.
Costs
Langfuse calculates cost from its own model price table, so Weave reports Langfuse cost with estimated fidelity. When Langfuse has no price for a model, Weave estimates cost from token counts for session reporting. Provider invoices, discounts, and negotiated rates are not reflected.Related pages
- AI tool costs: understand cost fidelity and visibility
- OpenRouter: the other gateway analytics integration
- AI tools overview: compare supported AI tools
