# Authenticate with the Python SDK

You can authenticate with the Python package using:

* A command, or;
* A `login()` method.

### Authenticate with the CLI

To authenticate with the Python SDK using the command line, run:

```
roboflow login
```

You will then be given a URL to which you can go to issue a Token.

You will be asked to select a workspace, then given a token for use in the Python package or CLI.

This Token will then be used to saved to your computer for use in authenticating with the Roboflow API through the Python Package.

To reauthenticate, run `roboflow login` again.

### Authenticate with the SDK

You can also authenticate with the SDK using the `roboflow.login()` method.

To authenticate with this method, add the following line of code after you import the `roboflow` Python package into a script:

```
roboflow.login()
```

You will then be given a URL to which you can go to issue a Token.

You will be asked to select a workspace, then given a token for use in the Python package or CLI.

This Token will then be used to saved to your computer for use in authenticating with the Roboflow API through the Python Package.

If you want to change accounts, you will need to reauthenticate. You can reauthenticate using the following command:

```
roboflow.login(force=True)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.roboflow.com/developer/python-sdk/authenticate-with-the-python-sdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
