# OKX

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

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

<figure><img src="/files/qU2LF3vdGfjBlTxyt8x3" alt=""><figcaption><p>Click the "Create sub-accounts" button</p></figcaption></figure>

&#x20;Name and configure the sub-account

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

Create an API Key for this sub-account

<figure><img src="/files/5K7KDPEddf9qoArxOgVq" alt=""><figcaption><p>From the sub-accounts page, choose "Manage API" from the "Action" menu</p></figcaption></figure>

<figure><img src="/files/V8q26xwUpNFkML3NAFHP" 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="/files/uUx8am2UCK922BFTtmlr" 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="/files/Xt7UvXB3PDW5Pkk5168i" 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="/files/TkMJ1FC06qaUWpywkIXr" 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>


---

# 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://docs.tread.fi/account-creation-and-api-key-connection/connecting-to-exchanges/okx.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.
