OKX Broker API Integration Guide

·

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:

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:

✅ 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

Algo & Strategy Trading

Grid Trading

Dollar-Cost Averaging (DCA)

Block Trading

Spread Trading

Instant Convert (Swap)

Earn Products

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

ParameterTypeRequiredDescription
subAcctStringNoSub-account name
uidStringNoSub-account UID
pageStringNoPage number
limitStringNoResults per page (max 100)

Response Fields


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:

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:

⏱️ 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:


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

  1. Register as an OKX broker.
  2. Upon approval, receive your client_id and client_secret.
  3. Set up redirect URIs and configure IP whitelisting.

You’ll support one of two OAuth flows:

FlowUse Case
Authorization CodeServer-side apps that securely store client_secret
PKCEMobile or SPAs where secrets can't be stored

Both flows return:

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:

Apply through the OKX Broker portal with:


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:


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:

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

  1. ✅ Always include your Broker Code in the tag field.
  2. 🔐 Secure all API keys with IP whitelisting and strong passphrases.
  3. 🔄 Use OAuth for safer, frictionless user onboarding.
  4. 📊 Regularly download trade and rebate reports for reconciliation.
  5. 🛠 Monitor error codes like 53002 (token expired) or 53014 (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.