Skip to main content
Workspace secrets store the API keys that LangSmith uses to call model providers and tools. Features that read them include the Playground, evaluators, Fleet, and the LLM Gateway. Each secret belongs to one workspace. A workspace that calls a provider needs its own copy of that provider’s key.

Required permission

Adding, editing, or deleting a workspace secret requires the workspaces:manage-secrets permission in that workspace. Workspace Admins have it by default. Without it, the secrets page lists existing secrets but hides the add button. On LangSmith Cloud and self-hosted v0.18 or later, the page also shows a notice that asks you to contact a workspace admin. Ask a workspace admin to add the secret for you, or to grant you access.

Open the secrets page

Where the secrets page sits in Settings depends on your LangSmith version:
  1. Open Settings.
  2. At the top of the sidebar, select Workspace, then pick the workspace that needs the secret.
  3. Under Configuration, select Secrets (Provider Credentials on self-hosted v0.18).
In a personal organization, the sidebar has no Workspace switch. Select Secrets under Configuration.The page header reads Workspace Secrets. You can also type secrets in the Settings search box to find it.

Add a secret

To add a workspace secret:
  1. Open the secrets page.
  2. Click + Secret.
  3. Under Provider, select your model provider. The form shows a field labeled with the environment variable the provider expects, such as OPENAI_API_KEY, and saves the secret under that name. Enter your key in that field, where the empty box shows Enter secret value. Some providers, such as Amazon Bedrock, ask you to choose an authentication method and show different fields. For a tool key, or a provider that is not listed, leave Custom as the provider. Enter the environment variable name your provider or tool expects as the Key, and your key as the Value. On self-hosted v0.16, the dialog has no Provider list. Enter the environment variable name as the Key and your key as the Value.
  4. Click Save.
LangSmith does not check a key when you save it. A wrong key shows up as the provider’s error on the first request that uses it.

Edit or delete a secret

To delete a secret, click the delete icon in its row. When the page shows an Allowed hosts column, each row also has an edit icon for changing the secret’s value, hosts, or header.

Secret names and settings by feature

Each feature reads specific secret names. The default name for a provider is the one the Provider list fills in. For the full list, and for providers that need more than one secret, see:

Other places to store credentials

  • OAuth client credentials: If your provider authenticates with OAuth2 client_credentials, configure the credentials on the model configuration instead. See OAuth client credentials.
  • Organization secrets: Keys stored at the organization level instead of in one workspace. Organization-scoped model configurations read organization secrets, not workspace secrets.