Skip to content

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. 1

    Open the API page

    Sign in to OKX and open okx.com/account/my-api.

  2. 2

    Create the key

    Create a new API key. Set a passphrase. OKX can't recover it.

  3. 3

    Set the permissions

    Turn on Read and Trade. Leave Withdraw off.

  4. 4

    Copy the three values

    Copy the API key, the secret key and the passphrase.

  5. 5

    Connect OKX in Nyria

    Open the OKX card on Integrations. Paste all three, then select Connect OKX.

  6. 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

Try a paper bot first

No card required. Paper is free. Live trading from $15 a month.