4tune — API key guide

Every key below should be created as read-only — 4tune never places trades, deposits, or withdraws. Keys are stored only in your browser and are sent directly to each platform, never to us.

Trading 212 Stocks — live now

  1. Log in to Trading 212 (web or app) → open Settings
  2. Go to the API (Beta) section → New API key
  3. Name it (e.g. "4tune")
  4. Under IP access restrictions, choose Unrestricted for now (fine since your IP changes) — switch to "Restrict to trusted IPs" later if you have a static IP
  5. Under Permissions, turn ON only:
    • Account data — needed for cash/balance
    • Portfolio — needed for your open positions
    Leave everything else OFF — especially Orders - Execute and Pies - Write, which grant trading/write access 4tune doesn't need. (Metadata is on by default and harmless — it's just instrument info.)
  6. If you also want fees paid shown, additionally turn ON History and History - Orders — Trading 212 doesn't expose a single "fees" number, so 4tune reads it from your recent order history instead
  7. Generate the key — copy both the API Key and API Secret, the secret is shown only once
  8. Paste both into 4tune's Trading 212 settings

Full permission list you'll see: Account data, History, History‑Dividends, History‑Orders, History‑Transactions, Metadata, Orders‑Execute, Orders‑Read, Pies‑Read, Pies‑Write, Portfolio. Account data and Portfolio cover the core balance/positions view. Add History + History - Orders only if you want the fees figure too — it's optional.

Note: the Public API only works with Invest and Stocks ISA accounts (not SIPP), and is still in beta.

Alpaca Stocks — live now

  1. Log in at app.alpaca.markets — not the docs site, that's just reference material
  2. You'll land on the dashboard overview. Confirm which account you're on (top-left switcher, e.g. "Paper Trading") — Paper and Live have separate keys
  3. On the right-hand side of the overview page, find the API Keys panel (it also shows the correct Endpoint URL for that account)
  4. Click Generate New Keys — the Key and Secret appear right there on the page
  5. Copy both immediately — the page warns the secret disappears if you refresh or navigate away
  6. Paste both into 4tune's Alpaca settings, matching Live/Paper to what you generated

Note: this quick-generate flow doesn't show a Read-only vs Full-access choice — it just generates a key. If you're doing this on a Live account, check the API or Credentials Management section in the left sidebar for a scoped/read-only option before saving the key, since a Live key generated this way may default to full trading access.

Binance Crypto — live now

  1. Log in to Binance → click your profile icon (top right) → Account
  2. In your Account page, find API Management
  3. Enter a label for the key, then click Create API
  4. On "Choose API Key type", pick System generated (HMAC key + secret pair) — not "Self-generated", which needs your own separate keypair software
  5. Complete 2FA (email + authenticator/SMS) to confirm
  6. Copy the API Key and Secret Key — the secret is shown only once
  7. Leave Enable Spot & Margin Trading and Enable Withdrawals OFF — read-only is enough
  8. If your key isn't IP-restricted, Binance requires it to be read-only only anyway

4tune shows your live balance and USD value. Per-transaction fee tracking for Binance isn't built yet.

Kraken Crypto — live now

  1. Sign in to Kraken → click your profile icon (top right) → SecurityAPI
  2. Click Add Key and give it a name
  3. Under Funds permissions, check Query — leave Deposit, Withdraw, and Earn unchecked
  4. If you also want fees paid shown, additionally check Query closed orders & trades under Orders and trades — it's optional, without it fees will just say "unavailable"
  5. Leave Data unchecked for now — 4tune doesn't use it yet
  6. Leave WebSocket interface, IP restriction, and Key expiration off (their defaults) unless you specifically want them
  7. Click Create API key and copy both the API Key and Private Key — the private key is shown only once
  8. Paste both into 4tune's Kraken settings

⚠️ Kraken has two separate APIs with separate key pages — Spot (what 4tune uses, created under Security → API) and Futures (created under Account → Connections & API, or on the Futures site). A Futures key will not work here and Kraken will reject it with "Invalid key" if you paste it in by mistake.

4tune shows your live balance, USD value, and fees paid (with the optional permission above).

Kraken Futures Perps / Margin — live now

⚠️ This is a separate API from Kraken Spot above — a different site, different key. If you already made a Spot key on kraken.com, you still need a second one on Kraken Futures.

  1. Go to futures.kraken.com and sign in (or link your existing Kraken account if prompted)
  2. Click your name (top right) → Settings
  3. Go to the API panel → Create Key tab
  4. Under General API, choose Read Only — not Full Access
  5. Leave Withdrawal API as No Access
  6. Click Create Key and copy both the Public key and Private key — shown only once
  7. Paste both into 4tune's Kraken Futures settings

Shows portfolio value, unrealized PnL, margin equity, and open positions (symbol, side, size, entry price). Per-position live PnL isn't shown — Kraken's own wallet-level PnL is used instead, since computing it per-position needs a live price feed and differs by contract type.