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

# Initial API Configuration

> SCANOSS tools function without additional configuration and do not require an API key. However, an API key enables access to additional API features.

## Environment Variables

Set your API key as an environment variable to make it available across all SCANOSS CLI tools:

**macOS / Linux:**

```bash theme={null}
# Add to your shell profile (~/.bashrc, ~/.zshrc, etc.)
echo 'export SCANOSS_API_KEY=your_api_key_here' >> ~/.bashrc
source ~/.bashrc
```

**Windows (PowerShell):**

```powershell theme={null}
# Set for current session only
$env:SCANOSS_API_KEY = "your_api_key_here"

# Set permanently for the current user
[System.Environment]::SetEnvironmentVariable('SCANOSS_API_KEY', 'your_api_key_here', 'User')
```

> **Note:** After setting a permanent environment variable on Windows, open a new terminal session for the change to take effect. On macOS/Linux, run `source ~/.bashrc` (or the relevant profile file) or open a new terminal session.

## SCANOSS-PY

To use the [SCANOSS Python CLI](https://github.com/scanoss/scanoss.py), install it following the instructions in the repository, then run a scan using one of the commands below.

**Basic scan (no API key required):**

```bash theme={null}
# macOS / Linux
scanoss-py scan -o results.json /path/to/code
```

```powershell theme={null}
# Windows (PowerShell)
scanoss-py scan -o results.json C:\path\to\code
```

**With API key via environment variable:**

```bash theme={null}
# macOS / Linux
scanoss-py scan --key $SCANOSS_API_KEY -o results.json /path/to/code
```

```powershell theme={null}
# Windows (PowerShell)
scanoss-py scan --key $env:SCANOSS_API_KEY -o results.json C:\path\to\code
```

## SCANOSS-JS

To use the [SCANOSS JavaScript CLI](https://github.com/scanoss/scanoss.js), install it following the instructions in the repository, then run a scan using one of the commands below.

**Basic scan (no API key required):**

```bash theme={null}
# macOS / Linux
scanoss-js scan /path/to/code
```

```powershell theme={null}
# Windows (PowerShell)
scanoss-js scan C:\path\to\code
```

**With API key via environment variable:**

```bash theme={null}
# macOS / Linux
scanoss-js scan --key $SCANOSS_API_KEY -o results.json /path/to/code
```

```powershell theme={null}
# Windows (PowerShell)
scanoss-js scan --key $env:SCANOSS_API_KEY -o results.json C:\path\to\code
```

## SCANOSS-CC

[SCANOSS Code Compare](https://github.com/scanoss/scanoss.cc) communicates directly with the SCANOSS API and requires an API key to be configured before use.

**Configure with API key via environment variable:**

```bash theme={null}
# macOS / Linux
scanoss-cc configure --apiUrl https://api.scanoss.com --key $SCANOSS_API_KEY
```

```powershell theme={null}
# Windows (PowerShell)
scanoss-cc configure --apiUrl https://api.scanoss.com --key $env:SCANOSS_API_KEY
```

> **Note:** The `--apiUrl` flag value is case-sensitive. Use the URL exactly as shown above.

**Verify your configuration:**

Configuration settings are stored in the following file, depending on your operating system:

* **macOS / Linux:** `~/.scanoss/scanoss-cc-settings.json`
* **Windows:** `%USERPROFILE%\.scanoss\scanoss-cc-settings.json`

Inspect this file to confirm that your API key has been saved correctly:

```bash theme={null}
# macOS / Linux
cat ~/.scanoss/scanoss-cc-settings.json
```

```powershell theme={null}
# Windows (PowerShell)
Get-Content "$env:USERPROFILE\.scanoss\scanoss-cc-settings.json"
```

## SBOM Workbench

The [SBOM Workbench](https://github.com/scanoss/sbom-workbench) can be configured to use your API key via the application settings:

1. Navigate to **File → Settings**
2. Add a new API key entry by clicking the **'+'** button
3. Complete the form with the following values:
   * **Base URL:** `https://api.scanoss.com`
   * **API Key:** your API key value

<img src="https://mintcdn.com/scanoss/QpUtLiXoiWI24wVL/en/latest/introduction/images/sbom-api-settings.png?fit=max&auto=format&n=QpUtLiXoiWI24wVL&q=85&s=8317f96002fe5f510fbfe684a51c1e30" alt="SBOM Workbench Settings screen showing the Base URL and API Key input fields" style={{ display: "block", margin: "0 auto", width: "450px", height: "auto" }} width="744" height="823" data-path="en/latest/introduction/images/sbom-api-settings.png" />

Once the API key has been saved, subsequent scans will be submitted to the SCANOSS API rather than processed locally.

For further assistance, refer to the [FAQs](en/latest/troubleshooting/faqs).
