AI Summary
Show More
Quickly grasp the article's content and gauge market sentiment in just 30 seconds!
OpenClaw is a popular open-source generative AI assistant that’s available for free under the MIT license. It acts as an AI assistant and agentic AI tool, but it requires a backend LLM engine, such as Claude Sonnet, Gemini Flash, OpenAI GPT. OpenClaw is one of the AI assistants capable of connecting to and interacting with a Bybit AI Subaccount. Connecting OpenClaw to your AI Subaccount allows you to automate many of the trading tasks on Bybit.
In this guide, we cover the steps for Bybit’s web and mobile app versions to link your OpenClaw assistant to your Bybit AI Subaccount. We’ll also discuss some common problems that may arise during the connection setup and typical ways to resolve them.
Key Takeaways:
OpenClaw is one of several AI assistants that can be configured to connect to your Bybit AI Subaccount and execute automated trading actions on your behalf.
To establish the connection, you’ll need an OpenClaw installation with a functioning backend model, such as Claude Sonnet, Gemini Flash or many of the other LLMs that OpenClaw can utilize.
For security purposes, during the connection setup, OpenClaw might require that you complete the private API key input manually, outside of the AI assistant’s interface.
1) Go to your Profile icon on the Bybit homepage, then Subaccount → Create Subaccount on your Subaccount Management page.
2) Choose AI Subaccount for the account type you wish to create.
3) Type the name for your Subaccount — for example, OpenClaw Trading — then choose AI Subaccount for AI agents and Confirm.
4) Provide the security verification code sent to you, and click on Next Step to create your Subaccount.
5) After you receive a message that your Subaccount has been created, click on Connect to AI.
6) Copy the instruction prompt under the Get your Public Key section. You’ll need to paste this into OpenClaw in the next step.
1) On the Bybit App homepage, tap on your Profile icon in the top-left corner and go to Settings → Subaccount → Create.
Alternatively, you can also create your Subaccount using the Account Switch feature, available on the Account Info and Assets pages. To create an AI Subaccount, simply tap on the Create button in the bottom-right corner.
2) Enter the Subaccount name (e.g., OpenClaw Trading), select AI Subaccount and then tap on Create.
3) Complete the security verification, then tap on Connect to AI Assistant.
4) Copy the instruction prompt under the Get your Public Key section. You’ll need to paste this into OpenClaw in the next step.
1) Open OpenClaw and paste the prompt copied in the previous step into the AI assistant. The AI assistant will access the instructions in the provided link and generate your public key.
2) Copy the public key generated by OpenClaw. You’ll need this for the next step.
1) Return to the Bybit interface and paste the public key into the Generate your API Key field, then click on Confirm and provide the security verification code.
2) Bybit will generate your API Key. Copy it and provide it to OpenClaw.
3) OpenClaw will ask you to manually enter the API Key within the .env file located in the workspace of your OpenClaw installation. This is done for security purposes. In the .env text file, for the BYBIT_API_KEY= field, replace PASTE_YOUR_API_KEY_HERE with your actual API Key. After that, your AI assistant will be able to connect to your Bybit AI Subaccount.
1) Return to the Bybit interface and paste the public key into the Generate your API Key field, then click on Confirm and provide the security verification code.
2) Bybit will generate your API Key. Copy it and provide it to OpenClaw.
3) OpenClaw will ask you to manually enter the API Key within the .env file located in the workspace of your OpenClaw installation. This is done for security purposes. In the .env text file, for the BYBIT_API_KEY= field, replace PASTE_YOUR_API_KEY_HERE with your actual API Key. After that, your AI assistant will be able to connect to your Bybit AI Subaccount.
To configure permissions for your newly created AI Subaccount, go to your Subaccount Management page. Next to your AI Subaccount name, click on Settings, then Permissions.
1) Go to the Subaccount Management page by tapping on your Profile icon in the top-left corner, then go to Settings → Subaccount.
2) Locate your Subaccount, then tap on More → Permissions.
Some of the key recommended starting permissions include the following:
Request Transfer In: ON
Cap Limit: 500 USD
Max Margin Leverage: 5x
Request Transfer Out: ON
For detailed information on risk management for your Bybit AI Subaccount, check out this resource.
When OpenClaw manages to successfully link to your AI Subaccount, you should see a message confirming the connection.
Try running a few simple queries to see the results and test the connection, such as asking to list your balance, performing a small trade and listing your trade history.
Common issues you may encounter and ways to resolve them include the following:
Invalid public key message: Ensure there are no extra spaces when copying the key. Also, note that the key must be copied together with the starting — BEGIN PUBLIC KEY — and ending — END PUBLIC KEY — clauses.
API key expired: Note that keys expire after 30 days. You’ll need to regenerate a new key on Bybit.
Permission denied: Check permission settings from your Main Account.
Connection timeout: Verify your internet connection, and try again.
Using OpenClaw, you can now access a wide range of automated trading actions through your Bybit AI Subaccount. These include conducting Spot and Derivatives trades, setting up automated strategies, monitoring your positions and PnL and transferring funds between your accounts.
#LearnWithBybit