Guide

Crypto Bot Without Withdrawal Access: API Key Permissions

A crypto bot never needs withdrawal access. How read, trade and withdraw API key permissions work, what non-custodial means, and a checklist before you connect.

Updated

A crypto trading bot needs two permissions on your exchange API key: read and trade. It never needs withdrawal permission, and a key without it cannot move funds off the exchange. If a bot or an AI agent asks for a key that can withdraw, do not connect it.

This guide explains how exchange API key permissions work, what non-custodial means, what can still go wrong with a trade-only key, and how OptAlgo handles keys for bots and for AI agents. A checklist closes the guide.

How exchange API key permissions work

An API key is a pair: a public key and a secret. Together they let a program act on your exchange account without your password. When you create a key, the exchange asks what it may do. The names differ between exchanges, but the permissions fall into three groups.

Large exchanges such as Binance, Bybit and OKX let you set these permissions per key, so both a read-only key and a trade-only key without withdrawal are possible. The exact screens and names change over time, so check the exchange's own API management page when you create the key.

A portfolio tracker needs read only. A trading bot needs read and trade. Nothing a bot does needs withdraw: opening a position, placing a stop and closing a trade are all trade actions.

IP allowlists

Most exchanges let you bind a key to a list of IP addresses. A request from any other address is refused, even with the correct key and secret. This matters because a leaked key is the most likely failure. With an IP allowlist, a leaked key is of little use to someone on a different network.

Use an allowlist whenever the service you connect publishes fixed IP addresses or sets the restriction for you.

What non-custodial means

A custodial service holds your funds. You deposit to it, and you rely on it to give the money back. A non-custodial trading bot never holds your funds. The money stays in your own exchange account, the bot sends orders through an API key, and you can delete that key at any moment to cut the bot off.

Non-custodial plus no withdrawal permission is the combination to look for. The service cannot take the funds because it never has them, and its key cannot send them anywhere.

What can still go wrong with a trade-only key

A trade-only key removes one risk: theft of funds by withdrawal. It does not make trading safe. Trading is risky, and a key that can trade can lose money by trading.

So the key permission is the first layer. The second layer is limits on what the bot may do with the trade permission: how much capital, how much leverage, how much loss in a day.

How OptAlgo handles exchange keys

OptAlgo is non-custodial. It never holds your crypto. You connect an exchange API key that can trade but cannot withdraw, and your funds stay on your exchange. API-key connections never need withdrawal permission. API secrets are stored hashed and encrypted, and they are never shown again after you save them.

For Binance, OptAlgo connects through Binance Link, Binance's program for third-party platforms. You connect on Binance's own consent screen, and the key it creates is IP-restricted and cannot withdraw. Bybit, OKX and Alpaca connect with an API key you create yourself, and that key never needs withdrawal permission.

Sub-accounts let you ring-fence bot capital with its own exchange connection, so a bot only ever sees the money you gave that sub-account. The security page lists what OptAlgo can and cannot do with your account.

How OptAlgo handles keys for AI agents

There are two kinds of key here, and they are easy to confuse. The exchange API key connects OptAlgo to your exchange. The OptAlgo API key connects an AI agent or your own program to OptAlgo. An agent never receives your exchange key.

Chat connectors for Claude.ai and ChatGPT use no key at all. The MCP connector signs in with OAuth and is paper-only by design: it cannot place a live order, flip a bot to live or touch a live bot. The MCP trading server guide explains how that works.

Terminal agents such as Claude Code and Codex use an OptAlgo API key, and that key carries scopes you choose:

On the Free plan a key can read, backtest and run paper bots. Live trading needs Plus or Pro and a key with the trade scope. For such a key you choose confirm-live or full autonomy. With confirm-live, every move to live waits for your approval in the app.

A key with the trade scope carries limits the server enforces, not the prompt: max allocation, max leverage, allowed exchanges and a daily loss limit. An agent cannot talk its way past them, because the check happens on the server. Every call is logged, and money-moving actions send a Telegram notice.

The key also stays out of the chat. With a device login, your agent starts the login, you approve it in the OptAlgo app, and the key is written straight into a file on your machine that only you can read. It is never printed and never enters the conversation. You can revoke it any time under AI agents. Scopes and limits are described in the API key docs, and the terminal agents page shows the flow.

Paper trading needs no exchange key

The safest key is the one you have not created yet. On OptAlgo you can write a strategy, backtest it and run it as a paper bot without connecting an exchange at all. Paper trading uses live prices and no real money. Start there with a free account, and create an exchange key only when a strategy has earned it.

Checklist before you connect a bot

  1. Withdrawal permission is off on the exchange API key. If the service says it needs it, stop.
  2. Only the markets the bot trades are enabled (for example futures only, or spot only).
  3. The key is IP-restricted, either by you or by the exchange's own connect flow.
  4. The service is non-custodial: you never deposit funds to it.
  5. The key is used by one service only, and you know how to delete it on the exchange.
  6. Bot capital sits in a sub-account, separate from the rest of your portfolio.
  7. An AI agent gets only the scopes it needs. Read, backtest and paper bots cover almost all the work.
  8. A key that can trade live has a max allocation, a max leverage and a daily loss limit, enforced by the server.
  9. No key was ever pasted into a chat. If one was, revoke it and create a new one.
  10. The strategy ran on paper first, and you read its honesty grade and overfit verdict before any return figure.

None of these steps makes a strategy profitable. They make sure that when a strategy fails, the loss is bounded and your funds are still in your own account.

Frequently asked questions

Does a crypto trading bot need withdrawal permission?

No. A bot needs read and trade permission only. Opening, managing and closing positions are all trade actions. If a bot asks for withdrawal permission, do not connect it.

Which exchanges let you create read-only or trade-only API keys?

Large exchanges such as Binance, Bybit and OKX let you set permissions per key, so you can create a read-only key or a key that trades without withdrawal rights. Check the exchange's API management page for the current options.

What is a non-custodial crypto trading bot?

It is a bot that never holds your funds. The money stays in your own exchange account and the bot sends orders through an API key that cannot withdraw. You can delete the key at any time.

Can OptAlgo withdraw my funds?

No. API-key connections never need withdrawal permission, and Binance auto-connect creates a key without it. Funds stay on your exchange.

Can an AI agent place live trades with my OptAlgo API key?

Only if you created a key with the live trade scope on a Plus or Pro plan. That key works inside the allocation, leverage and daily loss limits you set, which the server enforces. Chat connectors for Claude.ai and ChatGPT are paper-only.

Your next strategy is one sentence away.
Test it honestly before it touches money.

Start free, no card

50 backtest units a month on the Free plan.