The following is a general tutorial for creating an API. However, we recommend using sub-account APIs for trading whenever possible to reduce the risk to the main account. Sub-accounts are independent accounts that contribute to enhanced security and facilitate the assessment and optimization of different trading strategies' performance.
Sub-Accounts Page.
(1) Go to BitMEX official website and log in.
(2) Click on your profile picture, then find 【API Keys】 and click on it.

(1) Enter API name tags on your own.
(2) Click on the 【+】 below CIDR.
(3) Copy and paste the trusted IP segments below into the address box, then click the 【+】 below:
54.64.46.83/32
52.198.134.2/32
18.179.130.89/32
52.68.229.228/32
(4) For Key Permissions, select 【Order】.
(5) Click on 【Create API Key】.

* To trade using a sub-account, please select 【Sub-account】 in the target account.
Please immediately copy the API Key and Secret Key and save them in a notepad or text file to prevent loss.
