# OKX

1. Log in to your OKX account.
2. Navigate to **Exchange** > **My Account** > **APIs**.
3. Click **+ Create APIs** to open a **Create APIs** page

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

Information to fill in:&#x20;

* Enter an **API name** in the field.
* In the **Account** section, select the OKX account for which you create the API key ( *Note: select the main account, not a sub-account* )
* In the **Purpose** section, select **API trading**
* In the **IP address allowlist** field, enter XAPY’s IP address [-> View Here](https://app.xapy.io)
* Select the following **Permissions** ( Read, Withdraw, Trade )
* Enter a **Passphrase** in the field ( *You need to save this passphrase to use for connecting OKX with XAPY*)

4. Click **Confirm** to generate the API key.

You have now generated and set up an API Key. You can go to XAPY platform to link your OKX account with the API key, API secret, and passphrase.

**Below is a step-by-step illustration video.**

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


---

# 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.xapy.io/integration/generate-api-key/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.
