> For the complete documentation index, see [llms.txt](https://docs.tread.fi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tread.fi/account-creation-and-api-key-connection/connecting-to-exchanges/okx.md).

# OKX

{% embed url="<https://youtu.be/hKvlD0sdoi4?si=0pYqDXf2lIOjKe5->" %}

### Create a sub-account from the Sub-accounts page.

<figure><img src="https://content.gitbook.com/content/zGueudbPNYpRWNpS3Ilo/blobs/MPzstGbsvkOlm6S72MK5/Screenshot%202024-08-05%20at%2012.07.07%E2%80%AFPM.png" alt=""><figcaption><p>Click the "Create sub-accounts" button</p></figcaption></figure>

&#x20;Name and configure the sub-account

<figure><img src="https://content.gitbook.com/content/zGueudbPNYpRWNpS3Ilo/blobs/j2N0ou2v0YGcr9mLDgwm/Screenshot%202024-08-05%20at%2012.07.43%E2%80%AFPM.png" alt=""><figcaption></figcaption></figure>

Create an API Key for this sub-account

<figure><img src="https://content.gitbook.com/content/zGueudbPNYpRWNpS3Ilo/blobs/7DF8otm2hCr1aA2autIc/Screenshot%202024-08-05%20at%2012.08.35%E2%80%AFPM.png" alt=""><figcaption><p>From the sub-accounts page, choose "Manage API" from the "Action" menu</p></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/zGueudbPNYpRWNpS3Ilo/blobs/3FbA41LPWjIT4bxC19Mv/Screenshot%202024-08-05%20at%2012.08.49%E2%80%AFPM.png" alt=""><figcaption><p>Click the "Create API" button</p></figcaption></figure>

In the Create APIs page, choose the sub-account you just created, making sure the Purpose is set to "API trading" and it has `Read` and `Trade` permissions.  Add your TaaS server's IP address to the allowlist.

<figure><img src="https://content.gitbook.com/content/zGueudbPNYpRWNpS3Ilo/blobs/lc5nsao3j5QFSpRKugDH/Screenshot%202024-08-05%20at%2012.21.37%E2%80%AFPM.png" alt=""><figcaption></figcaption></figure>

Use this API key in TaaS to [connect](/account-creation-and-api-key-connection/connecting-to-exchanges.md) to OKX.

### Linking Your API Key to tread.fi&#x20;

<figure><img src="https://3498068627-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzGueudbPNYpRWNpS3Ilo%2Fuploads%2FQjn3qziXZVYwn2SYYWCq%2FScreenshot%202568-08-04%20at%2022.40.36.png?alt=media&amp;token=61c29b3e-0cdf-499d-9940-289d8292d81f" alt=""><figcaption></figcaption></figure>

* Open up tread's Key Management menu. From the app.tread.fi home page, it can be accessed by clicking on the wallet icon on the top right.
* Click Connect CEX Account

<figure><img src="https://3498068627-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzGueudbPNYpRWNpS3Ilo%2Fuploads%2FuPq60zzE2nLHxxu2ufQ1%2FScreenshot%202568-11-27%20at%2010.12.14.png?alt=media&amp;token=523a1619-422e-44c2-afed-aaf3a9f47d6b" alt=""><figcaption></figcaption></figure>

* Select OKX from the Exchange dropdown
* Set a name for this key for your own reference.
* Copy and Paste the API Key and Secret from OKX into the respective boxes.
* Click submit.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcxPKL5LuLWoy8DhaDHamKZHxvlg_XxfPWItdQAsszl7-i0PaGiYD1VCKxBeewjJBQUxbITppwpIrG5JuE6TM_I9P4BPOEM7eijX6gi6DPdUrhHYBW1QDER5NuRZEBfkap2GxjrOICcVywn-NCJS7Oe01XN?key=0Y_t4MkkxDXunkOK3-fvXw" alt=""><figcaption></figcaption></figure>

<br>
