OKX API Updates to the 'Get Fee Rates' Interface

·

OKX has announced upcoming changes to its fee rate system, which will impact how traders and developers interact with the 'Get Fee Rates' API endpoint. These modifications are designed to streamline the fee structure and enhance clarity for users engaging with different types of margin contracts.

Following a system-wide fee rate adjustment, all currency pairs will now fall under a single fee rate category. Notably, futures and perpetual swaps will have distinct fee rates based on whether they are USDT-margined or crypto-margined. To align with these changes, the 'Get fee rates' interface will be updated.


Key Changes to the API Interface

The primary adjustments focus on the parameters used within the API call. It is crucial for developers to understand these updates to ensure their trading systems and automated strategies continue to function correctly.

Removal of the 'Category' Field

The category field will be removed from the request parameters. Importantly, this change is backward-compatible. Whether you include the category value in your API call or not, the system will return the same dataset. This is because all instruments now share a unified fee category, making the parameter redundant.

New Return Parameters for Margin Types

Two new parameters will be added to the API’s response: takerU and makerU. These fields represent the taker and maker fee rates specifically for USDT-margined futures and perpetual swap contracts.

Concurrently, the meaning of the original taker and maker parameters in the response will change. They will now exclusively represent the fee rates for crypto-margined futures and perpetual contracts.

This distinction is vital as it directly reflects the new fee structure where margin type determines the rate.

API Request and Response Details

The HTTP request method and endpoint path remain unchanged.

Endpoint Name: Get fee rates
HTTP Request: GET /api/v5/account/trade-fee

Updated Request Parameters

ParameterTypeRequiredDescription
instTypeStringYesInstrument type. Valid values: SPOT, MARGIN, SWAP, FUTURES, OPTION.
instIdStringNoInstrument ID (e.g., BTC-USDT). Only applicable to SPOT and MARGIN.
ulyStringNoUnderlying (e.g., BTC-USD). Only applicable to FUTURES, SWAP, and OPTION.
categoryStringNoThis field will be removed and should no longer be used.

Updated Return Parameters

ParameterTypeDescription
categoryStringFee schedule category.
takerStringTaker fee rate, now specifically for crypto-margined futures and perpetual swaps.
makerStringMaker fee rate, now specifically for crypto-margined futures and perpetual swaps.
takerUStringNew: Taker fee rate for USDT-margined futures and perpetual swaps.
makerUStringNew: Maker fee rate for USDT-margined futures and perpetual swaps.
deliveryStringDelivery fee rate.
exerciseStringFee rate for exercising an option.
levelStringThe user's current fee rate level.
instTypeStringInstrument type.
tsStringTimestamp of the data response (Unix epoch in milliseconds, e.g., 1597026383085).

Action Required for API Users

Developers and institutional traders must update their systems to correctly interpret the new response parameters. Relying on the original taker and maker fields for USDT-margined contracts will result in incorrect fee calculations, which could negatively impact trading strategies and profitability.

It is highly recommended to test the updated interface in a simulated environment before the changes go live. 👉 Explore the updated API documentation to ensure a smooth transition.


Frequently Asked Questions

What is the main reason for this API change?
The update aligns the API with OKX's new fee rate structure, where fees for futures and perpetual swaps differ based on the margin type (USDT vs. crypto). The API changes provide clearer, separate fields for these distinct rates to prevent user confusion.

Do I need to change my API request code?
For the request, no immediate change is strictly necessary as the removal of the category parameter is backward-compatible. However, you must update your code that processes the API response to use the new takerU and makerU fields for USDT-margined contracts.

How will this affect my existing trading bots?
Bots that trade USDT-margined derivatives and use the old taker/maker fields to calculate fees will produce errors. You must modify their logic to use the new takerU and makerU parameters for accurate fee assessment on these contract types.

What happens if I don’t update my system?
If your system is not updated, it will misread the fee rates for USDT-margined contracts by using the values meant for crypto-margined ones. This could lead to significant miscalculations in trading costs, profitability, and risk management.

Where can I find support for implementing these changes?
The best source of information is the official OKX API documentation. For specific technical issues, you can often find solutions and discuss with other developers in OKX's official community support channels. 👉 Get advanced methods for API integration

Are spot and margin trading fees affected?
The fee rates themselves for spot and margin trading may be subject to change based on the overall fee system upgrade. However, the way you query them via this API endpoint for SPOT and MARGIN instType remains consistent, as the taker/maker fields for these instruments are unchanged.


Staying informed about API updates is critical for maintaining robust and efficient trading operations. By proactively adapting to these changes, you can ensure continuous, uninterrupted access to OKX's trading services and protect your strategic investments.