Skip to main content

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.

To get started with LangSmith, you need to create an account. You can sign up for a free account in the LangSmith UI. LangSmith supports sign in with Google, GitHub, and email.

API keys

LangSmith supports two types of API keys. You can use both types of token to authenticate requests to the LangSmith API, but they have different use cases: To log traces and run evaluations with LangSmith, create an API key to authenticate your requests.

Open API Keys settings

Navigate to the Settings page and select the API Keys section.

Configure the key type

For service keys, choose between an organization-scoped and workspace-scoped key. If the key is workspace-scoped, you must specify the workspaces.Enterprise users can also assign specific workspace roles to service keys, which adjusts their permissions independently of any user.

Set expiration

Set the key’s expiration. The key becomes unusable after the number of days chosen, or never, if that is selected.

Create the key

Click Create API Key. LangSmith will display the API key only once, so make sure to copy it and store it in a safe place.
To delete an API key, navigate to the Settings page, find the key in the API Keys section, and select the trash icon in the Actions column.

Configure the SDK

Install the SDK for your language:
pip install langsmith
For full details, refer to the Python SDK or JS/TS SDK reference. Then, set your API key and enable tracing:
export LANGSMITH_API_KEY=<your-api-key>
export LANGSMITH_TRACING=true
You may also need the following additional environment variables. LANGSMITH_ENDPOINT controls which LangSmith server the SDK sends data to. It defaults to https://api.smith.langchain.com (US cloud). Set it only if you are on a different deployment:
  • EU instance: LANGSMITH_ENDPOINT=https://eu.api.smith.langchain.com
  • AWS-hosted US instance: LANGSMITH_ENDPOINT=https://aws.api.smith.langchain.com
LANGSMITH_WORKSPACE_ID is required only if your API key is scoped to more than one workspace. Find your Workspace ID on the Settings page under General: LANGSMITH_WORKSPACE_ID=<Workspace ID>

Use API keys outside of the SDK

See instructions for managing your organization via API.