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

# Authentication

> Learn how to authenticate with the Seam API by exporting your API key as an environment variable that the Seam client libraries pick up automatically.

Export your API key as an environment variable. Seam client libraries automatically pick up this exported key. For example:

```
$ export SEAM_API_KEY=seam_test2bMS_94SrGUXuNR2JmJkjtvBQDg5c
```

Next, run the following code to confirm that you are correctly authenticated:

<Tabs>
  <Tab title="JavaScript">
    **Code:**

    ```javascript theme={null}
    import { Seam } from 'seam'

    const seam = new Seam() // Seam automatically uses your exported SEAM_API_KEY.

    const checkAuth = async () => {
      const workspace = await seam.workspaces.get()
      console.log(workspace)
    }

    checkAuth()
    ```

    **Output:**

    ```json theme={null}
    {
      workspace_id: '00000000-0000-0000-0000-000000000000',
      name: 'Sandbox',
      company_name: 'Acme',
      connect_partner_name: 'Acme',
      is_sandbox": true
    }
    ```
  </Tab>

  <Tab title="cURL">
    **Code:**

    ```bash theme={null}
    curl -X 'POST' \
      'https://connect.getseam.com/workspaces/get' \
      -H 'accept: application/json' \
      -H "Authorization: Bearer ${SEAM_API_KEY}" \
      -H 'Content-Type: application/json' \
      -d '{}'
    ```

    **Output:**

    ```json theme={null}
    {
      "workspace": {
        "workspace_id": "00000000-0000-0000-0000-000000000000",
        "name": "Sandbox",
        "company_name": "Acme",
        "connect_partner_name": "Acme",
        "is_sandbox": true
      },
      "ok": true
    }
    ```
  </Tab>

  <Tab title="Python">
    **Code:**

    ```python theme={null}
    from seam import Seam

    seam = Seam()  # Seam automatically uses your exported SEAM_API_KEY.

    workspace = seam.workspaces.get()
    pprint(workspace)
    ```

    **Output:**

    ```
    Workspace(
      workspace_id='00000000-0000-0000-0000-000000000000',
      name='Sandbox',
      company_name='Acme',
      connect_partner_name='Acme',
      is_sandbox=True
    )
    ```
  </Tab>

  <Tab title="Ruby">
    **Code:**

    ```ruby theme={null}
    require "seam"

    seam = Seam.new() # Seam automatically uses your exported SEAM_API_KEY.

    workspace = seam.workspaces.get()

    puts workspace.inspect
    ```

    **Output:**

    ```
    <
      Seam::Workspace:0x0070328
        workspace_id="00000000-0000-0000-0000-000000000000"
        name="Sandbox"
        company_name="Acme"
        connect_partner_name="Acme"
        is_sandbox=true
    >
    ```
  </Tab>

  <Tab title="PHP">
    **Code:**

    ```php theme={null}
    <?php
    require 'vendor/autoload.php';

    $seam = new Seam\SeamClient(); // Seam automatically uses your exported SEAM_API_KEY.

    $workspace = $seam->workspaces->get();

    echo json_encode($workspace, JSON_PRETTY_PRINT);
    ```

    **Output:**

    ```json theme={null}
    {
      "workspace_id": "00000000-0000-0000-0000-000000000000",
      "name": "Sandbox",
      "company_name": "Acme",
      "connect_partner_name": "Acme",
      "is_sandbox": true
    }
    ```
  </Tab>

  <Tab title="C#">
    **Code:**

    ```csharp theme={null}
    using Seam.Client;

    var seam = new SeamClient(apiToken: SEAM_API_KEY);

    var workspace = seam.Workspaces.Get();

    Console.WriteLine(workspace);
    ```

    **Output:**

    ```json theme={null}
    {
      "workspace_id": "00000000-0000-0000-0000-000000000000",
      "name": "Sandbox",
      "company_name": "Acme",
      "connect_partner_name": "Acme",
      "is_sandbox": true
    }
    ```
  </Tab>
</Tabs>
