Skip to main content

Project Settings

This guide covers project configuration, API key management, and team access control in Langfuse.


Accessing Settings

Navigate to Settings in the left sidebar after logging into Langfuse.

Project Settings


Project Configuration

General Settings

SettingDescription
Project NameDisplay name shown in the UI
Project IDUnique identifier (read-only)
CreatedProject creation date
AdminOriginal project requester

Environment Settings

Configure how your project handles different environments:

SettingDescription
Default EnvironmentEnvironment tag applied when LANGFUSE_ENV is not set
Environment FilterDefault filter applied to trace views

Retention Settings

Data retention policies for your project:

SettingDescription
Trace RetentionHow long traces are stored (e.g., 30 days, 90 days)
Generation RetentionHow long generation data is kept
Session RetentionHow long session data is maintained
CAIP Managed

Retention settings are configured by the CAIP team based on your subscription. Contact CAIP support to modify retention policies.


API Keys

API keys authenticate your application with Langfuse. You need both keys to send traces.

Key Types

Key TypePrefixUsageSecurity
Public Keypk-lf-Identifies your projectSafe to embed in client-side code
Secret Keysk-lf-Authenticates API requestsKeep secret, never expose

Creating API Keys

Admin Only

Only project Admins can create and manage API keys.

  1. Navigate to SettingsAPI Keys
  2. Click Create new API key
  3. Enter a descriptive name (e.g., "Production Server", "Dev Machine")
  4. Copy both keys immediately

Create API Key

Secret Key Shown Once

The secret key is displayed only at creation time. Store it securely:

  • Use a password manager
  • Store in a secrets vault (AWS Secrets Manager, HashiCorp Vault)
  • Never commit to version control

API Key Best Practices

PracticeRecommendation
NamingUse descriptive names: prod-server-main, dev-local
RotationRotate keys periodically (every 90 days recommended)
SeparationUse different keys for different environments
Least PrivilegeCreate keys only when needed

Rotating API Keys

To rotate a key without downtime:

  1. Create a new API key
  2. Update your application to use the new key
  3. Deploy the change
  4. Verify traces are flowing
  5. Delete the old key

Using API Keys in Your Application

.env
# Langfuse API Keys
LANGFUSE_PUBLIC_KEY=pk-lf-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
LANGFUSE_SECRET_KEY=sk-lf-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
# ROW
LANGFUSE_HOST=https://langfuse.caip.bmw.cloud

# CN
# LANGFUSE_HOST=https://langfuse.caip.bmwchina.cloud

# Optional: disable Langfuse observability
# CAIP_LANGFUSE_OBSERVABILITY=false
app.py
import os
from dotenv import load_dotenv

load_dotenv()

# SDK reads from environment variables automatically
# No need to pass keys explicitly

Security Recommendations

Never Expose Secret Keys
  • ❌ Don't commit .env files to git
  • ❌ Don't log API keys
  • ❌ Don't include in client-side code
  • ❌ Don't share keys via email/chat
Use Secrets Management
  • ✅ Use environment variables
  • ✅ Use AWS Secrets Manager
  • ✅ Use HashiCorp Vault
  • ✅ Use Kubernetes Secrets

Team Management

Roles and Permissions

RoleView TracesCreate TracesManage SettingsManage MembersDelete Project
Viewer
Member
Admin

Admin Capabilities

As a project Admin, you can:

  • Create API Keys: Generate new keys for applications
  • Invite Members: Add team members with specific roles
  • Promote Members: Elevate Members to Admin status
  • Remove Access: Revoke team member access
  • Manage Settings: Configure project options
  • Delete Project: Remove the project entirely

Inviting Team Members

  1. Navigate to SettingsMembers
  2. Click Invite Member
  3. Enter the BMW email address
  4. Select a role (Admin, Member, or Viewer)
  5. Click Send Invite

The invited user will receive an email and can access the project after logging in with their BMW WebEAM credentials.

Admin Promotion Flow

Removing Team Members

  1. Navigate to SettingsMembers
  2. Find the member to remove
  3. Click the Remove button
  4. Confirm the action
Access Revoked Immediately

Removing a member immediately revokes their access. They will not be able to view traces or send data.


Model Pricing Configuration

Configure custom pricing for cost calculations.

Default Pricing

Langfuse includes default pricing for common models:

  • OpenAI GPT-4, GPT-3.5
  • Anthropic Claude
  • Other popular models

Custom Pricing

For custom or self-hosted models:

  1. Navigate to SettingsModel Pricing
  2. Click Add Custom Model
  3. Enter model details:
FieldDescription
Model NameExact model identifier used in traces
Input PriceCost per 1K input tokens
Output PriceCost per 1K output tokens

Example Custom Pricing

{
"model_name": "custom-llama-70b",
"input_price_per_1k": 0.001,
"output_price_per_1k": 0.002
}

Data Export

Export Options

FormatUse Case
JSONProgrammatic processing
CSVSpreadsheet analysis
APIAutomated data retrieval

Export via API

from langfuse import Langfuse

client = Langfuse()

# Export traces
traces = client.get_traces(
page=1,
limit=100,
from_timestamp="2024-01-01T00:00:00Z"
)

# Export generations
generations = client.get_generations(
page=1,
limit=100
)

Project Deletion

Irreversible Action

Deleting a project permanently removes all:

  • Traces
  • Generations
  • Sessions
  • API Keys
  • Settings

This action cannot be undone.

To delete a project:

  1. Navigate to SettingsDanger Zone
  2. Type the project name to confirm
  3. Click Delete Project

Troubleshooting

Common Issues

IssueSolution
Invalid API KeyVerify keys match exactly, check for extra spaces
Permission DeniedConfirm your role has necessary permissions
Key Not WorkingCheck if key was deleted or rotated
Cannot Create KeyOnly Admins can create API keys

Getting Help

If you encounter issues:

  1. Check this documentation
  2. Contact CAIP support via the portal
  3. Reach out to your project Admin

Next Steps