Guide
Does OKX have an API?
Yes. OKX has an API for spot trading. You create a key in the API page and set a passphrase. Nyria connects OKX with the API key, secret key and passphrase. A TradingView alert can't call the API itself. It posts to Nyria's webhook, and the bot places the order.
Official documentation
Connect OKX in six steps
- 1
Open the API page
Sign in to OKX and open okx.com/account/my-api.
- 2
Create the key
Create a new API key. Set a passphrase. OKX can't recover it.
- 3
Set the permissions
Turn on Read and Trade. Leave Withdraw off.
- 4
Copy the three values
Copy the API key, the secret key and the passphrase.
- 5
Connect OKX in Nyria
Open the OKX card on Integrations. Paste all three, then select Connect OKX.
- 6
Point TradingView at Nyria
Create a strategy with TradingView as the source. Under Notifications, tick Webhook URL, paste the strategy's URL, then select Apply.
What the API does
- OKX's API reads the account and places orders.
- Each request carries your API key and a signature.
- The passphrase is set when you create the key.
- Each key has its own permissions.
Why an alert can't call it
- A TradingView alert can't call the OKX API itself.
- It sends a webhook. Something has to place the order.
- Nyria is that receiver, and it never places an order by itself.
- Your alerts and strategy rules decide every entry and exit.
How Nyria connects OKX
- You paste the key, the secret and the passphrase once.
- Nyria stores them encrypted at rest.
- It reads the account and places and cancels orders.
- It has no feature that moves money.
- A demo key connects the demo account only.
What it can't do
- Recover a lost passphrase. OKX can't either.
- Short sell on spot.
- Let an alert set the order size.
- Move money. Withdraw stays off.
Questions
- Can a TradingView alert call the OKX API?
- No. An alert sends a webhook. Nyria receives it and places the order.
- Does Nyria need Withdraw turned on?
- No. Leave Withdraw off.
- What if I lose the passphrase?
- OKX can't recover it. Make a new key and set a new passphrase.
- Does a demo key work for a live account?
- No. A demo key connects the demo account only.
- Can I test before using real money?
- Yes. Run the strategy on Nyria Paper first. It's free.
- Which field is the secret?
- The secret key. OKX shows it with the API key.
Next
- Paste an alert into the alert tester to see how Nyria reads it.
- Step by step for one account: how to automate TradingView to OKX.
- Step by step for one account: how to automate TradingView to Nyria Paper.
- OKX integration.
Guides
How broker API trading works
What a broker API does and does not do, and the receiver that reads your alerts and places the orders for you.
Read guideHow do I send TradingView webhooks to OKX?
Paste a Nyria strategy URL into your alert. Nyria places the OKX order.
Read guideCan Nyria withdraw money from my broker account?
No. Nyria reads balances and sends orders. Your cash stays at your broker.
Read guideWhy does Nyria say OKX rejected this key?
Copy the OKX key and secret again and paste them in. A demo key only works for paper.
Read guideWhy does Nyria say the OKX passphrase is wrong?
Paste the passphrase you set. If it's lost, create a new OKX key.
Read guideWhy does Nyria say OKX blocked its IP address?
Link Nyria's IP address, 116.202.227.157, to the OKX key, then try again.
Read guideTry a paper bot first
No card required. Paper is free. Live trading from $15 a month.