Keys / Langfuse

LANGFUSE_SECRET_KEY

The secret half of a Langfuse project API key. Your app sends traces and fetches prompts with it and LANGFUSE_PUBLIC_KEY.

Starts with
sk-lf-
Expires
you choose, or never
API
list, create and delete, with an organization API key

Get it

Create one on cloud.langfuse.com. The steps aren't recorded yet.

Set it

LANGFUSE_SECRET_KEY=sk-lf-...

The Python and JS/TS SDKs read it from this variable when you don't pass a key. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. In Project Settings > API Keys, create a new key with the same permissions. The secret is shown only once.
  2. Deploy the new LANGFUSE_SECRET_KEY and LANGFUSE_PUBLIC_KEY together; they're a pair.
  3. Check the Last used column to see that nothing still uses the old key, then delete it. A deleted key stops working at once.

Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.

Sources, checked 2026-11-16