AI Builder Program Integration Guide
Project Overview
Integrate OKX trading capabilities into your AI product. When users complete eligible trades through your product, you can earn commissions under the applicable rules—up to 50%.
The entire process takes just four steps:
Submit an application → Complete the integration → Test in demo trading → Go live
Step 1: Submit an Application
Go to the AI Builder Program application page.
Click Apply Now and select AI Builder.
Enter your project name, project URL, and a brief description.
Accept the applicable terms and submit your application. The review is expected to take one to two business days.
You can complete the installation and testing while your application is under review. When your AI Builder Code takes effect and when commission begins to accrue depend on the status shown in the dashboard and the applicable agreement.
Step 2: Integrate and Test OKX Trading Capabilities
Install the Skill
Key resources:
Integration demo:
https://github.com/okx/builder-integration-demo
API integration guide, which you can ask your agent to read:
https://github.com/okx/ai-builder-openapi-md
Choose an integration method:
Integration Type | Integration Method | Common Scenarios |
MCP | Connect OKX within an AI application that supports MCP, then invoke trading tools after authorization. | The Builder's Agent or Skill runs in an MCP Host, where users authorize access to their own OKX accounts. |
CLI | Connect an account and execute trades in a terminal using the OKX Trade CLI. | Local Agents, automation scripts, development, and testing. |
API | Users provide an API Key. After configuring the OKX API Key, the product calls OKX OpenAPI directly to execute trades. | Own-account trading, single-user strategies, and custom trading logic. |
OAuth | Users authorize OKX in the frontend, while the platform backend connects their accounts and executes trades. | Web and mobile apps, multi-user AI products, and trading platforms. |
Detailed integration instructions follow.
MCP Integration
Step 1 – Confirm tool capabilities
Choose OKX MCP order-placement tools that support the aiBuilderCode parameter, and confirm that all required trading products and operations are supported.
Step 2 – Integrate the AI Builder Code
When the Agent or Skill invokes an order-placement tool, automatically populate the aiBuilderCode parameter with the approved AI Builder Code. End users should not need to enter it manually.
Step 3 – Complete user authorization
Guide users to connect and authorize their own OKX accounts in the MCP Host or OKX Connector. Account credentials must be managed by the Host or Connector. The Builder must not access or store users' API credentials.
Step 4 – Test and verify attribution
First use demo trading to test the connection, query balances, and place a small order. Then verify that the order was filled and that the corresponding trade appears in the AI Builder dashboard.
CLI Integration
Use this option when a Builder develops and distributes local strategies, Coding Agent Skills, automation scripts, or enterprise self-hosted tools.
Step 1 – Wrap the CLI
Invoke the OKX Trade CLI from the Builder's Skill, script, or Agent, and clearly define the required market-data, account, and order-placement commands.
Step 2 – Check the attribution parameter
Use the latest CLI version that supports --aiBuilderCode, and confirm that this parameter appears in the help output for the target order-placement command.
Step 3 – Complete local account configuration
Guide users to configure an API Key Profile on their own device, VPS, or self-hosted environment, or complete CLI OAuth authorization. Account credentials must remain in the user's environment. The Builder must not access users' keys.
Step 4 – Automatically include the AI Builder Code
Automatically add the following to every order-placement command that requires attribution:
--aiBuilderCode <AI_BUILDER_CODE>
Do not substitute tag, --ai-builder-code, or any other parameter.
Step 5 – Test and verify attribution
First place a small order in demo trading. Confirm that the command executes successfully, the order is filled, and attribution appears correctly in the dashboard before preparing to go live.
API Integration
This option is suitable for Builders integrating OKX OpenAPI directly into trading bots, strategy systems, SDKs, or other products.
Step 1 – Provide an account connection flow
Ask users to create an OKX API Key after signing in at https://www.okx.com/account/my-api, then connect their account through the Builder product or their self-hosted environment. Enable only the required read and trade permissions. Do not enable withdrawal permissions.
Step 2 – Securely manage credentials
API Key, Secret Key, and Passphrase must be stored in a secure local environment or on the Builder backend, encrypted, and isolated by user. They must never be exposed in the frontend, prompts, logs, or code repositories.
Step 3 – Complete the OpenAPI integration
Follow the OKX OpenAPI documentation to implement request signing, account queries, and order placement. Use the correct API domain and endpoints for the user's OKX site.
For details, see https://github.com/okx/ai-builder-openapi-md.
Step 4 – Include the AI Builder Code
For OpenAPI order requests that support attribution, include the AI Builder Code as follows:
{
"tag": "<AI_BUILDER_CODE>"
}
When calling OpenAPI directly, use tag, not aiBuilderCode.
Step 5 – Test and verify attribution
First use demo trading to test the connection, request signing, order placement, and order execution. Then verify that the AI Builder dashboard successfully recognizes the corresponding trades.
OAuth Integration
Before You Begin
Step 1 – Open the Builder dashboard
Go to https://www.okx.com/agent-tradekit/builder to configure your OAuth and Fast API information.
Step 2 – Open Settings
Click Settings and complete the required information.
Step 3 – Complete the configuration
Enter your application name and upload an OAuth logo. This information was provided during the application process, but you can edit it here.
Enter the required URLs and OAuth authentication-exempt IP addresses. Up to 10 IP addresses are supported.
Optionally enable Fast API, enter your app name, and add the IP addresses associated with your users. Up to 200 IP addresses are supported.
Create a Fast API Key for a User
Step 1 – Obtain client_secret and client_id
Obtain your client_secret and client_id. You will use these credentials to help users create API Keys.
How do I obtain client_secret and client_id?
After confirming your email address, you will receive the corresponding passkeys.
API Key, Secret Key, and Passphrase must be stored in a secure local environment or on the Builder backend, encrypted, and isolated by user. They must never be exposed in the frontend, prompts, logs, or code repositories.
Step 2 – Complete OAuth and create the Fast API Key
After a user completes OAuth authorization, you can create a Fast API Key for them and begin using Fast API.
Step 3: Run a Small Live Test and Go Live
Before going live, confirm that:
Confirm that your AI Builder Code status in the AI Builder dashboard meets the applicable requirements. Visit https://www.okx.com/zh-hans/agent-tradekit/builder.
You are using an order-placement method that supports
aiBuilderCode. See Step 2 above for details.
When going live, first submit a small live test order, then verify the following in order:
The order was submitted successfully and was actually filled.
The dashboard recognized the trade as originating from your product. Click “More Data” to view the details.
Commission was calculated in accordance with the applicable rules.
Note:
A successfully submitted order is not necessarily filled, and a filled order does not necessarily mean that commission has been calculated.
If the dashboard does not recognize the trade, do not scale up trading volume. First check the AI Builder Code, ATK version, and order-placement method.
Joining the AI Builder Program does not guarantee that you will earn commission or that any trade will be profitable. Actual commission eligibility, rates, and amounts are subject to the AI Builder dashboard, the latest rules, and the applicable agreement.
Frequently Asked Questions
1. Who can apply to become an AI Builder, and what are the requirements?
Any individual or team building an AI-powered trading project may apply, including AI Agents, trading bots, Skill plugins, open-source tools, and data applications. Projects may apply whether they are still at the prototype stage or already have users.
2. What is the commission rate, and how is it calculated?
Commission is based on the Builder tier. Once approved, Builders receive a 35% commission rate, which can increase to as much as 50%. Commission is calculated by multiplying the net trading fees generated by eligible trades from users at VIP 3 or below by the applicable commission rate. Both new and existing users are included. For details, see the AI Builder Program Commission Rules.
3. Can I still earn AI Builder commission if an affiliate referral relationship already exists?
Yes. Eligible trades conducted through an AI Builder by users who joined through an affiliate invitation can still count toward AI Builder commission. The commission amount is calculated as the net trading fees generated by eligible trades × the applicable AI Builder commission rate. For details, see the AI Builder Program Commission Rules.
4. How long does it take from applying to earning commission?
You will receive an AI Builder Code immediately after submitting your application and can begin integration and testing right away. Once your application has been approved and the AI Builder Code has been activated, eligible trades will count toward commission, which is settled hourly.
5. How do I integrate? Do I need to change my existing trading logic?
Choose any of four integration methods: MCP (plug-and-play in AI clients), CLI (script commands), API (users connect with an API Key), or OAuth (users authorize through OKX). Official AI Skills and demos are available to help you integrate quickly, and OKX authorization is supported. You only need to include your AI Builder Code in trading calls; no changes to your strategy or trading logic are required.
6. When will I receive commission, and how is it settled?
Commission is settled automatically every hour (T+1 hour) and distributed in USDT to the account linked to the AI Builder Code. The dashboard shows each attributed trade and its commission details in real time.