Binance Testnet API Keys
Getting API Key and Secret Key from Binance Testnet.
Step 1 — Access the correct Testnet platform
Binance splits Testnet into two separate platforms for Spot and Futures:
- Spot Testnet: https://testnet.binance.vision/
- Futures Testnet: https://testnet.binancefuture.com/
Step 2 — Log in
- On the Spot Testnet page (
testnet.binance.vision), click Log in. - Unlike the real exchange, authentication is done via GitHub. Click “Log in with GitHub” and authorize the application.
Step 3 — Generate an API Key
- Once logged in, you will be redirected to the API management page.
- Click Generate HMAC_SHA256 Key (RSA and Ed25519 are also available, but HMAC_SHA256 is the most common standard and easiest to configure for general scripts).
- Enter a description for your key (e.g.
trading-bot-dev) and click Generate.
Step 4 — Store safely
- The system will immediately display your API Key and Secret Key.
- Important: You must copy and save the
Secret Keyright now (recommended: paste it into your.envfile). The platform will never show the Secret Key again after you refresh the page. If you lose it, you will need to delete it and generate a new one. - Your Testnet account is automatically funded with virtual assets (e.g. BNB, BTC, USDT, BUSD) for testing.
Step 5 — Add keys to .env
Open the .env file at the project root (create it from .env.example if it doesn’t exist yet):
cp .env.example .env
Fill in the API Key and Secret Key you just generated:
BINANCE_API_KEY=your_api_key_here
BINANCE_API_SECRET=your_secret_key_here
Then restart the container so the bot picks up the new config:
docker compose restart opentrader-bot
Verify the bot received the keys:
docker exec opentrader-bot env | grep BINANCE
⚠️ Never commit
.envto git. It is already listed in.gitignore— double-check if you forked the repo.