> For the complete documentation index, see [llms.txt](https://robotrade-ai.gitbook.io/untitled/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://robotrade-ai.gitbook.io/untitled/guides/api-key-setup-example.md).

# API Key Setup Example

Using API keys to integrate a CEX with our trading bot enhances your trading capabilities while maintaining security. Always handle API keys with care, and ensure you understand the permissions you're granting.

**Step 1: Log in to Your Kraken Account**

* Navigate to the [Kraken website](https://www.kraken.com/) and log in to your account.

**Step 2: Access API Management**

* Once logged in, find the **"Security"** or **"API"** section in your account settings. This is usually found under your account menu or in the settings area.

<figure><img src="/files/qbjo56HNyYDB4KI1Q5IQ" alt=""><figcaption></figcaption></figure>

**Step 3: Create a New API Key**

* In the API section, click on **"Add Key"** or **"Create New Key"**.
* You might need to go through additional security checks (like 2FA) to proceed.

<figure><img src="/files/6Kna9lDT0HD4zskIZdps" alt=""><figcaption></figcaption></figure>

**Step 4: Configure Your API Key**

* **Key Description**: Enter a name for your API key. This is just for your reference.
* **Key Permissions**: Select the permissions you want to grant. For trading bots, you typically need permissions like query funds, query open orders and trades, and manage orders. **DO NOT ENABLE WITHDRAWLS.**
* **Key Restrictions**: Do not restrict IP address so our bot can access it.

<figure><img src="/files/DSfdQ6ZsSKKXNldT2ssc" alt=""><figcaption></figcaption></figure>

**Step 5: Generate the API Key**

* Once you have configured your settings, click on **"Generate Key"**.
* You will be presented with an **API Key** and **Private Key**. Copy these and store them securely.

**Step 6: Secure Your Keys**

* Never share your API keys or private keys publicly.
* Store them in a secure location.

#### **Integrating the API Key with Robotrade**

**Step 1: Access Strategy Setup On Our Bot**

* Use the /start command on Robotrade and add a new strategy. Checkout the [/start page](https://docs.robotrade.ai/guides/start) of our documentation for help.

**Step 2: Enter API Key Details**

* In the relevant fields, enter the **API Key** and **Private Key** that you generated from Kraken.

**Step 4: Start Trading**

* Once the buy or sell conditions are met, trades will be placed through your API key and exchange account.

#### **Tips for Secure API Key Management**

* Regularly monitor your API activity for any unauthorized access.
* Consider updating or rotating your API keys periodically.
* Ensure your computer and network are secure.

#### **Troubleshooting Common Issues**

* **Invalid Key Error**: Double-check that you copied the API Key and Private Key correctly.
* **Permission Denied**: Make sure you selected the correct permissions when creating the API key.
* **Connection Issues**: Verify your internet connection and if Kraken's API is operational.
