Welcome to the comprehensive guide for integrating with the OKX Broker API, designed for platforms offering digital asset services such as trading bots, copy trading systems, quantitative strategies, and asset management solutions. By becoming an OKX Broker partner, you can leverage powerful API tools, earn generous commission rebates of up to 50%, and access advanced features tailored for institutional and third-party platforms.
This guide walks you through the full integration process—from application and authentication to commission tracking and data retrieval—with clear technical documentation and best practices.
How to Apply as an OKX Broker
If your platform provides cryptocurrency trading or investment services, you're eligible to join the OKX Broker Program. As a broker partner, you’ll gain access to exclusive tools and earn commissions based on your users’ trading activity on OKX.
Eligible business types include:
- Aggregated trading platforms
- Automated trading bots
- Copy trading systems
- Quantitative strategy providers
- Asset management platforms
Once approved, you'll receive dedicated technical documentation and product support to help you integrate smoothly.
👉 Start your broker application today and unlock powerful trading integrations.
Setting Up Commission Tracking via API
To ensure accurate commission attribution, all API requests must include your unique Broker Code in the tag parameter when placing orders on behalf of users.
Why the tag Parameter Matters
When a user places a trade through your platform:
- Include your Broker Code in the
tagfield. - This links the order to your account for commission calculation.
- Without this tag, no commission will be credited.
✅ Example: When using /api/v5/trade/order, make sure the request body includes:
{
"instId": "BTC-USDT",
"ordType": "market",
"side": "buy",
"sz": "0.01",
"tag": "YOUR_BROKER_CODE"
}This simple step ensures every eligible trade contributes to your earnings.
Key API Endpoints for Brokers
Below are the most commonly used API endpoints for broker partners, covering spot, derivatives, grid trading, and more.
Spot & Margin Trading
- Place Order:
/api/v5/trade/order - Batch Orders:
/api/v5/trade/batch-orders - Close Positions (Market):
/api/v5/trade/close-position
Algo & Strategy Trading
- Place Algo Order:
/api/v5/trade/order-algo - Supports TWAP, Iceberg, and other advanced order types.
Grid Trading
- Place Grid Algo Order:
/api/v5/tradingBot/grid/order-algo
Dollar-Cost Averaging (DCA)
- Recurring Buy Order:
/api/v5/tradingBot/recurring/order
Block Trading
- Request RFQ (Request for Quote):
/api/v5/rfq/create-rfq
Spread Trading
- Place Spread Order:
/api/v5/spread-trading/order
Instant Convert (Swap)
- Get Quote:
/api/v5/asset/convert/estimate-quote - Execute Swap:
/api/v5/asset/convert/trade
Earn Products
- Subscribe to Earn Products:
/api/v5/finance/staking/purchase
For detailed specifications, visit the official OKX API Docs.
DMA Broker: Sub-Account Management
DMA (Direct Market Access) brokers can manage sub-accounts programmatically with full control over permissions, fee structures, and reporting.
Get Sub-Account List
Endpoint: GET /api/v5/broker/dma/subaccount-info
Rate Limit: 10 requests per second per User ID
Permissions Required: Read
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| subAcct | String | No | Sub-account name |
| uid | String | No | Sub-account UID |
| page | String | No | Page number |
| limit | String | No | Results per page (max 100) |
Response Fields
subAcct: Sub-account nameuid: Unique user IDacctLv: Account mode (1=Spot,2=Contracts, etc.)enable: Status (true=active)frozenFunc: List of restricted functionsts: Creation timestamp (ms)
Get Sub-Account Trading Fees
Endpoint: GET /api/v5/broker/dma/subaccount-trade-fee
Rate Limit: 1 request per second
Returns maker/taker fee rates across different product types including:
- Spot (USDT & Stablecoin pairs)
- Futures (USDT, USDC, Coin-margined)
- Options
Each rate is tied to the user’s VIP level and trading volume.
Create Sub-Account API Key
Endpoint: POST /api/v5/broker/dma/subaccount/apikey
Rate Limit: 40 requests per second
Permissions Required: Trade
Request Body
{
"subAcct": "sub123",
"label": "broker_api_key",
"passphrase": "SecurePass123!",
"perm": "read_only,trade",
"ip": "192.168.1.1"
}🔒 Security Tip: Always bind IP addresses to reduce unauthorized access risk. Unbound keys with trading rights are automatically deleted after 14 days of inactivity.
Query Sub-Account API Keys
Endpoint: GET /api/v5/broker/dma/subaccount/apikey
Use this to list all active API keys under a specific sub-account.
Generate & Retrieve Trade History Links (DMA)
Track every transaction with downloadable trade reports.
Generate Trade Report
Endpoint: POST /api/v5/broker/dma/trades
Generates a ZIP file containing all trades within a date range.
Request Parameters:
begin: Start date (YYYYMMDD)end: End date (YYYYMMDD)
⏱️ Processing Time: Allow up to 3 hours. Check status via GET endpoint.
Retrieve Download Link
Endpoint: GET /api/v5/broker/dma/trades?type=false&begin=...&end=...
Returns a time-limited URL (valid for 9 hours).
CSV fields include:
subAcct,instId,ordId,tradeId,amt,fee,execType,ts
Fully Disclosed (FD) Broker: API & OAuth Models
OKX supports two secure integration models for fully disclosed brokers:
1. API Broker Model
Users generate their own API keys on OKX and share them with your platform (with Broker Code in the tag field). You use these keys to place trades on their behalf.
2. OAuth Broker Model
More secure and user-friendly. Users grant permission via OAuth 2.0 without exposing API keys.
👉 Discover how OAuth simplifies secure user onboarding.
OAuth Integration Guide
Setup Requirements
- Register as an OKX broker.
- Upon approval, receive your
client_idandclient_secret. - Set up redirect URIs and configure IP whitelisting.
You’ll support one of two OAuth flows:
| Flow | Use Case |
|---|---|
| Authorization Code | Server-side apps that securely store client_secret |
| PKCE | Mobile or SPAs where secrets can't be stored |
Both flows return:
- Access Token (valid 1 hour)
- Refresh Token (valid 3 days)
Use the access token in headers:
Authorization: Bearer <access_token>
TERMID: <device_id> (optional for PKCE clients)Refreshing tokens invalidates old ones immediately.
Fast API: One-Click User Onboarding
Fast API allows users to authorize your app and instantly create an API key with predefined permissions—no manual setup needed.
Benefits:
- Reduces friction in user onboarding
- Ensures correct permissions (
read,trade) - Integrates with IP whitelisting for security
Apply through the OKX Broker portal with:
- Redirect URLs
- App logo
- Trusted IP list
Commission Reporting (FD Brokers)
Track earnings accurately with automated rebate reports.
Generate Rebate Report
Endpoint: POST /api/v5/broker/fd/rebate-per-orders
Specify date range (begin, end) to generate a new report.
🕒 Reports take ~2 hours to process. Reuse existing ones if already generated.
Retrieve Rebate Download Link
Endpoint: GET /api/v5/broker/fd/rebate-per-orders?type=false&begin=...&end=...
Link expires in 2 hours.
CSV includes:
brokerCode,level,instId,ordIdfee,netFee,settlementFeebrokerRebate,userRebate,affiliated
Check User Eligibility for Rebates
Use this endpoint to verify whether a user qualifies for commission sharing:
Endpoint: GET /api/v5/broker/fd/if-rebate?apiKey=...
Returns:
- Whether rebates are enabled (
type=0) - Current rebate ratio
- Monthly rebate cap status
Helps avoid failed order tagging due to eligibility issues.
Frequently Asked Questions
Q: What is the difference between DMA and FD brokers?
A: DMA brokers manage sub-accounts directly with full control over funds and APIs. FD brokers work with user-owned accounts via API or OAuth, earning commissions without handling custody.
Q: How do I get my Broker Code?
A: After approval into the OKX Broker Program, your unique Broker Code will be provided via email or in the broker dashboard.
Q: Can I use both API and OAuth models?
A: Yes. You can support both methods simultaneously. Use the brokerType parameter when generating reports to filter by integration type.
Q: Are there rate limits on broker APIs?
A: Yes. Limits vary by endpoint—from 1 request per second to 40 per second—based on function and user ID.
Q: How often are rebates paid out?
A: Payout schedules depend on partnership terms. Contact your OKX account manager for details.
Q: Is there a minimum trading volume to earn commissions?
A: No minimums. All eligible trades contribute to your commission pool, regardless of size.
Final Steps & Best Practices
- ✅ Always include your Broker Code in the
tagfield. - 🔐 Secure all API keys with IP whitelisting and strong passphrases.
- 🔄 Use OAuth for safer, frictionless user onboarding.
- 📊 Regularly download trade and rebate reports for reconciliation.
- 🛠 Monitor error codes like
53002(token expired) or53014(invalid IP).
With robust APIs, flexible integration models, and competitive commission structures, OKX empowers brokers to scale securely and profitably.
👉 Begin your integration journey now—connect with OKX’s liquidity and global user base.