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

# Platform mode vs. legacy mode

> Understand the difference between Landbase platform mode (the default) and legacy mode, and when you might need to switch between them.

# Platform mode vs. legacy mode

landbase-cli supports two authentication and routing modes. Most users will never need to think about this distinction — platform mode is the default and is the right choice for almost everyone. This page explains what changed and when legacy mode is relevant.

***

## Platform mode (default)

In platform mode, landbase-cli routes requests through the Landbase cloud gateway at `api.landbase.com`. Authentication uses an OAuth session — you log in via browser and a short-lived token is stored in `~/.landbase/platform.json`.

Credentials in platform mode:

* Session token prefix: `lbs_`
* Stored at: `~/.landbase/platform.json`
* Created by: `landbase-cli auth login` (browser OAuth)

Platform mode is the default. It is enabled automatically unless you have set `LANDBASE_LEGACY_MODE=1`.

***

## Legacy mode

Legacy mode connects directly to the AgentOS backend, bypassing the cloud gateway. Authentication uses long-lived API keys.

Credentials in legacy mode:

* API key prefix: `lbk_`
* Stored at: `~/.landbase/config.json`
* Created by: `landbase-cli auth login --key`

To enable legacy mode:

```bash theme={null}
export LANDBASE_LEGACY_MODE=1
```

To disable it:

```bash theme={null}
unset LANDBASE_LEGACY_MODE
```

***

## Who should use legacy mode?

Legacy mode exists for backward compatibility. You might need it if:

* You have an existing automation using a `lbk_` API key and cannot migrate yet
* You have been explicitly instructed by Landbase support to use it for a specific integration
* You are running a version of landbase-cli that predates platform mode

If you are starting fresh, use platform mode.

***

## How to check which mode you are in

```bash theme={null}
landbase-cli auth status
```

The output will indicate whether you are authenticated via platform session or API key, and which base URL is being used.

***

## What changes between modes

|             | Platform mode               | Legacy mode               |
| ----------- | --------------------------- | ------------------------- |
| Auth method | OAuth (browser)             | API key                   |
| Token type  | `lbs_*`                     | `lbk_*`                   |
| Config file | `~/.landbase/platform.json` | `~/.landbase/config.json` |
| Base URL    | `api.landbase.com`          | AgentOS direct            |
| Enable with | Default                     | `LANDBASE_LEGACY_MODE=1`  |

***

## Related

* [How to troubleshoot authentication](/docs/how-to/troubleshoot-auth)
* [environment variables reference](/docs/reference/env-vars) — `LANDBASE_LEGACY_MODE` and related vars
