okxapi-keyexchange-connectionerror-50119trading-botsevergreen

How to connect your OKX API key and fix error 50119

October 18, 2026·10 min read
How to connect your OKX API key and fix error 50119

Your OKX API key can be valid and still return “API key doesn't exist.” If an EEA key reaches the global API instead of OKX Europe’s infrastructure, recreating the key will not solve the problem. I’ll show you how to connect your OKX API key, choose the right account region, and diagnose the error before changing credentials.

The critical check is the combination of credentials and regional endpoint. A correctly copied key sent to the wrong regional host can fail before its permissions become relevant.

A valid OKX API key can fail at the wrong regional endpoint

A tempting response to a failed connection is to generate another key, paste it again, and try more permissions. That approach treats every authentication failure as a credential problem.

OKX’s regional structure makes that assumption unreliable.

OKX Europe Limited is a separate MiCA-regulated entity, licensed through Malta’s MFSA. EEA accounts live on my.okx.com, and their API keys are valid only against OKX Europe’s API infrastructure.

Send a perfectly valid EEA key to the global www.okx.com API, and the response can be 50119: “API key doesn't exist.” The key exists, but the request has reached the wrong regional endpoint.

US accounts have their own regional host, us.okx.com. Their connections also need the corresponding regional infrastructure.

OKX account regionRelevant regional hostAccount region to select in Anny
Globalwww.okx.comGlobal
EEAmy.okx.comEEA
USus.okx.comUS
BrazilGlobal platform: www.okx.comGlobal

Brazilian OKX accounts use the global platform and the same API, so select Global. A local market presence does not automatically imply a separate API region.

I start troubleshooting here because changing a passphrase or broadening permissions cannot correct a regional mismatch. The request must reach the infrastructure that recognizes the key.

How to create an OKX API key with the permissions you need

A connection should receive enough access to perform its intended task. Granting additional permissions to make an error disappear is a poor diagnostic method.

For portfolio visibility, use Read. Add Trade only when you intend to use bots that place orders.

Never enable Withdrawal for this connection.

Step-by-step OKX API key setup

  1. Open API management in your OKX account.
  2. Sign in to the account you want to connect and navigate to its API management area. Establish whether that account belongs to Global, EEA, or US before creating the key.

    1. Create a dedicated API key for the connection.
    2. Give it a recognizable name so you can identify its purpose when reviewing access later. A dedicated key also makes it easier to change or revoke this connection’s access separately.

      1. Set the API passphrase during creation.
      2. This is a passphrase you choose for the API key. It is not your OKX account password, and you will need it alongside the API key and secret when connecting.

        1. Enable Read for portfolio visibility.
        2. If your purpose is to view portfolio information, start with Read access. A visibility-only connection does not need trading permission.

          1. Add Trade only for bots that need to place orders.
          2. Trade permission authorizes trading activity. Enable it deliberately for that purpose, not as an experiment to resolve an authentication error.

            1. Leave Withdrawal disabled.
            2. Portfolio visibility and bot order placement do not require withdrawal permission. Do not grant it to complete this setup. Keep in mind that disabling withdrawals does not prevent trading losses: a key with Trade permission can still place loss-making orders, so limit the funds held in the account a trading connection can reach.

              1. Bind the key to the connection’s IP addresses where available.
              2. Use the IP addresses specified by the service making the API requests. Keep that configuration aligned with the connection you actually use.

                1. Store the API key, secret, and passphrase securely.
                2. Treat them as credentials. When entering them in the connection form, check that every value is complete and belongs to the same API key.

                  Creating the key is only part of the setup. The receiving connection must also know which regional host to use.

                  Why IP whitelisting matters

                  IP binding restricts where a key can be used. It also matters for key lifecycle: OKX can delete inactive API keys that have no IP binding, so a key you created and left unused may no longer exist when you return to it.

                  Do not assume that a key remains active simply because you still have its credentials saved. Check its status in OKX API management.

                  There is a separate configuration issue to watch for: an active key can reject a request when the requester’s IP is absent from its whitelist. That produces an IP-specific error, which should send you to the IP settings rather than back to key creation.

                  Why OKX says “API key doesn't exist” when the key is valid

                  The phrase sounds definitive. Its diagnostic meaning is narrower than it appears.

                  For an EEA account, error 50119 can mean that the global endpoint does not recognize a key that is valid on OKX Europe’s infrastructure. If a connection guide never asks which entity your account belongs to, it cannot surface this case.

                  The regional split is documented, not a theory about credentials

                  The OKX EEA API FAQ documents the my.okx.com regional context and EEA-only key validity. Public issue reports in Freqtrade, CCXT, and Hummingbot also corroborate the pattern of EEA users receiving “API key doesn't exist” when their integration uses the global host.

                  Those reports support checking the regional endpoint. They do not establish that every occurrence has the same cause.

                  My diagnostic conclusion is straightforward: verify account region before replacing a key that OKX still lists as active. If a connector assumes every account uses the global API, repeated key creation leaves that assumption untouched.

                  Other causes of error 50119 still need checking

                  A regional mismatch is not the only explanation. The same error can also involve:

                  • A demo-trading key used in the wrong environment. Confirm that the credentials match the environment the connection expects.
                  • An automatically deleted key. Check whether the key still exists in OKX API management.
                  • A truncated paste. Make sure the complete API key was entered.
                  • A genuinely unknown key. Confirm that the credentials came from the intended account.

                  I would check these possibilities in sequence rather than change everything together. If you replace the credentials, permissions, environment, and region at once, a successful retry tells you very little about what was wrong.

                  The useful question is: Does this endpoint recognize this active key for this account and environment?

                  Decode the OKX error code before retrying

                  A failed connection is a symptom. The OKX error code is the more useful evidence.

                  The public OKX API error-code reference distinguishes an unknown key from a wrong passphrase, an invalid signature, and an IP restriction. Each points to a different part of the connection.

                  Error codeMeaningWhat to check
                  50119API key doesn't existAccount region and regional host; demo versus intended environment; whether the key was deleted; whether the pasted key is complete
                  50105Wrong API passphraseUse the passphrase set when this API key was created, not the account password
                  50113Invalid signatureCheck the API secret and the integration’s request-signing implementation
                  50110Request IP is not whitelistedCheck whether the requester’s IP is included in the key’s allowed IP configuration

                  Error 50105: check the API passphrase

                  The API passphrase is a separate credential. Entering your OKX login password in that field does not satisfy it.

                  Also check that the passphrase belongs to the same key as the API key and secret. Mixing credentials from different creation attempts can leave you with values that look individually plausible but do not belong together.

                  Error 50113: investigate request signing

                  An invalid signature points to the authentication signature on the request. Check the API secret and, if you maintain the integration, its signing implementation.

                  If you use a connection form, consult the connector’s support or technical documentation to investigate request signing. Enabling Trade or Withdrawal is not a fix for an invalid signature.

                  Error 50110: inspect the IP whitelist

                  This error directs you to the allowed IP configuration. Verify the IP used by the service making the request, then compare it with the key’s whitelist.

                  Blindly retrying the same request leaves the mismatch in place. Correct the relevant setting before testing again.

                  How to connect OKX to Anny

                  My connection form includes an Account region selector with Global, EEA, and US options. That selection ensures the key is verified against the appropriate regional host.

                  Here is the connection process:

                  1. Open the add-exchange form and choose OKX.
                  2. Have your API key, secret, and API passphrase ready.

                    1. Select your Account region.
                    2. Choose EEA for an OKX Europe account, US for an OKX US account, or Global for an account on the global platform. Brazilian accounts select Global.

                      1. Enter the matching credentials.
                      2. Paste the complete API key and secret, then enter the passphrase you set at key creation.

                        1. Confirm the permissions match your purpose.
                        2. Use Read for portfolio visibility. Add Trade only for bots, and leave Withdrawal disabled.

                          1. Verify the connection.
                          2. If it fails, use the returned error code to choose the next check. For 50119, revisit the region before creating another key.

                            Connect OKX to Anny

                            Selecting a region is an authentication requirement, not a display preference. It determines where the credentials are checked.

                            How to use the OKX API docs when troubleshooting

                            If you are connecting through an existing form, the region selector and error table are the practical starting points. If you maintain an integration, read the regional guidance alongside the authentication documentation.

                            The relevant parts of the OKX API docs answer different questions:

                            • Regional API guidance: Which infrastructure should receive this account’s requests?
                            • Authentication guidance: Which credentials are required, and how must requests be signed?
                            • Error-code reference: Which part of the submitted request was rejected?

                            A correct signing implementation can still send a request to the wrong regional host. A correct regional host can still reject an incorrect passphrase.

                            I keep those checks separate because they lead to different corrections. A successful connection requires the endpoint, credentials, environment, permissions, and IP configuration to agree.

                            Frequently asked questions about OKX API connections

                            Does an OKX API key expire?

                            Do not assume an API key remains available indefinitely. OKX can delete inactive keys that have no IP binding, so check API management if previously saved credentials stop working.

                            Bind the key to the connection’s specified IP addresses where available, and verify that the key is still active before troubleshooting its passphrase or permissions.

                            Why does my valid OKX API key say it doesn't exist?

                            A valid key can return 50119 when it is sent to the wrong regional endpoint. In particular, an EEA key belongs on OKX Europe’s infrastructure; sending it to the global www.okx.com API can produce “API key doesn't exist.”

                            Also check for a demo-environment mismatch, an automatically deleted key, or an incomplete paste.

                            Which permissions does an OKX trading bot need?

                            Use Read for portfolio visibility and add Trade when the bot needs to place orders. Never enable Withdrawal for this connection.

                            Extra permissions do not solve a regional mismatch, wrong passphrase, invalid signature, or IP whitelist error.

                            Is the OKX API passphrase the same as my password?

                            No. The API passphrase is set when you create the API key and is separate from your OKX account password.

                            Enter the passphrase associated with that specific key.

                            Which region should a Brazilian OKX account select?

                            Select Global. OKX Brazil operates on the global platform and uses the same API.

                            Should I create a new key whenever the connection fails?

                            No. Read the error code first and check the setting it identifies.

                            For 50119, confirm the regional host, environment, active key status, and completeness of the pasted value. A new key will not repair a connection that keeps sending it to the wrong regional endpoint.

                            The next useful action is a diagnosis, not another identical retry. Start with the region, read the code, and change the setting the evidence points to.

                            This article is educational and is not financial advice. Past performance ≠ future results. Anny is an AI-powered analytics platform, not a registered investment adviser.