# Creating an OKX API Key

{% 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 link can also be found in your settings menu, click on accounts then the OKX tab. You can click on the button that states "OKX API Keys"

<figure><img src="/files/OdCsvybTRZZ8lJlkqvfD" 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="/files/Tlduhz4HOCAecGwctKcR" 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="/files/M09epJBCnj6ztclpfMs1" 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="/files/bkEOj8AP58uIlLEBb0y4" 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="/files/8K60ORpcNKUz5xMgN0hn" alt=""><figcaption></figcaption></figure>

In the Terminal proceed to the 'Settings' section. 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.

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

{% 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="/files/rzgUl7gQLOPs7VjtkgOy" 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.167.89.125,18.167.8.216,43.198.26.42,18.166.216.236,18.163.207.89,43.198.196.202,43.198.149.125,43.198.214.66,18.167.53.222,18.166.252.235,16.163.177.207,18.167.243.99,18.167.32.21,18.166.224.0,18.166.106.248,18.162.176.190,16.163.65.4,18.167.188.106,16.163.19.198,18.167.49.196
```

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


---

# 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.insilicoterminal.com/documentation/setup/creating-an-api-key/creating-an-okx-api-key.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.
