Binance futures testnet error

Hi,
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’,
base_url=“https://testnet.binancefuture.com”)
print(cm_futures_client.account())

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

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

ty.

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

print(um_futures_client.account())

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: 45.8.220.141’, {‘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’,
base_url=“https://testnet.binancefuture.com”)

the base_url should be set to testnet url.

1 Like