---
title: "Authentication"
description: "If you use any commands which interact with the cloud, you must log in using your QuantConnect account so the CLI can send authenticated API requests."
canonical: https://www.quantconnect.com/docs/v2/lean-cli/initialization/authentication
markdown: https://www.quantconnect.com/docs/v2/lean-cli/initialization/authentication.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/05%20Lean%20CLI/03%20Initialization/01%20Authentication
modified: 2026-10-29
index: https://www.quantconnect.com/llms.txt
---

# Authentication

[Documentation](https://www.quantconnect.com/docs/v2.md) > [Lean CLI](https://www.quantconnect.com/docs/v2/lean-cli.md) > Initialization > Authentication

> Code examples are shown in Python. Append `?lang=csharp` to this URL for the C# version of this page.

## Introduction

Most of the Lean CLI commands need to communicate with the QuantConnect API. If you use any commands which interact with the cloud or [deploy a live algorithm locally](https://www.quantconnect.com/docs/v2/lean-cli/live-trading/brokerages.md), you must log in using your QuantConnect account so the CLI can send authenticated API requests.

To use the CLI, you must be a member in an [organization](https://www.quantconnect.com/docs/v2/cloud-platform/organizations/tier-features.md) on a paid tier.

## Log In

Follow these steps to log in to your QuantConnect account with the CLI:

1. [Request your user-id and API token](https://www.quantconnect.com/docs/v2/cloud-platform/community/profile.md#09-Request-API-Token).
2. Retrieve your user-id and API token from the email you registered on QuantConnect.
3. Run `lean login` to log in to the CLI, and enter your user-id and token when prompted. This command opens an interactive wizard asking you for your user-id and API token.

   ```
   $ lean login
   Your user Id and API token are needed to make authenticated requests to the QuantConnect API
   You can request these credentials on https://www.quantconnect.com/account
   Both will be saved in C:\Users\john\.lean\credentials
   User id: 123456
   API token: ******************
   Successfully logged in
   ```

## Log Out

Run `lean logout` to log out. This command removes the [global configuration file](https://www.quantconnect.com/docs/v2/lean-cli/initialization/configuration.md#02-Global-Configuration) containing your user Id and API token.

## Check Account Status

Run `lean whoami` to see the name and email address of the user who is currently logged in.
