An API key lets a program act on your Bybit account: a trading bot, a portfolio tracker, a tax tool or your own script. Creating one takes a few minutes, but the choices made in the form decide how much damage a leaked key could do. This guide goes through the form in order and then covers the errors people hit most often afterwards.
Before you start
Bybit's help center says API keys can only be created on the website. The mobile app has no option for it. You also need Google Authenticator enabled on the account, because the final step asks for its code.
New accounts may have to wait. Bybit states that key creation can be restricted for the first 48 hours after registration for risk control. If the create button does not work on a brand-new account, that is the likely reason.
API access can also depend on your region and on the Bybit entity that serves you. If the API page is missing or limited in your account, check the terms that apply to your entity.
Create the key
Log in on the website, open the profile menu at the top right and choose the API entry. This opens the API management page. Select the button to create a new key.
Bybit asks first which kind of key you want. A system-generated key gives you a key and a secret produced by Bybit and is what most tools expect. A self-generated key is for users who create their own key pair and upload the public part.
Next you say what the key is for. If you are connecting a third-party application that Bybit lists, choose it from the list so the key is tied to that service. Otherwise set it up as a key for your own use and give it a name you will recognise later, such as the name of the script or server that will use it.
Choose the narrowest permissions
The form lets you make the key read-only or read-write, and then tick the individual areas it may touch, such as orders, positions and account information. A tracker or tax tool only needs to read. A trading bot needs order permissions but usually nothing else.
Leave withdrawal and transfer permissions off unless you have a specific reason and understand the risk. A key that can only read and trade cannot move funds off the exchange if it leaks. Bybit's own error list has a dedicated code for a request that the key's permissions do not allow, so a missing permission is easy to diagnose and add later.
Bind an IP address, or accept the expiry
The form asks whether the key should work only from specific IP addresses. With an address bound, a request from anywhere else is refused even if the key and secret are correct. This is the strongest protection available for a key that runs on a server with a fixed address.
A key with no IP restriction is allowed, but it does not last. Bybit's API documentation states that a key created without a bound IP address expires after 90 days. You can extend it for another 90 days from the edit screen by confirming the no-restriction setting again with your email and authenticator codes, and the key and secret stay the same.
For a home connection with a changing address, the practical choice is either to accept the 90-day renewal or to run the program from a host with a static address.
Save the secret
After you confirm with the authenticator code, Bybit shows the API key and the secret. Copy the secret straight into a password manager or your server's secret storage. Treat it like a password: do not paste it into chats, screenshots, shared documents or a public code repository.
If you suspect a key has been exposed, delete it on the API management page and create a new one. Deleting is immediate and is safer than editing permissions on a key someone else may hold.
Why Bybit says the key is invalid
The most common cause, according to Bybit's API documentation, is that the key does not match the environment it is sent to. Mainnet, testnet and demo trading are separate environments with separate keys. A key made on the live site does not work against the testnet or demo endpoints, and the reverse is also true. A demo trading key has to be created while the site is in demo trading mode.
The other causes each have their own error. An expired key with no bound IP is reported as expired. A request from an address that is not on the key's list is reported as an unmatched IP. A wrong secret or a wrongly built signature is reported as a signature error. A computer clock that has drifted produces a timestamp error, because Bybit rejects requests outside its time window.
Read the error code and message that Bybit returns instead of guessing. Copying the key again without stray spaces, syncing the system clock and checking the endpoint address resolve most cases.
Questions and answers
- Can I create a Bybit API key in the app?
- No. Bybit's help center says API keys can only be created on the website.
- How long does a Bybit API key last?
- A key created without a bound IP address expires after 90 days and can be extended for another 90 days from the edit screen. Binding an IP address avoids that 90-day expiry.
- Why can I not create a key on my new account?
- Bybit may restrict API key creation for the first 48 hours after registration for risk control. Try again once that period has passed.
- Should I enable withdrawal permission on a key?
- Only if the tool truly needs it. Most trackers and bots work with read and trade permissions, and a key without withdrawal rights cannot send funds out if it leaks.
- Do I need a separate key for demo trading?
- Yes. Demo trading is a separate environment. Switch the site to demo trading mode and create the key there, then send requests to the demo API domain.
Crypto trading carries a high risk of loss, and leveraged products can lose your whole deposit. Nothing here is investment advice. Check that the exchange is available in your country before you sign up.
Related guides
- AvailabilityIs Bybit available in the USBybit lists the United States as an excluded jurisdiction. What that means for registration, identity verification, existing accounts and travel, based on Bybit's published rules.
- Demo tradingBybit demo tradingWhat Bybit demo trading is, how it differs from the testnet, how to enter and leave demo mode, how demo funds work, and which parts of live trading it does not reproduce.
- TroubleshootingBybit deposit not showing upA step-by-step check for a crypto deposit that has not appeared on Bybit: confirmations, the wrong account view, network and memo mistakes, unsupported tokens, Travel Rule requests, and what to send support.
- VerificationBybit KYC levelsWhat each Bybit identity verification level asks for, what it unlocks, the withdrawal limits Bybit publishes for each level, and how to decide which level you need.