OKX's v5 API covers spot, perpetual/futures swaps, options and market data over REST and WebSocket. One quirk: OKX keys come as three parts — API key, secret and a passphrase. Here's how to get them.
| Use | Costo |
|---|---|
| Market data (REST/WS) | Gratuito |
| Spot trading fee | ~0.08–0.1% |
| Perpetual swaps (taker) | ~0.05% |
| API access | Gratuito |
1. Sign up / log in at okx.com and complete verification.
2. Vai a Account → API and click Create V5 API Key.
3. Imposta un passphrase (you choose it — you'll need it on every request), pick permissions (Read / Trade) and add an IP whitelist.
4. Copia il API Key, Secret and remember your passphrase — all three are required to authenticate.
OKX needs three secrets (key, secret, passphrase) — protect all of them. Use Read-only for data bots, IP-whitelist for trade keys, and never enable withdrawals on an API key unless you must. Keep them in environment variables.
Binance for liquidity, Bybit for low perp fees. Just need prices? CoinGecko. See Binance E Bybit.
Yes. Creating API keys and calling market-data endpoints costs nothing — you only pay OKX's normal trading fees on orders the API places, around 0.08-0.1% spot taker and roughly 0.05% perpetual swap taker.
Sign up and verify your identity at okx.com, go to Account then API, and click Create V5 API Key. Set a passphrase (you choose it — needed on every request), pick permissions (Read / Trade) and an IP whitelist, then copy the API Key, Secret and Passphrase — all three are required to authenticate.
OKX's v5 API sets limits per endpoint rather than one global cap: placing, amending or cancelling orders is typically 60 requests per 2 seconds per instrument, batch orders up to 300 per 2 seconds, and account/market-data endpoints like fee rates or instrument lookups are lower (5-20 requests per 2 seconds). Higher VIP fee tiers get proportionally higher limits. Exceeding a limit returns error code 50011 ("Rate limit reached").
Never share your secret or passphrase — regenerate them if leaked. Use Read-only permissions for data bots, restrict trade keys to your server's IP address, and never enable withdrawals on an API key unless you truly need it, since a leaked withdraw-enabled key can drain your account.
Browse all API guides → · trade safely — size positions with RektCalc.
Not affiliated with OKX. Exchange link is a referral link.