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

# LangSmith

> Connect your LangSmith workspace to ClosedLoop AI with a service key or personal access token, verified at connect time against your US or EU region.

LangSmith is LangChain's platform for tracing and evaluating LLM applications. Connect your workspace to ClosedLoop AI to put what your LLM application actually does alongside every other source of customer truth.

## Connection Method

LangSmith uses **API key** authentication. Both key types work:

| Key type              | Prefix     | When to use it                                                                            |
| --------------------- | ---------- | ----------------------------------------------------------------------------------------- |
| Service key           | `lsv2_sk_` | Recommended. Belongs to the workspace, so the connection survives any one person leaving. |
| Personal access token | `lsv2_pt_` | Carries one person's access. Use it when you cannot create a service key.                 |

You also choose a region. A LangSmith key works only in the region it was created in, so a key issued in the EU is rejected against the US region and the other way round. ClosedLoop AI verifies your key against LangSmith before storing it, so a wrong key or a wrong region tells you immediately instead of failing quietly later.

## Setup Guide

<AccordionGroup>
  <Accordion icon="key" title="Step 1: Create a LangSmith API key">
    1. In LangSmith, open **Settings**, then **API Keys**
    2. Click **Create API Key**
    3. Choose **Service Key** as the key type
    4. Set **Expiration Date** to **Never**
    5. Click **Create**, then copy the key and save it somewhere safe: LangSmith only shows it once

    <Warning>
      The expiration field defaults to a dated option. If you pick anything other than **Never**, the connection stops working on that date and you will need to reconnect with a new key.
    </Warning>
  </Accordion>

  <Accordion icon="globe" title="Step 2: Check which region your workspace is in">
    Look at the URL you use for LangSmith:

    * `smith.langchain.com` means your workspace is in the **US** region
    * `eu.smith.langchain.com` means your workspace is in the **EU** region

    Pick the matching region when you connect. Choosing the wrong one is the most common reason a valid key is refused.
  </Accordion>

  <Accordion icon="plug" title="Step 3: Connect in ClosedLoop AI">
    1. In ClosedLoop AI, go to **Integrations**
    2. Find **LangSmith** and click **Connect**
    3. Paste your LangSmith API key
    4. Select your region, **US** or **EU**
    5. Click **Connect**

    Your key is checked against LangSmith and stored securely, scoped to your workspace and region.
  </Accordion>
</AccordionGroup>

## Troubleshooting

| What you see                                       | What it means                                                                                                   |
| -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| LangSmith refused this key for the selected region | The region does not match where the key was created, or the key was revoked or has expired. Check Step 2 first. |
| LangSmith did not accept the API key               | The key was not copied in full. Copy it again from LangSmith.                                                   |
| LangSmith rate limit reached                       | Too many requests to LangSmith right now. Wait a moment and try again.                                          |

<Card title="Connect LangSmith" icon="plug" href="https://app.closedloop.sh/integrations">
  Set up your LangSmith integration in the ClosedLoop AI dashboard
</Card>
