> ## 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.

# Create an account and API key

export const protocol_0 = undefined

export const prefix_0 = "api.smith"

export const suffix_0 = undefined

To get started with LangSmith, you need to create an account. You can sign up for a free account in the [LangSmith UI](https://smith.langchain.com?utm_source=docs\&utm_medium=cta\&utm_campaign=langsmith-signup\&utm_content=langsmith-create-account-api-key). 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:

* [**Personal Access Tokens (PATs)**](/langsmith/administration-overview#personal-access-tokens-pats) inherit the permissions of the user who created them. Use PATs for personal scripts or tools.
* [**Service keys**](/langsmith/administration-overview#service-keys) scope to specific [workspaces](/langsmith/administration-overview#workspaces) or the entire [organization](/langsmith/administration-overview#organizations). Use service keys for applications and production services.

To log [traces](/langsmith/observability-concepts#traces) and run [evaluations](/langsmith/evaluation) with LangSmith, create an API key to authenticate your requests.

<Steps>
  <Step title="Open API Keys settings" icon="settings">
    Navigate to the [**Settings** page](https://smith.langchain.com/settings) and select the **API Keys** section.
  </Step>

  <Step title="Configure the key type" icon="key">
    For service keys, choose between an organization-scoped and workspace-scoped key. If the key is workspace-scoped, you must specify the workspaces.

    [Enterprise](/langsmith/pricing-plans) users can also [assign specific workspace roles](/langsmith/administration-overview#workspace-roles-rbac) to service keys, which adjusts their permissions independently of any user.
  </Step>

  <Step title="Set expiration" icon="calendar">
    Set the key's expiration. The key becomes unusable after the number of days chosen, or never, if that is selected.
  </Step>

  <Step title="Create the key" icon="circle-check">
    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.
  </Step>
</Steps>

<Tip>
  To delete an API key, navigate to the [**Settings** page](https://smith.langchain.com/settings), find the key in the **API Keys** section, and select the trash icon <Icon icon="trash" iconType="solid" /> in the **Actions** column.
</Tip>

<Tip>
  [Enterprise](/langsmith/pricing-plans) Organization Admins can edit the [role](/langsmith/administration-overview#workspace-roles-rbac) on an existing service key without rotating the key. On the [**Settings** page](https://smith.langchain.com/settings) **API Keys** section, switch to the **Service** tab and click any service key row to open the edit dialog. Update the workspace role (and, for organization-scoped keys, the org role) and click **Save**. The key string itself is unchanged.
</Tip>

## Configure the SDK

Install the SDK for your language:

<Tabs>
  <Tab title="Python">
    <CodeGroup>
      ```bash pip theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
      pip install langsmith
      ```

      ```bash uv theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
      uv add langsmith
      ```
    </CodeGroup>
  </Tab>

  <Tab title="TypeScript">
    ```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
    npm install langsmith
    ```
  </Tab>
</Tabs>

For full details, refer to the [Python SDK](/langsmith/smith-python-sdk) or [JS/TS SDK](/langsmith/smith-js-ts-sdk) reference.

Then, set your API key and enable tracing:

```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
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` (GCP US). Set it only if you are on a different deployment. For regional SaaS, set it to the API URL for your region:

  <table>
    <thead>
      <tr>
        <th>Region</th>

        <th>
          {protocol_0 === false ? "Host" : "URL"}
        </th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td>GCP US</td>

        <td>
          <code>
            {`${protocol_0 === false ? "" : "https://"}${prefix_0 || "api.smith"}.langchain.com${suffix_0 || ""}`}
          </code>
        </td>
      </tr>

      <tr>
        <td>GCP EU</td>

        <td>
          <code>
            {`${protocol_0 === false ? "" : "https://"}eu.${prefix_0 || "api.smith"}.langchain.com${suffix_0 || ""}`}
          </code>
        </td>
      </tr>

      <tr>
        <td>GCP APAC</td>

        <td>
          <code>
            {`${protocol_0 === false ? "" : "https://"}apac.${prefix_0 || "api.smith"}.langchain.com${suffix_0 || ""}`}
          </code>
        </td>
      </tr>

      <tr>
        <td>AWS US</td>

        <td>
          <code>
            {`${protocol_0 === false ? "" : "https://"}aws.${prefix_0 || "api.smith"}.langchain.com${suffix_0 || ""}`}
          </code>
        </td>
      </tr>
    </tbody>
  </table>

* `LANGSMITH_WORKSPACE_ID` is required only if your API key is scoped to more than one [workspace](/langsmith/administration-overview#workspaces). Find your Workspace ID on the [**Settings** page](https://smith.langchain.com/settings) under **General**:

  `LANGSMITH_WORKSPACE_ID=<Workspace ID>`

To reuse endpoint, API key, and workspace settings across local shells or remote runtimes, refer to [Profile configuration](/langsmith/profile-configuration).

## Use API keys outside of the SDK

See [instructions for managing your organization via API](/langsmith/manage-organization-by-api).

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>

  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/langsmith/create-account-api-key.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
