Create Special Key(Low-Latency Trading)(TRADE)
API Description
Eligibility
- Binance Margin offers low-latency trading through a special key, available exclusively to users with VIP level 7 or higher.
- If you are VIP level 6 or below, please contact your VIP manager for eligibility criterias.
- All new Margin Special Key users are required to read, understand, and agree to the Margin Special Key Supplemental Product Terms at the master account level before creating a Margin Special Key.
- Once signed at the master account level, the agreement applies to all sub-accounts. The master account and all sub-accounts (Cross Margin Classic and Portfolio Margin Pro) are authorized to create a Margin Special Key and are subject to the LiquidationLoan policy.
For more information, please refer to FAQ.
Supported Products:
- Cross Margin
- Isolated Margin
- Portfolio Margin Pro
Unsupported Products:
- Portfolio Margin
We support several types of API keys:
- Ed25519 (recommended)
- HMAC
- RSA
We recommend to use Ed25519 API keys as it should provide the best performance and security out of all supported key types. We accept PKCS#8 (BEGIN PUBLIC KEY). For how to generate an RSA key pair to send API requests on Binance. Please refer to the document below FAQ .
How to use the Margin Special Key
- Use the below
sapiendpoint to create your margin special API Key. - For accessing the Cross Margin account, do not send the
symbolparameter. - For accessing the Isolated Margin account(s), pass the relevant
symbolparameter in the API Key creation request. - Use the generated API Key (and Secret key, if applicable) to perform margin trading and listenKey generation via Spot REST API (
https://api.binance.com/api/v3/*) endpoints.
Read REST API or WebSocket API documentation to learn how to use different API keys
You need to enable Permits “Enable Spot & Margin Trading” option for the API Key which requests this endpoint.
HTTP Request
POST /sapi/v1/margin/apiKey
Request Weight
1(UID)
Request Parameters
| Name | Type | Mandatory | Description |
|---|---|---|---|
| apiName | STRING | YES | |
| symbol | STRING | NO | isolated margin pair |
| ip | STRING | NO | Can be added in batches, separated by commas. Max 30 for an API key |
| publicKey | STRING | NO | 1. If publicKey is inputted it will create an RSA or Ed25519 key. 2. Need to be encoded to URL-encoded format |
| permissionMode | enum | NO | This parameter is only for the Ed25519 API key, and does not effact for other encryption methods. The value can be TRADE (TRADE for all permissions) or READ (READ for USER_DATA, FIX_API_READ_ONLY). The default value is TRADE. |
| recvWindow | LONG | NO | The value cannot be greater than 60000 |
| timestamp | LONG | YES |
Response Example
{
"apiKey":"npOzOAeLVgr2TuxWfNo43AaPWpBbJEoKezh1o8mSQb6ryE2odE11A4AoVlJbQoGx",
"secretKey":"87ssWB7azoy6ACRfyp6OVOL5U3rtZptX31QWw2kWjl1jHEYRbyM1pd6qykRBQw8p" //secretKey will be null when creating an RSA key
"type": "HMAC_SHA256" //HMAC_SHA256 or RSA
}
Error Code Description
- UNSUPPORTED_OPERATION : Portfolio Margin is an unsupported product, please change the account type to a supported margin product.
- Forbidden: Cross Margin Pro accounts require additional agreements, please contact your relationship manager.