How to Connect AI to OKX Agent Trade Kit? Permissions, Testing, and Deactivation

 / 
OKX
 / 
2

There are two ways to connect Agent Trade Kit: One-Click Quick Connect (recommended for users unfamiliar with API Keys) and API Key installation (suitable for users who need fine-grained control over permissions). The core difference between the two methods lies in the granularity of permission granting: One-Click Quick Connect determines the permission scope when authorizing in the browser, while API Key mode decides permissions when creating the Key, and can be verified on the demo trading environment first.

OKX Exchange
A leading global cryptocurrency platform,suitable for both beginners and experienced traders.
New user benefit: 20% off trading fees upon registration!!

One-Click Quick Connect: Authorization Scope Determined in Browser

One-Click Quick Connect does not require you to manually generate an API Key. The process is: initiate a connection request in the AI client, a browser pop-up opens the OKX login page, you check the permission scope you want to grant to the AI, and confirm to complete the connection.

Currently, three types of permissions can be freely combined: Read, Trade, and Earn. If you only check the Earn permission, the AI can only perform Earn-related operations and cannot touch trading. After authorization, if it is not used for 7 days, it will automatically expire. All authorizations can be viewed and revoked on the "Third-Party Authorization Management" page on the OKX official website.

Taking OpenClaw as an example, the operation is to enter the installation command in the dialog box, trigger login authorization, then confirm the configuration on the web page, and finally return to OpenClaw to confirm once more for it to truly take effect. The configuration paths for clients such as Claude Desktop and Cursor are different, but the core process is the same: configure the OKX MCP URL in the AI client, authorize in the browser, and complete the connection.

API Key Installation: Permissions Decided When Creating the Key

If you choose API Key mode, the first step is to apply for a Key. OKX supports demo trading API Keys. All tools are available, but they operate with virtual funds and will not touch your real account.

After applying, you will get three strings: API Key, Secret Key, and Passphrase. The Secret Key and Passphrase are displayed only once. After closing the page, you cannot view them again, so you need to store them in a safe place immediately.

When creating the Key, only enable "Read" and "Trade" permissions. The official guidance clearly recommends that you do not need to and should not enable withdrawal permissions. If you create a separate sub-account for the AI, even if something goes wrong, the scope of impact remains controllable.

The Key configuration is written to the local ~/.okx/config.toml file and does not need to be pasted into the AI conversation. The AI never has access to your secret keys; signing is completed locally.

Test the Process with Demo Trading First

No matter which connection method you use, your first configuration should use the demo trading environment. Demo and live trading are two separate profiles in the configuration: default_profile = "demo" corresponds to demo trading, and live corresponds to real trading. If your configuration defaults to demo but you want to operate real trading, you need to explicitly specify --profile live in the startup parameters.

The path to obtain a demo trading API Key is: OKX official website → Trade → Demo Trading → API Management. This Key is independent of the live trading Key.

The way to verify on demo trading is simple: after configuration is complete, ask "What is the price of ETH now?" in the AI client. If it returns a price, the connection is normal. After confirming that data reading works, test trading operations, such as placing a spot buy order on the demo trading environment to see if the AI executes it correctly.

Next Steps After Trial Orders

After the strategy logic works on demo trading, switch to live trading. The switching method depends on your connection method: One-Click Quick Connect checks live trading permissions during authorization; API Key mode requires an additional live profile configured with a live trading Key.

During the live trading phase, it is recommended to start with small amounts. OKX official risk notice explicitly states: "testing with small amounts before scaling". First use funds that you can completely afford to lose to verify whether the AI's behavior in a real market environment is consistent with demo trading, including order execution speed, slippage, and exception handling.

Deactivation: Revoke Authorization and Delete Keys

If you connected via One-Click Quick Connect, the deactivation method is to go to the OKX official website → Third-Party Authorization Management page, find the corresponding authorization, and click Revoke.

If you connected via API Key, the deactivation method is to go to the OKX API management page and delete the corresponding Key. It is also recommended to clear the credential information in the local configuration file.

Regardless of the method, after deactivation, the AI can no longer access your OKX account. If you only want to pause trading permissions and keep data reading, API Key mode allows you to create a read-only Key (--read-only parameter), so the AI can only query data and cannot place orders.

Permission Boundaries and Risk Warnings

What Agent Trade Kit can do is limited by your OKX account itself. If your account cannot trade futures due to regional or type restrictions, Agent Trade Kit cannot bypass those restrictions.

AI-generated trading instructions may cause actual losses due to model errors, outdated information, delays, or market fluctuations. The official risk notice states: "AI-related activities may result in the total loss of your invested assets".

Local operation is the core of the security design. API Keys are stored in local files, signing is completed locally, and the AI is only responsible for generating trading intent. However, even so, if you paste the Key content directly into the AI conversation, this protection becomes invalid. Do not tell the AI your Key in the conversation.

OKX Exchange
A leading global cryptocurrency platform,suitable for both beginners and experienced traders.
New user benefit: 20% off trading fees upon registration!!

References

  1. OKX·What is Agent Trade Kit?, page published or updated: 2026-04-28, 2026-08-26; verified: 2026-09-24.
  2. OKX·2-2 Connecting Your AI to OKX Exchange (One-Click Quick Connect), page published or updated: 2026-04-26; verified: 2026-09-24.
  3. OKX·2-2 Connecting Your AI to OKX Exchange (API Configuration), page published or updated: 2026-04-26; verified: 2026-09-24.
  4. GitHub·agent-trade-kit FAQ, page published or updated: 2026-03-02; verified: 2026-09-24.
  5. Ledgible·OKX Agent Trade Kit Launches "One-Click Quick Connect" Feature, page published or updated: 2026-05-07; verified: 2026-09-24.
  6. OKX·Connecting Agentic Trading to OKX Exchange with Agent Trade Kit, page published or updated: 2026-03-09, 2026-06-02; verified: 2026-09-24.
  7. GitHub·okx-agent-trade-kit Configuration Guide, page undated; verified: 2026-09-24.
  8. OKX·Agent Trade Kit Official Developer Documentation, page undated; verified: 2026-09-24.