Binance futures testnet error

Created a new account on binance testnet futures.
when i run this code i’ll get an error.

from binance.cm_futures import CMFutures
cm_futures_client = CMFutures(key=“XXXXXXXXX”, secret=‘XXXXXXXXX’,

Error :
401, -2015, ‘Invalid API-key, IP, or permissions for action, request ip:’,

On my main account this works fine.
Are there any problems with new testnet futures accounts ?
Older testnet account from a friend works fine.


Testnet has separate API/Secret key. Did you use that?

thanks, we will let team know.

Yes. I used the api and secret from the futures testnet. Also created a second account. No luck.
And as i said. Code works with keys from a friend.

I came across the same error today when coding with python, but I use the um_futures. I’m just wondering have you solved your problem?

Here are my codes:

from config import api_key, api_secret

from binance.um_futures import UMFutures

um_futures_client = UMFutures(key=api_key, secret=api_secret)

Get account information


I use the api key and the secret key from the binance futures testnet, and the error is shown as follows:

binance.error.ClientError: (401, -2015, ‘Invalid API-key, IP, or permissions for action, request ip:’, {‘Date’: ‘Sun, 09 Jul 2023 18:05:34 GMT’, ‘Content-Type’: ‘application/json’, ‘Content-Length’: ‘95’, ‘Connection’: ‘keep-alive’, ‘Server’: ‘Tengine’, ‘X-MBX-USED-WEIGHT-1M’: ‘5’, ‘x-response-time’: ‘0ms’, ‘Access-Control-Allow-Origin’: ‘*’, ‘Access-Control-Allow-Methods’: ‘GET, POST, PUT, DELETE, OPTIONS’})

cm_futures_client = CMFutures(key=“XXXXXXXXX”, secret=‘XXXXXXXXX’,

the base_url should be set to testnet url.

1 Like