# Connect CEX API

**Connect CEX API** allows you to link your centralised exchange (CEX) account to Tsunammi using API keys. Once connected, you can automatically top up your wallet pools directly from your CEX balance via the **Distribute Funds from CEX** section.

***

### Getting Started

If no CEX is connected yet, the page shows a **No CEX API connected** state. Click **Add new API** to connect your first exchange.

***

### Adding a New API Connection

Click **Add new API**. A modal window opens with two panels:

* **Left panel** — form for entering your API credentials
* **Right panel** — step-by-step instructions specific to your chosen exchange

#### Connection Form

| Field                  | Description                                             |
| ---------------------- | ------------------------------------------------------- |
| **Your title for CEX** | A custom label for this connection (e.g. `KuCoin Main`) |
| **CEX**                | Select your exchange (e.g. KuCoin)                      |
| **API Key**            | Public API key from your exchange account               |
| **API secret key**     | Secret key from your exchange account                   |
| **API passphrase**     | Passphrase required by some exchanges (e.g. KuCoin)     |

Once all fields are filled in, click **Import**.

***

### KuCoin Setup Guide

> The instructions panel on the right side of the modal updates automatically based on the selected exchange.

**IP address to whitelist:** `68.183.69.115` Add this IP to the allowed list in your exchange API settings.

#### Step 1. Log In

Open KuCoin and navigate to **API Management** from your profile menu.

#### Step 2. Create an API Key

* Click **Create API** → **Create API Key**
* Fill in:
  * **API Name** — any name (e.g. `Trading Bot`)
  * **Passphrase** — create one and save it together with your API Key and Secret
* Set permissions:
  * Enable General
  * Enable Withdraw

#### Step 3. Save Your Credentials

After creation, KuCoin will display three values — shown only once:

* API Key
* Secret Key
* Passphrase

> ⚠️ **Secret Key and Passphrase are shown only once.** Copy and store all three values in a secure location before closing the window.

#### Step 4. Connect Your Account

Return to Tsunammi, fill in all three credential fields, and click **Import**.

***

### Tips

* **Minimum permissions** — for Tsunammi, only `General` and `Withdraw` permissions are required. Do not grant unnecessary permissions such as spot or futures trading.
* **IP Whitelist** — add IP `68.183.69.115` to your exchange whitelist, otherwise API requests will be blocked.
* **Multiple exchanges** — you can connect several APIs from different exchanges and select the one to use when distributing funds.
* **Security** — never share your API keys with third parties. If your keys are compromised, delete them on the exchange immediately and generate new ones.


---

# 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://tsunammi.gitbook.io/tsunammi/wallet-management/connect-cex-api.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.
