> For the complete documentation index, see [llms.txt](https://docs.insilicoterminal.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.insilicoterminal.com/documentation/setup/creating-an-api-key/creating-an-okx-api-key.md). Agents can also search and read this documentation through its [MCP server](https://docs.insilicoterminal.com/documentation/~gitbook/mcp).

# Creating an OKX API Key

Watch our instructional video or follow the steps below:

{% embed url="<https://www.youtube.com/watch?v=lbfe9FtJNHw>" %}

In order to add an OKX account you will firstly need to create an account by clicking here: <https://www.okx.com/join/73702724>

"The Terminal's OKX form also has **SIGN UP** and **API KEYS** buttons that open OKX."

<figure><img src="https://1855557010-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuzWZkA5631kraBpRETyN%2Fuploads%2F8Rvpnqm9jxwyYOg6tKkO%2Fconnect-okx.png?alt=media&amp;token=75649981-ad00-4a4e-a81c-7c6394b29d77" alt=""><figcaption></figcaption></figure>

Click on the user-icon in the upper right corner to open a drop-down menu.

Select **API keys**.

<figure><img src="https://1855557010-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuzWZkA5631kraBpRETyN%2Fuploads%2FOdsO1M28j9C5r0J3HfpQ%2Fscreenshot%202023-09-04%20um%2012.04.44.png?alt=media&amp;token=3f116555-f5dd-4557-8f6a-855e389a80db" alt=""><figcaption></figcaption></figure>

Choose if you want to create the API key for your main account or a sub account.

Click on **Create V5 API key**.

<figure><img src="https://1855557010-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuzWZkA5631kraBpRETyN%2Fuploads%2FVG0MaEpuPYELS0TiyTn2%2Fscreenshot%202023-09-04%20um%2012.10.08.png?alt=media&amp;token=97ea9edb-3be2-4636-868f-2f222775a0e9" alt=""><figcaption></figcaption></figure>

In the next form, select **Linking thirt-party apps** and select **Insilicoterminal.** In doing so the API key will automatically be restricted to the IP addresses of the Terminal.

Enter a name for the API key.

Enter a Passphrase. **Make sure to retain your passphrase for the API key**, as it will be required when adding to the Terminal.

Enable **Trade** for the Permissions.

Click on Confirm. You will be asked for a verification code / 2FA .

&#x20;

<figure><img src="https://1855557010-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuzWZkA5631kraBpRETyN%2Fuploads%2Fnn7gm1VdbR7MmMHuzm4P%2Fscreenshot%202023-09-04%20um%2012.13.51.png?alt=media&amp;token=dad86e12-1a6c-4bcf-b8f0-9567212c2535" alt=""><figcaption></figcaption></figure>

From the next menu you can now copy your generated **API key** and the **Secret key** and add it to the Terminal.&#x20;

<figure><img src="https://1855557010-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuzWZkA5631kraBpRETyN%2Fuploads%2FIsDEs39JqM4li8iPCiVd%2Fscreenshot%202023-09-04%20um%2012.35.26.png?alt=media&amp;token=0ffde8b1-dd8f-452a-aafe-0d36b667c73e" alt=""><figcaption></figcaption></figure>

"In the Terminal, open **Add an account** and select **OKX**." From there, navigate to the 'Account' tab, where you will be welcomed by a screen as seen below. Choose a name for the account, input the **API key** and the **Secret key** into the respective fields and ensure that you include the **Passphrase** you generated.

{% hint style="warning" %}
Please make sure to set your OKX "Account mode" to Futures or Advanced mode  in your trading settings.
{% endhint %}

<figure><img src="https://1855557010-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuzWZkA5631kraBpRETyN%2Fuploads%2Fc84BQev0dwR4kynd8q7P%2Fscreenshot%202025-11-18%20at%2015.15.13.png?alt=media&amp;token=1b90e7d3-8306-4ba9-89bd-33b80b489f1a" alt=""><figcaption></figcaption></figure>

### IP Access Restrictions \[Optional]

If you want to manually set up the API key for the Terminal in OKX (by setting up a general API key and not one which is linked to a third-party app), you will need to whitelist the IP addresses of our Terminal servers. You may copy and paste all the IP addresses provided below:

```
18.180.195.116,13.114.235.19,18.181.102.105,35.75.215.133,54.65.212.219,52.196.177.46,35.76.223.130,35.77.250.223,18.180.239.100,3.113.78.104,18.181.158.39,54.65.86.241,52.199.152.174,54.250.232.158,52.69.38.104,54.64.139.96,52.194.90.124,13.113.149.88,52.199.229.99,43.206.9.80
```

{% hint style="info" %}
**Make sure you copy all the IP addresses, there should be 20 in total!**
{% endhint %}
