> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langchain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Workspace secrets

> Find, add, edit, and delete the workspace secrets that LangSmith uses to call model providers and tools on LangSmith Cloud and self-hosted LangSmith.

Workspace secrets store the API keys that LangSmith uses to call model providers and tools. Features that read them include the [Playground](https://docs.langchain.com/langsmith/playground-model-providers.md), [evaluators](https://docs.langchain.com/langsmith/evaluation.md), [Fleet](https://docs.langchain.com/langsmith/fleet/index.md), and the [LLM Gateway](https://docs.langchain.com/langsmith/llm-gateway.md). 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](https://docs.langchain.com/langsmith/rbac.md#workspace-admin) 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:

> [tab] Cloud and self-hosted v0.18 or later
>
> 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.

> [tab] Self-hosted v0.16 and v0.17
>
> 1. Open  **Settings** for the workspace that needs the secret.
> 2. Select **Integrations** > **Provider secrets**.

## Add a secret

To add a workspace secret:

1. [Open the secrets page](#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 secret) delete icon in its row. When the page shows an **Allowed hosts** column, each row also has an (Edit secret) 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:

* [Provider secret names](https://docs.langchain.com/langsmith/llm-gateway-provider-authentication.md#add-a-provider-key) for the LLM Gateway, including [Amazon Bedrock](https://docs.langchain.com/langsmith/llm-gateway-provider-authentication.md#configure-amazon-bedrock) and [Azure Foundry](https://docs.langchain.com/langsmith/llm-gateway-provider-authentication.md#configure-azure-foundry).
* [Allowed hosts](https://docs.langchain.com/langsmith/advanced-code-evaluators.md#configure-allowed-hosts-for-a-secret) for secrets that advanced code evaluators send to external services.
* [Fleet secrets](https://docs.langchain.com/langsmith/fleet/workspace-admin.md#workspace-secrets), including tool keys and `FLEET_`-prefixed secrets that take priority within Fleet.
* [Decision model providers](https://docs.langchain.com/langsmith/decision-model-evaluator.md) for decision model evaluators.

## 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](https://docs.langchain.com/langsmith/model-configurations.md#oauth-client-credentials).
* **Organization secrets**: Keys stored at the organization level instead of in one workspace. [Organization-scoped model configurations](https://docs.langchain.com/langsmith/llm-gateway-model-configurations.md) read organization secrets, not workspace secrets.

***

[Connect these docs](https://docs.langchain.com/use-these-docs.md) to your agent of choice via MCP for real-time answers.

[Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/langsmith/workspace-secrets.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
