A Bybit API key is made on the website. You sign in, go to the API management page, complete a short form and approve it by entering a code from Google Authenticator. With a key, software can act on your account, whether that is a script you wrote, a tax tool, a portfolio tracker or a trading bot. The form takes only a few minutes. Most of this guide deals with two choices in it, permissions and the IP setting, because they determine how much harm a leaked key can cause.
Decide what the key may do before you fill in the form
Give the key the smallest set of permissions that the program needs. The form lets you pick read-write or read-only access, and below that a set of boxes for the areas the key can reach, including account information, positions and orders.
Match the boxes to the tool. Reading is all a tracker or a tax tool requires. A trading bot has to place orders, and in most cases that is the only extra permission it needs.
Keep transfer and withdrawal permissions switched off unless a specific reason exists and you understand the risk. If a key limited to reading and trading leaks, nobody can use it to take funds off the exchange. Adding a permission later is simple, and spotting the need is simple too, since Bybit's error list contains a dedicated code for requests that the key's permissions do not cover.
Bound IP address or a key that expires in 90 days
The form also wants to know if the key should be limited to particular IP addresses. After you bind an address, Bybit refuses requests coming from any other place, even when the key and secret they carry are correct. For a key running on a server whose address never changes, no stronger protection is on offer.
Leaving the key unrestricted is allowed, but then it has a limited life. According to the Bybit API documentation, a key that has no IP address bound to it expires after 90 days.
Renewal is possible from the edit screen. You confirm the no-restriction setting a second time using your email and authenticator codes, and the key gains another 90 days with the key and secret unchanged.
On a home connection the address tends to change. That leaves two practical options, renewing every 90 days or moving the program onto a host that has a static address.
What you need before Bybit lets you create a key
Three conditions can stop you. First, the Bybit help center says keys can be created only on the website, and the mobile app offers no such option. Second, Google Authenticator must be active on the account, since its code is requested at the last step.
Third, a new account may face a waiting period. Bybit states that, for risk control, creating keys can be restricted for the first 48 hours that follow registration. On a brand-new account, a create button that does nothing probably has this cause.
Your region, and which Bybit entity serves you, can also change what API access you get. If your account shows no API page or a limited one, read the terms that apply to your entity.
Bybit API key creation, step by step, on the API management page
Sign in to the website and open the profile menu at the top right. Its API entry takes you to the API management page, where a button starts a new key.
The first question is the type of key. With a system-generated key, both the key and the secret come from Bybit, and most tools expect this type. The self-generated type suits users who make a key pair themselves and upload its public part.
The second question is the purpose. If the third-party application you are connecting appears in Bybit's list, choose it from that list, and the key becomes tied to that service. In other cases, configure the key for your own use. Name it so you can identify it later, for instance after the server or the script that will run with it.
Set the permissions and the IP option as described above, then approve with the authenticator code.
Storing the secret and replacing a key that leaked
Once you approve with the authenticator code, Bybit shows the API key together with the secret. Paste the secret straight into a password manager or into the secret storage of your server.
Handle the secret the way you handle a password. Keep it out of chats, screenshots, shared documents and public code repositories.
If you suspect that a key has been exposed, remove it on the API management page, then make a fresh one. Deletion is effective immediately. It is safer than changing the permissions of a key another person might be holding.
Invalid key errors caused by the wrong environment
According to the Bybit API documentation, an invalid key most often means the key was sent to an environment it does not belong to. Bybit runs demo trading, testnet and mainnet as separate environments, and each has keys of its own.
A key from the live site fails on testnet and demo endpoints, and testnet or demo keys fail on the live site. For demo trading, create the key with the site switched to demo trading mode.
Other errors and how to read them
Each remaining cause has an error of its own. A key with no bound IP that ran past its lifetime is reported as expired. A request sent from an address that the key's list does not contain is reported as an unmatched IP.
An incorrect secret, or a signature assembled incorrectly, comes back as a signature error. A drifting computer clock leads to a timestamp error, since Bybit turns down any request falling outside its time window.
Go by the error code and the message that Bybit sends back, and do not guess. Most cases clear up once you copy the key again and leave out stray spaces, sync the system clock, and check the address of the endpoint.
Common questions
Does the Bybit mobile app have an option to make API keys?
No. According to the Bybit help center, the website is the only place where an API key can be created.
When will my Bybit API key stop working?
After 90 days if it has no bound IP address, with a further 90 days available from the edit screen. A key with a bound IP address is not subject to that 90-day expiry.
My account is new and key creation fails. Why?
Bybit may restrict creating API keys for the first 48 hours after you register, as a risk control measure. Wait until that period is over and try once more.
Does a bot or tracker need withdrawal permission?
Usually not. Read and trade permissions are enough for most trackers and bots, and a leaked key that lacks withdrawal rights cannot send funds out, so turn that permission on only when the tool truly needs it.
Can I use my live key for demo trading?
No. Demo trading is a separate environment and needs its own key. Switch the site to demo trading mode, create the key in that mode, and point your requests at the demo API domain.
Which key type should I pick, system-generated or self-generated?
Most tools expect a system-generated key, where Bybit produces the key and secret. The self-generated type is meant for users who create a key pair themselves and upload its public part.
You can lose money trading crypto, and with leveraged products the entire deposit can go. This site gives no investment advice. Before you register, confirm that the exchange accepts residents of your country.
More guides in this section
- AvailabilityIs Bybit available in the USBybit is not available in the US by its own rules, which list the United States as excluded. See how that applies to nationality, residence and travel.Checked on:
- Demo tradingBybit demo tradingTurn on Bybit demo trading from the trade menu, manage the simulated balance, tell it apart from the testnet, and see what a demo result cannot show.Checked on:
- TroubleshootingBybit deposit not showing upTrace a Bybit deposit not showing up from the TXID to your balance: pending confirmations, another account, a missing memo or a case for support.Checked on:
- VerificationBybit KYC levelsCompare the three Bybit KYC levels by what each lets you do, the documents Bybit asks for, the published withdrawal limits and who cannot be verified.Checked on: