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

# LangSmith

> Connect LangSmith to CloudThinker to investigate failed runs, review traces, and check dataset and experiment results

Connect your LangSmith workspace to let CloudThinker agents find why an LLM run failed, what a trace cost, and how an experiment scored. LangSmith authenticates with an **API key** against your workspace and region, and the connection is read-only.

## Prerequisites

* A **LangSmith account** with the workspace you want to investigate.
* An **API key**: either a personal access token, or a service key (only organization admins can create service keys).
* The **workspace ID** and the **API URL** for your region.

## Setup

<Steps>
  <Step title="Create an API key">
    In LangSmith, open the **Settings** page and select **API Keys**. For a service key, choose an organization-scoped or workspace-scoped key, and name the workspaces if you choose workspace-scoped. Set an expiration, then click **Create API Key**.
  </Step>

  <Step title="Copy the key">
    Copy the key and store it securely. LangSmith displays it only once.
  </Step>

  <Step title="Find the workspace ID">
    On the **Settings** page, find your **Workspace ID** under **General**.
  </Step>

  <Step title="Add the connection in CloudThinker">
    Go to **Connections → LangSmith**, fill in the three fields below, and click **Connect**. CloudThinker sets up the connection and shows a **Connected** status.
  </Step>
</Steps>

<Note>
  **Connected** means CloudThinker finished setting up the connection. Run the verify prompt below to confirm LangSmith accepts the key, workspace, and URL.
</Note>

## Connection details

| Field | Description | Example |
| - | - | - |
| **LANGSMITH\_API\_KEY** | Personal access token or service key | `<your-api-key>` |
| **LANGSMITH\_WORKSPACE\_ID** | ID of the workspace to investigate | `<your-workspace-id>` |
| **LANGSMITH\_ENDPOINT** | API URL for your region or deployment | `https://api.smith.langchain.com` |

CloudThinker's form requires all three. LangSmith needs the workspace ID when a key covers more than one workspace, and entering it for a single-workspace key does no harm.

| Region | API URL |
| - | - |
| GCP US (default) | `https://api.smith.langchain.com` |
| GCP EU | `https://eu.api.smith.langchain.com` |
| GCP APAC | `https://apac.api.smith.langchain.com` |
| AWS US | `https://aws.api.smith.langchain.com` |

For any other deployment, use the API URL of that deployment.

## Required permissions

A personal access token has the permissions of the user who created it. A service key has the scope you give it: one workspace, several workspaces, or the whole organization.

<Tip>
  Use a workspace-scoped service key for the one workspace agents should read. On LangSmith Enterprise, you can also assign the key the **Workspace Viewer** role, which LangSmith describes as read-only access to all resources in the workspace.
</Tip>

## Agent capabilities

Once connected, agents read your workspace and change nothing in LangSmith.

| Capability | Description |
| - | - |
| **Projects and runs** | Find failed, slow, or costly runs in a named project and rank them |
| **Traces and threads** | Inspect a trace and the message history of a conversation thread |
| **Datasets and examples** | List datasets and read their examples |
| **Experiments** | Review an experiment's results for a dataset, including latency, cost, and feedback |
| **Prompts** | List prompts and read a prompt's template |

Billing usage is not available through this connection. Agents show summaries rather than full run inputs and outputs.

### Verify the connection

```text theme={null}
List my LangSmith projects and datasets, and tell me which workspace they belong to
```

### Example prompts

```text theme={null}
Show the five most expensive runs in the support-bot project from the last day and what drove their cost
Find failed runs in the support-bot project and group them by error
Compare the latest experiments on the support-eval dataset by latency, cost, and feedback
```

## Troubleshooting

<Accordion title="401 Unauthorized">
  The API key is missing, mistyped, expired, or deleted. LangSmith keys can carry an expiration date, and an expired key cannot be reactivated. Create a new key and update the connection.
</Accordion>

<Accordion title="403 Forbidden">
  An organization-scoped service key needs the workspace ID to read workspace resources, and LangSmith rejects the request with 403 without it. Check **LANGSMITH\_WORKSPACE\_ID**, and confirm the key's role covers that workspace.
</Accordion>

<Accordion title="Nothing is found, or the wrong data comes back">
  The URL must match the region where your workspace lives. Set **LANGSMITH\_ENDPOINT** to your region's API URL from the table above.
</Accordion>

<Accordion title="Lists come back empty">
  An empty list is not a connection failure. The workspace may have no projects, datasets, or experiments yet, or the name you asked for does not exist. Ask the agent to list what exists, then name an exact project or dataset.
</Accordion>

<Accordion title="Requests return 429">
  LangSmith limits how many requests each key can make in a minute. Wait a moment, then ask again with a smaller request.
</Accordion>

## Security

* **Least privilege** — grant only the permissions the agents need for your use case; start read-only and widen later.
* **Read-only by default** — use read-only credentials unless you want agents to make changes through this connection.
* **Rotate credentials** — rotate keys and tokens on your normal schedule; CloudThinker picks up the new value when you update the connection.
* **Revoke on offboarding** — remove the credential at the provider when you delete a connection or a teammate leaves.

- **Workspace-scoped key** — a key limited to one workspace keeps other workspaces out of reach.
- **Expiration** — set an expiration on the key, and replace it before it lapses.

## Related

<CardGroup cols={2}>
  <Card title="Langfuse Connection" icon="https://mintcdn.com/cloudthinker/tTYzPaZv-jtM39C4/images/icons/langfuse.svg?fit=max&auto=format&n=tTYzPaZv-jtM39C4&q=85&s=aa5a9e6e2f5cf0ceab32e94e4751d0fc" href="/guide/connections/langfuse" width="16" height="16" data-path="images/icons/langfuse.svg">
    LLM traces, prompts, and evaluations
  </Card>

  <Card title="Datadog Connection" icon="https://mintcdn.com/cloudthinker/aLd-ttc-SCW-aFky/images/icons/datadog.svg?fit=max&auto=format&n=aLd-ttc-SCW-aFky&q=85&s=e8382167f2a1eb1e00971b5f4d703d48" href="/guide/connections/datadog" width="24" height="24" data-path="images/icons/datadog.svg">
    Log search, metrics, and monitoring
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.