Open API and connections in your OKX account
Sign in to OKX, open your Profile and choose API and connections to start your tradingview webhook automation setup.
- OKX requires a minimum balance of 100 USD on the account before it will let you create an API key
Create an API key
Click Create API key. OKX first shows the OKX API Agreement — accept it with Continue to reach the creation form.
- Each main account and sub-account can hold up to 50 active API keys
Fill in the API key form
Give the key a name you will recognise later, then set the options below. Read permission is always on and cannot be switched off.
- Used for — API trading
- Permissions — tick Trade; leave Withdraw, Earn, Loan and Transfer off
- Markets — tick Spot & Margin, plus Perpetual if you trade futures
- Crypto — add at least one coin; OKX will not let you submit the form with an empty list
- Turn on Trusted IP addresses and add
35.75.198.16— a key with trade permission and no IP linked expires after 14 days of inactivity, a linked key does not expire - Passphrase — 8–32 characters, with at least one lowercase, one uppercase, one number and one special character
Choose exchange value by OKX account region
Use the correct exchange route for your account: OKX_US (US and AU users registered on app.okx.com, API https://us.okx.com), OKX_EU (EU users registered on my.okx.com, API https://eea.okx.com), and OKX (global users registered on www.okx.com, API https://openapi.okx.com).
Save API credentials securely
Submit the form, then copy the API key, secret and passphrase before leaving the page — the secret and passphrase are shown only once and cannot be recovered. Continue to page 2 for real-time trade execution webhook setup.