At a glance
- Availability: Experimental (how to enable).
- Auth: API key.
- Connection: The key from
LANGSMITH_API_KEYis sent as thex-api-keyheader. - Docs: https://docs.langchain.com/langsmith/create-account-api-key
Credentials
Set these per environment. See Connect an integration.| Variable | Required | Description |
|---|---|---|
LANGSMITH_API_KEY | Yes | LangSmith API key (starts with lsv2_) Docs. |
Setup
- Create a LangSmith account: Sign up at https://smith.langchain.com - the free Developer plan includes traces for testing.
- Create an API key: In LangSmith go to Settings → API Keys and create a key (Personal Access Token or Service Key). Copy it immediately - it is only shown once.
- Store the key: Add it to your .env file as LANGSMITH_API_KEY=lsv2_…
- Verify access: Run the List Projects tool. If you belong to multiple workspaces, make sure the key was created in the workspace you want to query.
- API keys are workspace-scoped; data from other workspaces is not visible to the key
- EU-region organizations use https://eu.api.smith.langchain.com - these tools target the default US endpoint
- Query Runs filter expressions are documented at https://docs.langchain.com/langsmith/trace-query-syntax
Tools
| Tool | Access | Description |
|---|---|---|
| List Projects | Read | List tracing projects (tracer sessions) in your LangSmith workspace |
| Query Runs | Read | Query traced runs with filters (project, trace filter expressions, root runs only) |
| Get Run | Read | Get full details of a single run, including inputs, outputs, and errors |
| List Datasets | Read | List evaluation datasets in your LangSmith workspace |
| List Examples | Read | List examples in a LangSmith dataset |
Example prompts
- Query my LangSmith projects for recent runs with errors and summarize what went wrong.
- List my LangSmith tracing projects with their run counts and last activity.