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

# poly login

> Reference for the `poly login` command.

Sign in to an existing Agent Studio account and save API key credentials for the CLI. Works against any region.

For first-time onboarding, [`poly setup`](https://docs.poly.ai/adk/reference/cli/setup) runs this same sign-in flow plus shell completion, AI agent skills, and project setup in one command.

`poly login`:

1. Prompts for a region if `--region` is not supplied.
2. Opens a browser window for sign-in via the Auth0 device authorization flow.
3. Keeps the ADK key already saved in `~/.poly/credentials.json` for the chosen region if it is still one of your personal access tokens. Otherwise it creates a new one and saves it there.

Agent Studio shows a personal access token's secret only when it is created, so signing in on another machine creates another token. Each user can hold two per region. If you already have two and `poly login` needs a new one, it stops and asks you to delete one in the **Personal Access Token** tab of your Agent Studio account.

On an enterprise region (`us-1`, `uk-1`, `euw-1`) your account must already be provisioned by PolyAI. If it isn't, the command stops with a message saying so; `studio` is the self-serve region, where signing in creates your workspace.

Run `poly login` once per region you need access to — credentials for multiple regions are stored side by side in the credential file.

Examples:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
poly login
poly login --region us
poly login --region eu
poly login --region uk
poly login --region studio
```

| Flag | Description |
| - | - |
| `--region` | Region to log in to. One of `us`, `eu`, `uk`, `studio` — see [Regions](https://docs.poly.ai/adk/reference/cli.md#regions). If omitted, you are prompted to pick one. |

## ADK key vs account API key

ADK commands authenticate with the ADK key that `poly login` saves to `~/.poly/credentials.json` for each region. CI or scripts can set `POLY_ADK_KEY`, or `POLY_ADK_KEY_<REGION>` (`POLY_ADK_KEY_US`, `POLY_ADK_KEY_EUW`, `POLY_ADK_KEY_UK`, `POLY_ADK_KEY_STUDIO`) instead.

The account API key in `POLY_API_KEY`, made by [`poly apikey`](https://docs.poly.ai/adk/reference/cli/apikey) or the developer home, is for the PolyAI APIs. The ADK does not read it, so exporting it does not log the CLI in. When no ADK key is found for a region, the command says so, names any other regions you already hold a key for, and points out when `POLY_API_KEY` is the only key set.
