To create a Binance API key, open Account → API Management on the Binance website, choose Create API and System generated, name the key and confirm with your 2FA. For a trading bot, then edit the key's restrictions: restrict access to trusted IPs, tick Enable Reading and the trading permission your bot needs, and leave Enable Withdrawals off.
This guide walks through each step on the website and in the app, explains which permissions a trading bot needs and why Binance asks for an IP restriction, and shows how to add the key to Freya and fix the errors you might see.
Key Takeaways
- Binance creates API keys under Account → API Management. A system-generated key gives you an API Key and a Secret Key, and the secret is shown only once.
- A trading bot needs Enable Reading plus Enable Spot & Margin Trading (spot bots) or Enable Futures (futures bots). Withdrawals and every other permission stay off.
- By default, Binance allows trading permissions on a system-generated key only when it is restricted to trusted IPs, and Freya refuses keys without that restriction, so add the bot's IP addresses before you tick the trading boxes.
- Freya refuses a key with withdrawal permission and a key without an IP restriction. Your trading capital never leaves your exchange account.
- Only global Binance accounts connect to Freya. Binance TR, Binance US and Binance Japan accounts cannot.
Before you create a Binance API key
Check these on your Binance account first. Binance lists the first three as requirements for creating a key:
- Two-factor authentication (2FA) is on.
- Your identity is verified (KYC).
- Your Spot account is active. Binance activates it with a first deposit of any amount.
- Your Futures account is open, if you plan to run futures bots. Binance does not let you add the Futures permission to a key that was created before the Futures account existed, so open Futures first. If you open it later, create a new key.
- You use a global Binance account. Freya connects only to the exchanges' global API endpoints, so Binance TR, Binance US and Binance Japan accounts cannot connect.
How to create a Binance API key on the website
- Log in to Binance, open your profile menu and go to Account → API Management.
- Choose Create API and select System generated.
- Give the key a name you will recognize, for example "Freya", and confirm with your 2FA.
- Binance shows the API Key and the Secret Key. Copy both now: the secret is shown only once. If you lose it, delete the key and create a new one.
- Choose Edit restrictions on the new key.
- Select Restrict access to trusted IPs only and enter the IP addresses of the app that will use the key. Freya lists its addresses in the Add API Key window.
- Tick Enable Reading, plus Enable Spot & Margin Trading for spot bots or Enable Futures for futures bots. Leave Enable Withdrawals unticked.
- Save the restrictions and confirm with your 2FA.
Binance also offers Self generated keys (Ed25519 or RSA), where you create your own key pair with separate software. A trading bot that asks for an API key and a secret, such as Freya, needs the System generated type.
How to create a Binance API key in the app
- Open the Binance app and tap More. If you do not see it on the home screen, Binance's guide says to add the widget from your profile.
- Scroll to Others and tap API Management.
- Tap Create API, choose System generated, enter a name and confirm with your 2FA or passkey.
- Copy the API Key and the Secret Key, then set the restrictions from steps 5 to 8 above: trusted IPs, reading and the trading permission you need, withdrawals off. If the app does not show an option, finish on the website.
Menu names on Binance change from time to time. If a label looks different, Binance's own guide How to Create API Keys on Binance has the current screens.
Which permissions a trading bot needs
| Permission on Binance | For a trading bot | Why |
|---|---|---|
| Enable Reading | Yes | The bot reads balances, orders and positions |
| Enable Spot & Margin Trading | Yes, for spot bots | Lets the key place spot orders |
| Enable Futures | Yes, for futures bots | Lets the key place futures orders; only possible if the Futures account existed when the key was created |
| Enable Withdrawals | Never | A trading bot never needs to move money out of your account |
| Any other permission (transfers, loans, other products) | No | Not needed for placing trades, so leave it off |
Give a key only the permissions the app needs. That is the principle of least privilege, and it limits what anyone could do with the key if it ever leaked. More on this in exchange API security and risk mitigation.
Why Binance asks for a trusted IP address
Binance treats a key without an IP restriction as an "unrestricted" key, and by default a system-generated unrestricted key can only read. To tick a trading permission, you first restrict the key to trusted IP addresses. Binance also strongly recommends against enabling anything beyond reading on a key without an IP restriction.
The restriction means the key only works when a request comes from one of the addresses you listed. A copy of the key used from anywhere else is rejected.
For Freya, add every address Freya lists in the Add API Key window. Freya does not accept a key without an IP restriction.
Why withdrawals stay off
Freya only needs to read your account and place trades. Your trading capital never leaves your exchange account. Freya never withdraws from your exchange account; it cannot, because it only accepts API keys without withdrawal permission. If a key with withdrawal permission is added, Freya refuses it and does not store it.
The same rule protects you with any app: with withdrawals off, the key cannot move funds out of your account. A trading key can still place orders, which is why the IP restriction and keeping the secret private matter. Whether a platform is trustworthy in other ways is a separate question; is Freya Finance legit and safe? covers what to check.
How to add your Binance API key to Freya
- In Freya, go to Settings → API Keys and select Add API Key.
- Choose Binance Spot or Binance Futures, matching the permission you ticked.
- Paste the API Key and the Secret Key, and give the key a name.
- Freya checks the key at once and tells you if something is missing.
Your key and secret are encrypted (Google Cloud KMS) before they are stored. The full walkthrough, including the other exchanges, is in connect your exchange with an API key. Once the key is verified, you can set up a Binance trading bot.
Common Binance API key errors
If Freya cannot verify the key, it shows one of these messages:
| What Freya shows | What it means | How to fix it |
|---|---|---|
| Invalid API Key | The key was copied incorrectly | Copy the API key again exactly, or create a new one |
| Invalid Secret Key | The secret does not match the key | Copy the secret again; if you lost it, create a new key |
| Your API key is set to "Unrestricted" mode | The key has no IP restriction | Restrict the key to trusted IPs and add the addresses Freya shows |
| IP Address Not Whitelisted | The key is not restricted to Freya's addresses, or Binance rejected the key (for example, it was deleted) or its permissions | Add the addresses Freya shows to the key's trusted IPs, and check on Binance that the key still exists and has the permissions you need |
| Withdrawal permission is enabled | The key can withdraw funds, so Freya will not store it | Turn withdrawals off, or create a new key without them |
| Spot Trading Permission Disabled | The key cannot place spot orders | Tick Enable Spot & Margin Trading |
| Futures Permission Disabled | The key cannot place futures orders | Open your Futures account, then tick Enable Futures |
If you call the Binance API from your own code, the same problems usually come back from Binance as "Invalid API-key, IP, or permissions for action". Check the key, the trusted IP list and the permissions in that order. More fixes are in API key connection errors.
Keep your Binance API key safe
- Never paste the secret into a chat, an e-mail or a form you reached from a link. Nobody from Binance or Freya support needs it.
- Use one key per app, named after the app, so you can delete one without affecting the others.
- Delete keys you no longer use under API Management.
- If you think a secret was exposed, delete the key on Binance and create a new one.
Automated trading carries risk. A bot follows the rules you give it, including the bad ones, and no strategy removes the possibility of loss. Nothing here is financial advice.
Frequently Asked Questions
How do I get my Binance API key?
On the Binance website, go to Account → API Management, choose Create API and System generated, name the key and confirm with 2FA. In the app, tap More, then API Management under Others. Binance shows the API Key and the Secret Key once, so copy both right away.
Which permissions does a Binance API key need for a trading bot?
Enable Reading, plus Enable Spot & Margin Trading for spot bots or Enable Futures for futures bots. Leave Enable Withdrawals and every other permission off. A trading bot never needs to move money out of your account.
Why can't I enable trading on my Binance API key?
Because the key has no IP restriction. By default, Binance limits a system-generated key without trusted IPs to reading. Select Restrict access to trusted IPs only, add the bot's IP addresses, and the trading permissions become available.
Why can't I enable Futures on my Binance API key?
Binance does not allow the Futures permission on a key created before your Futures account existed. Open the Futures account first, then create a new key. Binance also blocks the Futures permission while Portfolio Margin is active.
Is it safe to give a trading bot my Binance API key?
It can be, if the key is set up correctly: withdrawals off, restricted to the bot's IP addresses, and only the trading permission the bot needs. With withdrawals off, the key cannot move funds out of your account. Freya refuses keys with withdrawal permission and keys without an IP restriction.
Can I use a Binance TR or Binance US account with Freya?
No. Freya connects only to Binance's global API, so only global Binance accounts connect. Binance TR, Binance US and Binance Japan accounts cannot.
Does Binance charge for an API key?
Creating an API key on Binance is free. Your trades pay Binance's normal trading fees, whether you place them by hand or through a bot.
Can I use the same Binance API key in two apps?
You can, but it is safer to create one key per app. Each key then has only the permissions and IP addresses that app needs, and you can delete one without breaking the other.





