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

# Authentication

> Log in with your browser or an API key, choose which organization your runs use, and target the US or EU.

Log in once per machine and the ade CLI remembers you. Pick the path that fits where you are:

* At a terminal with a browser, run `ade login`. This is the simplest path.
* Without a browser, log in with an API key.
* Without a terminal, such as a continuous integration (CI) pipeline or an AI agent, set the `ADE_API_KEY` environment variable.

## Log In with Your Browser

Run `ade login` to open your browser and authenticate with your [ADE account](https://ade.landing.ai/). The ade CLI stores the credential and refreshes it as needed. If it reports that the session is unusable, run `ade login` again.

```bash theme={null}
ade login
```

If you belong to more than one organization, the CLI asks which one to use, and runs consume credits from the organization you choose. If you belong to only one, the CLI selects it for you. To choose without answering a prompt, name the organization with `--org`.

```bash theme={null}
ade login --org "Acme Research"
```

## Log In with an API Key

Use an API key when you have no browser to log in with. A key always acts in the organization it was created in, so there is nothing to choose. Create a key in your [account settings](https://ade.landing.ai/settings/api-key).

Then log in. The CLI prompts you for the key, and shows no characters as you type or paste it.

```bash theme={null}
ade auth login --api-key -
```

## Run Without a Terminal

In CI, cron, or an AI agent harness, authenticate with an API key. Two ways work, and they differ in whether the key is stored on the machine:

* Set the `ADE_API_KEY` environment variable. The key is never written to disk, and it overrides any stored credential. Use this unless you need the key to persist.
* Pipe the key into login. The CLI stores it, exactly as the prompt would.

```bash theme={null}
export ADE_API_KEY="$YOUR_KEY"      # not stored
echo "$YOUR_KEY" | ade auth login   # stored
```

## View and Change Organizations

These commands apply to browser logins. To see the organizations you belong to and which one is selected, list them. The list is read live, so a change to your access shows up immediately.

```bash theme={null}
ade auth org list
```

To point later runs at a different organization, switch to it by ID or name. Switching needs no browser and no new login. Clearing the selection falls back to your account's default organization.

```bash theme={null}
ade auth org switch "Acme Research"
ade auth org clear
```

## Work Across Environments

There is no "current environment" to switch. Every command resolves its target fresh: the `--env` flag if given, else the `ADE_ENV` variable, else `production`. To make one shell sticky, export the variable there (`export ADE_ENV=eu`) while other shells keep working against production.

API keys are region-specific, so a US key does not work in the EU. The CLI stores credentials per environment for the same reason, and job items are per-environment too: a parse run in the EU never serves a production request. For more about using ADE in the EU, see [European Union (EU)](/dpt3/eu).

| Environment            | Endpoint                               |
| ---------------------- | -------------------------------------- |
| `production` (default) | `https://api.ade.landing.ai`           |
| `eu`                   | `https://api.ade.eu-west-1.landing.ai` |

## Check Your Authentication Status

To see which environment you are targeting, which organization a browser login acts in, and where else you hold credentials:

```bash theme={null}
ade auth status
```

## Log Out

By default, logging out clears the credential for the environment you are targeting. Add `--env` to name a different one, or `--all` to clear every environment at once.

```bash theme={null}
ade auth logout
```
