I was trying to create a Bybit Trading bot and when I started testing it it stopped working and it keeps throwing the same error(10003) Invalid API key. I have checked it several times and it was correct. Do you know what can be the reason for that?
Asked
Active
Viewed 2,021 times
3 Answers
2
For anyone wondering,
You just have to use the 'https://api.bybit.com' endpoint instead of the 'https://api-testnet.bybit.com'.
The authentification code would then look like this:
session_auth = inverse_perpetual.HTTP(
endpoint="https://api.bybit.com",
api_key="you api key",
api_secret="your secret key"
)

Arnaud
- 29
- 2
-
Yes, sure, why bother using sandbox environment when you can loose real money in production environment from the start. – Dinaiscoding Jul 21 '23 at 11:47
1
While generating the API key, there is an option at the bottom for whitelisted IP addresses which would be allowed to access the server with the generated API keys. It is possible that you might not have whitelisted your IP address.

Vaibhav Dhingra
- 11
- 4
0
I got the same error when using testnet=True
with API_key and API_secret from the main bybit website. testnet does not refer to the bybit Demo account.
If you plan to enable testnet, you have to use https://testnet.bybit.com/ APIs.

leoxama
- 63
- 1
- 4