# How to Switch from Alchemy Key to Infura Key Using CLI

1. **Select Network**: When you open the CLI, you'll see a screen like this, select `base`:

[![Mining CLI](https://github.com/InternetMaximalism/intmax2-mining-cli/raw/main/assets/infura/b1.png)](https://github.com/InternetMaximalism/intmax2-mining-cli/blob/main/assets/infura/b1.png)<br>

2. **Modify Option**: After selecting `base`, you'll see a screen like this:

[![Mining CLI](https://github.com/InternetMaximalism/intmax2-mining-cli/raw/main/assets/infura/b2.png)](https://github.com/InternetMaximalism/intmax2-mining-cli/blob/main/assets/infura/b2.png)<br>

If you choose to encrypt your password during setup, you'll be prompted to enter it. This step is optional and won't appear if you didn't set a password.<br>

3. **Modify API Key**: Type `y` to change Api Key.

[![Mining CLI](https://github.com/InternetMaximalism/intmax2-mining-cli/raw/main/assets/infura/b3.png)](https://github.com/InternetMaximalism/intmax2-mining-cli/blob/main/assets/infura/b3.png)<br>

4. **Select Infura**: Select `Infura`.

[![Mining CLI](https://github.com/InternetMaximalism/intmax2-mining-cli/raw/main/assets/infura/b4.png)](https://github.com/InternetMaximalism/intmax2-mining-cli/blob/main/assets/infura/b4.png)<br>

5. **Select Infura**: Enter your new API key which you obtained from [How to get your Infura API key](https://github.com/InternetMaximalism/intmax2-mining-cli/blob/main/docs/infura-guide.md#how-to-get-your-infura-api-key) guide above.

[![Mining CLI](https://github.com/InternetMaximalism/intmax2-mining-cli/raw/main/assets/infura/b5.png)](https://github.com/InternetMaximalism/intmax2-mining-cli/blob/main/assets/infura/b5.png)<br>

Note: Copy just the API key.

[![Mining CLI](https://github.com/InternetMaximalism/intmax2-mining-cli/raw/main/assets/infura/b6.png)](https://github.com/InternetMaximalism/intmax2-mining-cli/blob/main/assets/infura/b6.png)<br>

Note that your API key will not be displayed. Press `Enter` after pasting it.<br>

[![Mining CLI](https://github.com/InternetMaximalism/intmax2-mining-cli/raw/main/assets/infura/b7.png)](https://github.com/InternetMaximalism/intmax2-mining-cli/blob/main/assets/infura/b7.png)<br>

To modify other options such as the gas price or withdrawal address, type `n`.

You can also choose to encrypt your private key by setting a password. Encryption is highly recommended for security. Press `y` or `Enter` to encrypt the private key, or `n` to save it as plain text.<br>

6. **Continue Mining Activity**: The API key has been successfully switched from Alchemy to Infura. You can now proceed with the mining options.

[![Mining CLI](https://github.com/InternetMaximalism/intmax2-mining-cli/raw/main/assets/infura/b8.png)](https://github.com/InternetMaximalism/intmax2-mining-cli/blob/main/assets/infura/b8.png)


---

# 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://intmax-general.gitbook.io/intmax-privacy-mining/intmax-cli-mining/infura-guide/how-to-switch-from-alchemy-key-to-infura-key-using-cli.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.
