> 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

Setting Up an API Key on Kraken (similar for other CEXs)

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="https://1622618539-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fu5MsmgByOphqxTTWOcAG%2Fuploads%2FkBVOWZnYthcwsBP1ogFj%2Fsettings.PNG?alt=media&amp;token=f9baa09f-b639-4f52-b8b8-31fb023e9949" 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="https://1622618539-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fu5MsmgByOphqxTTWOcAG%2Fuploads%2FxDa37RoIh0jKkfA3EnCL%2Fapi.PNG?alt=media&amp;token=41c201de-0cfb-4835-b25c-92b37930c145" 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="https://1622618539-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fu5MsmgByOphqxTTWOcAG%2Fuploads%2F3jxXIThmIiW6BAbKuHin%2Fkraken.PNG?alt=media&amp;token=45273746-a3e3-436c-9f92-e2866c84b504" 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.
