Source: http://www.poma-ai.com/docs/sdk/getting-started/authentication

# POMA SDK Authentication

The SDK reads your **account API key** from `POMA_API_KEY`. You provision that key once in the [POMA Console](https://console.poma-ai.com/) — no curl, no JWT bootstrap, no API calls. The Console is the source of truth for everything around the products: account, organisations, projects, plan, and keys.

## Generate an API key in the Console

1. Open the [POMA Console](https://console.poma-ai.com/) and sign in (or create a free account — 1,000 pages of trial ingestion, no card required).
2. Go to **Account**.
3. In the **API Key** card on the right, click **Generate API key**. Copy the value — it's shown once.

![POMA Console — Account view, showing the API Key card on the right](/console/account.png)

The Console is also where you upgrade your plan, rename your username, and see your role — all in this same view.

> Need to call `/generateApiKey` directly from a script (CI, automation, multi-account provisioning)? The raw HTTP flow lives in the [POMA API v3 reference](https://api.poma-ai.com/v3/docs). The docs here intentionally don't duplicate it — the Console is the supported path for human-operated account setup.

## Wire it into the SDK

::: code-group

```bash [macOS / Linux]
export POMA_API_KEY="poma_acc_…"
```

```powershell [Windows]
setx POMA_API_KEY "poma_acc_…"
```

:::

On Windows, open a new terminal after running `setx`.

The SDK picks the env var up automatically:

```python
from poma import PrimeCut

client = PrimeCut()  # reads POMA_API_KEY
```

You can also pass the key explicitly if you'd rather not use an env var:

```python
client = PrimeCut(api_key="poma_acc_…")
```

## Optional environment variables

The SDK also respects `API_BASE_URL` for pointing the client at a non-default POMA API base URL (on-prem, staging). Most users never need to set it.

## Lost the key?

Open the Console → **Account** → **API Key** card → **Generate API key** again. The new key takes effect immediately; the old one stops working.