API Authentication¶
The API uses a custom authentication scheme based on HMAC-SHA256 signatures to ensure secure communication.
API Keys¶
To access the API, you need an API key pair consisting of:
- Access Key: Used to identify you
- Secret Key: Used to sign requests (never share this)
Contact support to obtain your API keys.
API Key Permissions¶
API keys have granular permissions that determine which endpoints you can access:
allow_balance- Access to balance informationallow_deposit- Access to deposit functionsallow_withdraw- Access to withdrawal functionsallow_swap- Access to swap functionsallow_transfer- Access to transfer functionsallow_aml_check- Access to AML check functionsallow_limit_order- Access to limit order functions
IP Whitelisting¶
For enhanced security, your API key can be restricted to specific IP addresses. Only requests from whitelisted IPs will be accepted. CIDR notation is supported for IP ranges.
Required Headers¶
Every authenticated request must include the following headers:
X-Access-Key: Your API access keyX-Timestamp: Current timestamp in milliseconds since Unix epochX-Signature: Request signature
Creating the Signature¶
The signature is created by:
- Concatenating your access key, request path, timestamp, and request body
- Signing this string with your secret key using HMAC-SHA256
- Converting the result to a hexadecimal string
Signature Algorithm¶
message = access_key + request_path + timestamp + request_body
signature = HMAC-SHA256(secret_key, message)
Important Notes¶
- The timestamp must be within 5 seconds of the server time
- The request path is the full path component of the URL (e.g.,
/api/v1/balance) - For GET requests, the request body is an empty string
- For POST requests, the request body is the JSON string (not the parsed object, see code examples)
Authentication Errors¶
Common authentication errors include:
access_key.missed: The X-Access-Key header is missingtimestamp.missed: The X-Timestamp header is missingsignature.missed: The X-Signature header is missingtimestamp.invalid: The timestamp is invalid or too far from server timeaccess_key.invalid: The provided access key does not existaccess_key.inactive: The API key is disabledaccess_key.ip_whitelist: The client IP is not in the whitelistuser.inactive: The user account is inactivesignature.invalid: The signature does not match
API Key Security Best Practices¶
- Never share your keys - It should be known only to your server
- Use IP whitelisting - Restrict API access to trusted IPs or CIRDs
- Use HTTPS - Always make requests over HTTPS, never HTTP
- Rotate keys regularly - Periodically request new API keys
- Monitor usage - Regularly review your API key usage for unauthorized access