1. Open Gate website. Place your cursor on top of the profile icon to unfold the menu and click on "API Management".
2. Click on "Create API Key" on the page.
3. Create API Key
Create an APIv2 Key:
① IP permissions: You can choose whether to bind IP. Note: If you opt for not binding, the API Key will allow access from any address and is valid for 90 days.
② API Key type: Select API v2 Key. Each user can only create 1 set, and the new one will overwrite the previous one. Then you can set it to be: "Read and Write" or "Read Only".
③ Confirm the details and click "Submit" to submit it.
Note: The previous API key will expire immediately when the new API key is generated.
API keys can be used to query information of the account and also to trade, withdraw funds, etc.
Please keep your API keys safe and do not ever share them with anyone else!
Create an APIv4 key
①API Key Remarks: Helps to identify and remember the key.
② IP permissions: You can choose whether to bind IP. Note: If you opt for not binding, the API Key will allow access from any address and is valid for 90 days.
③API Key type: Select API v4 Key.
④Account type: Choose Classic Account/MarginTrading/Testnet.
⑤Permissions: Set it to be: "Read and Write" or "Read Only". Note: The currency pair cannot be empty.
⑥Confirm the details and click "Submit" to submit it.

4. A Risk Reminder will pop up after you click "Submit ". Please read the risk warnings carefully, and then click "I accept" or "Cancel" to proceed.

Enter the Fund Password, select the methods for 2FA Authentication,and click "Confirm" to proceed.
5. After creating an API key, you can view, edit or delete the key.

6. Notice:
① APIv2/4 keys have permissions to withdraw and deposit. To use the API to withdraw, you must use the address that has been withdrawn manually, and the time since the last manual withdrawal is more than 24 hours.
② The differences between APIv2 and APIv4 are as follows:
•APIv2 keys and APIv4 keys are independent of each other.
•APIv2 keys are only permitted to conduct spot trading while APIv4 keys are granted full access to spot trading, margin trading, and contract trading.
•You need to scroll down to the bottom of the page of your APIv2 keys to create new APIv2 keys. APIv4 keys are created in "Personal Center" - "Sub account and API" - "APIv4 Keys".
Decide between APIv2 and APIv4 according to your own specific demands. Please refer to this article for updates on their features.
If the article can not help with your questions, please give us feedback through a ticket. Please include the following information in the ticket:
Your UID, URL of the original request, parameters and a thorough deion of your request, whether the API key is for spot or margin trading, mainnet or testnet, the programming language (the codes for sending the request would be great), whether SDK is used (if yes, please describe how to use it or comment in GitHub).
7. API documents can be accessed in "Services" - "Developers (API)" on the bottom of the page.
8. Frequency limit rule.
| Markets | Endpoints | Limits | Based On | Include |
|---|---|---|---|---|
| All public endpoints | Public endpoints | 200r/10s per endpoint | IP | Orderbook, Candlestick, Ticker, etc. |
| Wallet | Private endpoints | Withdrawal(POST /withdrawals) : 1r/3s UID transfer(POST /withdrawals/push) 1r/10s Transfer between trading accounts (POST /wallet/transfers) 80r/10s Transfer between main and sub accounts (POST /wallet/sub_account_transfers) 80r/10s Transfer from a sub-account to another sub-account (POST /wallet/sub_account_to_sub_account) 80r/10s Retrieve user's total balances (GET /wallet/total_balance) 80r/10s Retrieve sub account balances (GET /wallet/sub_account_balances) 80r/10s Query sub accounts' margin balances (GET /wallet/sub_account_margin_balances) 80r/10s Query sub accounts' futures account balances (GET /wallet/sub_account_futures_balances) 80r/10s Query subaccount's cross_margin account info(GET /wallet/sub_account_cross_margin_balances) 80r/10s The Others: 200r/10s per endpoint |
UID | Withdrawal. Query personal account balance. Query subaccount balance. |
| Spot | Private endpoints | The rate limit for batch/single order placement and amend an order are total of 10r/s (UID+Market) The rate limit for batch/single order cancellation is total of 200r/s The Others: 200r/10s per endpoint |
UID | Spot order placement and cancellation. Trade history and fee rates. |
| Perpetual Futures | Private endpoints | The rate limit for batch/single order placement and amend an order are total of 100r/s The maximum rate limit for the order cancellation (bulk/single) is 200r/s The Others: 200r/10s per endpoint |
UID | Futures order placement and cancellation Trade history and fee rates |
| Delivery | Private endpoints | The maximum rate limit for the order placement (bulk/single) is 500r/10s The maximum rate limit for the order cancellation (bulk/single) is 500r/10s The Others: 200r/10s per endpoint |
UID | Order placement and cancellation |
| Options | Private endpoints | The maximum rate limit for the order placement (bulk/single) is 200r/s The maximum rate limit for the order cancellation (bulk/single) is 200r/s The Others: 200r/10s per endpoint |
UID | Order placement and cancellation |
| Subaccount | Private endpoints | 80r/10s per endpoint | UID | Create a sub-account. Retrieve the list of sub-accounts. Disable or enable API key for a sub-account. |
| Unified | Private endpoints | Borrow or repay 15/10s | UID | Borrow or repay(POST /unified/loans) |
| Other Private endpoints | Private endpoints | 150r/10s per endpoint | UID | Earning, collateral etc |
The rate limit is counted against each sub-account or main account.
WebSocket:
• The message limit sent to the server: unlimited.
• Number of connections per IP: ≤ 300
NOTICE:
When repeatedly violating rate limits, it depends on
• the request< burst rate, the request will have a delay.
• the request> burst rate, the request will be declined.
