Connect Binance to Nyria
Binance is coming soon and cannot be connected yet. The setup it will take: the API key and secret, spot vs perpetuals, and the safe permissions.
Binance cannot be connected yet. This is the setup it will take once it ships: the API key and secret, the permissions to grant, and the choice between spot and perpetual futures.
Binance and Binance US are both coming soon and cannot be connected yet. The steps below preview the flow at launch. For crypto spot today, use Alpaca or tastytrade; for perpetuals, use Nyria Paper.
Never enable the Withdraw permission on a Binance API key used for automated trading. Nyria only needs Read and Trade. If your key has Withdraw enabled and is ever leaked, an attacker can drain the account.
Prerequisites
- A Nyria account. If you don't have one, follow the Quick Start first.
- A Binance account in good standing. For perpetual futures you must additionally have Binance Futures enabled on the account (a one-time opt-in inside Binance; Nyria cannot enable it for you).
- Binance will connect live-only on Nyria. Binance Testnet is not planned as a selectable environment, so the key you generate will have to be a live-exchange key. Strategies run on Nyria Paper today.
- If you plan to trade perpetual futures, read the Binance broker reference for the supported pairs and leverage rules.
Overview: what you are about to do
- Create an API key + secret on Binance.
- Restrict the key to Read and Trade only, and optionally IP-whitelist it.
- Paste the key + secret into Nyria's Binance connection modal.
- Pick Spot or Perpetual Futures capability when prompted.
- Place a small live test order to confirm the round trip.
Binance uses an HMAC-signed API key, not OAuth. There is no "Login with Binance". You copy the key + secret out of Binance and into Nyria. This means Nyria holds the key server-side, unencrypted at rest, and you (not Binance) decide when to revoke it. See Security for how broker credentials are stored.
Step 1: Create the API key on Binance
Sign in to Binance at binance.com and complete any 2FA prompts.
Open the account menu in the top-right and choose API Management.
Click Create API, choose System generated, and give the key a
label that includes the word nyria (for example, nyria-spot-live or
nyria-perp). The label is for your records only. Binance does
not send it to Nyria.
Complete the 2FA challenge. Binance will show the API Key and Secret Key on a one-time-view panel. Copy both immediately into a password manager. The secret is shown only once. If you lose it you must delete the key and create a new one.
If you navigate away from the create-key page without copying the secret, it is gone. Binance will not show it again. Delete the half-configured key and start Step 1 over.
Step 2: Restrict the API key permissions
This is the most important step. By default Binance keys are read-only. You have to opt in to trading, and you must never opt in to withdrawals for an automation key.
On the API Management page, find the key you just created and click Edit restrictions.
Enable Enable Reading. Nyria needs this to fetch balances, positions, and order status.
Enable Enable Spot & Margin Trading if this integration will trade spot pairs (BTCUSDT, ETHUSDT, etc.).
Enable Enable Futures if this integration will trade USDT-M perpetuals. This option only appears after you have opened a Binance Futures account.
Leave Enable Withdrawals off. Always. Nyria does not place withdrawal requests and never will. Leaving this off means a leaked key cannot move funds off the exchange.
Leave Restrict access to trusted IPs only off. Nyria does not publish a fixed outbound IP, so an IP allowlist will block your own orders.
Save the changes and re-confirm with 2FA.
IP whitelisting is a trade-off: it is the single biggest security win for
an exchange API key, but if Nyria's outbound IP rotates (rare, but possible
during infra migrations) your strategy will start returning auth errors
until you update the whitelist. Plan for a quick revisit if you see
-2015 Invalid API-key, IP, or permissions for action after a known
Nyria deploy window.
Step 3: Decide spot vs perpetual futures
A single Binance API key can hold both Spot and Futures permissions, but in Nyria each integration maps to one trading venue at a time:
- Spot: direct ownership of the underlying coin. No leverage, no liquidation, no funding rate. Symbols look like
BTCUSDT. - Perpetual Futures (CRYPTO_FUTURES capability): leveraged synthetic contracts with no expiry. Long or short, 1x–125x per pair, funding charged every 8 hours. Symbols look like
BTCUSDTon the futures venue, which Nyria translates internally to the perp contract.
If you want both venues, create two integrations in Nyria using the same Binance API key: one labelled Spot, one labelled Perpetual. Strategies pick the integration, not the venue.
Whether perpetuals are available in your jurisdiction depends on Binance's regional rules, not Nyria's. If your Binance account is region-restricted to spot only, the perpetual integration will return permission errors at the first order. That is Binance enforcing the restriction, not a Nyria bug.
Step 4: Add the integration in Nyria
In the Nyria app, click Integrations in the left nav.
Find the Binance card in the Brokers grid, click it, then click Connect live account.
Paste the API Key and Secret Key copied in Step 1. The
integration points at api.binance.com and uses real funds. Binance is
live-only on Nyria.
Pick the capability: Spot or Perpetual Futures. This drives which Binance venue Nyria routes orders to and which symbol format the parser expects.
Click Connect. Nyria will immediately make a signed test call to Binance to validate the credentials. A green checkmark means the key authenticates, has the right permissions, and can read balances. A red error surfaces the raw Binance error code. See Troubleshooting below.
Step 5: Place a validation order
Before you point a real strategy at this integration, send one alert through the strategy's webhook. That proves the whole chain — credentials, capability, symbol format, balance — rather than any one part of it.
Copy the webhook URL from the strategy's Integration tab.
POST a minimal entry to it: {"symbol": "BTCUSDT", "action": "buy"}. Size
it with the bot's Budget per signal ($), around $15 for spot; Binance's
minimum notional is $10 on most pairs, so leave headroom for price drift.
Check the strategy's Logs tab for the parse and the bot's Logs tab for the Binance order ID and filled quantity.
Close the position from Binance's UI so you are not left holding an unintended position. Nyria does not close it for you. See Close a Position.
If the test order fills and closes cleanly, the integration is ready to attach to a strategy. Head to Strategies to wire up your alert source.
Symbol formats Nyria accepts
Nyria's parser normalises symbol formats so you do not have to memorise the Binance convention. The following all route to BTCUSDT on the Binance API:
| In your alert | Nyria parses to |
|---|---|
BTC | BTCUSDT (default quote currency) |
BTCUSD | BTCUSDT |
BTCUSDT | BTCUSDT |
BTC/USDT | BTCUSDT |
BTC-USDT | BTCUSDT |
For USDC quote pairs, be explicit (BTCUSDC); BTC alone defaults to the USDT pair. Full symbol-resolution rules and the precedence order are documented in Webhook Payload Reference.
A minimal JSON alert payload that routes a market buy through this integration:
{
"ticker": "BTCUSDT",
"action": "OPEN",
"direction": "LONG",
"price": 64250.50
}Spot versus perpetual is not set by the alert. It comes from the strategy's crypto type, chosen when you created the strategy.
Rotating or revoking the key
Treat the API secret like a password. If it ever appears in a screenshot, a Discord paste, a chat log, or a git diff, rotate it the same day.
In Binance API Management, click Delete on the compromised key. Confirm with 2FA. The key stops authenticating immediately worldwide.
Repeat Steps 1 and 2 to create a fresh key with the same restrictions.
In Nyria, disconnect the Binance integration and connect it again with the new key and secret. Bots attached to the account keep their configuration; there is no need to rewire each one.
Troubleshooting
-2014 API-key format invalid
You pasted only part of the key, or there is a trailing newline. Re-copy the full string from your password manager and try again.
-2015 Invalid API-key, IP, or permissions for action
One of three things:
- IP whitelist. You turned on IP restriction on the Binance key. Remove it; Nyria has no fixed outbound IP to allow.
- Permission missing. You enabled the key for Spot but the integration is configured as Perp (or vice versa). Either flip the Binance permission or delete and re-add the Nyria integration with the matching capability.
- Wrong environment. A Binance Testnet key will not authenticate against the live exchange. Nyria connects to the live exchange only, so the key must be generated there.
-1021 Timestamp for this request was 1000ms ahead of the server's time
Binance requires the signed request timestamp to be within a narrow window of the exchange clock. If you see this from a fresh integration, retry once. It usually self-resolves. If it persists, open a support ticket so we can check the server clock drift on Nyria's side.
Test order rejected with Account has insufficient balance
For Spot on a live account, fund the spot wallet with the quote currency (USDT or USDC) before testing. For Perpetuals, transfer collateral from the spot wallet to the USDT-M futures wallet inside Binance. Nyria cannot move funds between Binance sub-wallets for you.
Test order rejected with Filter failure: MIN_NOTIONAL
The order is below Binance's per-pair minimum order value (typically $10 spot, $5 perp). Increase the test quantity.
Live orders fill on Binance but Nyria shows them as errored
This is the case the trade-bot's TastyTrade order-id fix also pattern-matches. A broker returns success with a numeric ID, the client parses it as a string, and the success path throws. If you see filled orders on Binance with no corresponding fill record in Nyria, open a support ticket and include the order ID. The platform team needs the raw response to patch the client. Do not place more orders through that integration until it is resolved; close the open positions on Binance directly.
Related
- Binance broker reference: supported equity types, fees, leverage rules, and limits.
- Coinbase setup: a USD-quoted crypto alternative (coming soon).
- Webhook Payload Reference: the full alert payload spec, including symbol resolution and the
equity_typefield that picks Spot vs Perp at routing time. - What You Can Trade: background on how Nyria models spot vs perpetual positions.
- Quick Start: end-to-end first strategy if you haven't built one yet.