# OKX

## Step 1: Generate an API key in your OKX account

1. Login to your OKX account and click on the user icon in the menu bar
2. Select API from the dropdown menu
3. Choose the account you want to create API keys for
4. Click Create API Keys
5. Select **API trading** as the Purpose, name the API and enter a Passphrase.
6. Set the Permissions of the API key to *<mark style="background-color:orange;">"Read: Allows the API to request and view account info such as bills and history."</mark>*
7. Complete the two-factor authentication in order to enable the API key
8. Once complete, a screen will popup with your API key and Secret key. **Save this in a secure place.**

<figure><img src="https://3061199926-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ft1fkaxq4yvhcAFiQKv7R%2Fuploads%2Fgo4FRmdivHL8l1fMcTlc%2Fphoto_2024-08-08%2015.39.24.jpeg?alt=media&#x26;token=0e8343ad-fa99-4279-9172-889987a69aac" alt=""><figcaption><p>Create an API key in OKX</p></figcaption></figure>

## Step 2: Add your OKX account to Integral

1. Login to your Integral account and click on Wallets -> `+Add Wallets/Accounts`
2. Select Crypto Exchanges & Custodians -> OKX
3. Paste in your API Key, Passphrase and Private Key
4. Click `Sync`

<figure><img src="https://3061199926-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ft1fkaxq4yvhcAFiQKv7R%2Fuploads%2FMzXvgRrKOICnhgbJEbSv%2Fimage.png?alt=media&#x26;token=e096b777-dd80-4edd-8c46-728b1fec6377" alt=""><figcaption><p>Connect your OKX account to Integral</p></figcaption></figure>

It may take a few minutes for all your transactions to load into Integral. You can see transactions trickle in from the [Bookkeeping](https://app.integraltreasury.xyz/accounting?category=for-review\&page=1) page. Transactions are done loading when your Unrealized Gain/Loss and Transaction Count appear in the Treasury page.

## FAQ

<details>

<summary>Do I need to create a Sub-Account in OKX to create an API Key?</summary>

No, you can create an API Key for your main account *or* a sub-account in OKX.

</details>
