Home › APIs › OKX

OKX API — how to get keys, cost & limits

✓ Ultima verifica: 15-08-2026· Fonte: pagina ufficiale dei prezzi del fornitore· Monitoraggio automatico — segnalare il cambiamento →

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.

What the API does & cost

UseCosto
Market data (REST/WS)Gratuito
Spot trading fee~0.08–0.1%
Perpetual swaps (taker)~0.05%
API accessGratuito
⚠️ The OKX API is free to use — you only pay trading fees on the trades it places. Fees and limits change; confirm on the official docs. Market-data (read-only) endpoints cost nothing. · Segnala prezzo obsoleto →
New to OKX?
Create an account with our referral link — new users can get fee discounts and a welcome reward. You support APICostCalc (we earn a small share of fees, at no extra cost to you).
Sign up on OKX →

How to get your OKX API keys (step by step)

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.

Quick test

# public ticker — no key needed (v5)
curl "https://www.okx.com/api/v5/market/ticker?instId=BTC-USDT"

Security — read this

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.

Alternatives

Binance for liquidity, Bybit for low perp fees. Just need prices? CoinGecko. See Binance E Bybit.

Domande frequenti

Is the OKX API free to use?

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.

How do I get OKX API keys?

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.

What are OKX's API rate limits?

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").

How do I keep OKX API keys secure?

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.

Ospita il tuo progetto:DigitalOcean: $ 200 gratis ↗Hostinger VPS

Scambi

BybitBinanceOKXKuCoinBitgetGate.ioMEXC

Strumenti e hosting

📈TradingView🔒NordVPN💳 RivoluzioneDigitalOcean $200HostingerIA intricata📧Icemail