> ## Documentation Index
> Fetch the complete documentation index at: https://www.seam.co/docs/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:

> [tab] JavaScript
>
> **Code:**
>
> ```javascript theme={"dark"}
> 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={"dark"}
> {
>   workspace_id: '00000000-0000-0000-0000-000000000000',
>   name: 'Sandbox',
>   company_name: 'Acme',
>   connect_partner_name: 'Acme',
>   is_sandbox": true
> }
> ```

> [tab] cURL
>
> **Code:**
>
> ```bash theme={"dark"}
> 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={"dark"}
> {
>   "workspace": {
>     "workspace_id": "00000000-0000-0000-0000-000000000000",
>     "name": "Sandbox",
>     "company_name": "Acme",
>     "connect_partner_name": "Acme",
>     "is_sandbox": true
>   },
>   "ok": true
> }
> ```

> [tab] Python
>
> **Code:**
>
> ```python theme={"dark"}
> 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] Ruby
>
> **Code:**
>
> ```ruby theme={"dark"}
> 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] PHP
>
> **Code:**
>
> ```php theme={"dark"}
> <?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={"dark"}
> {
>   "workspace_id": "00000000-0000-0000-0000-000000000000",
>   "name": "Sandbox",
>   "company_name": "Acme",
>   "connect_partner_name": "Acme",
>   "is_sandbox": true
> }
> ```

> [tab] C#
>
> **Code:**
>
> ```csharp theme={"dark"}
> using Seam.Client;
>
> var seam = new SeamClient(apiToken: SEAM_API_KEY);
>
> var workspace = seam.Workspaces.Get();
>
> Console.WriteLine(workspace);
> ```
>
> **Output:**
>
> ```json theme={"dark"}
> {
>   "workspace_id": "00000000-0000-0000-0000-000000000000",
>   "name": "Sandbox",
>   "company_name": "Acme",
>   "connect_partner_name": "Acme",
>   "is_sandbox": true
> }
> ```


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