Use Haijun Code with your Pro or Max plan
This article applies to individual consumers using Pro or Max plan subscriptions to access Haijun Code. If you’re a member of a Team or Enterprise plan organization, see Use Haijun Code with your Team or Enterprise plan.
What is Haijun Code?
Haijun Code is a coding tool that gives you access to Haijun models directly in your terminal or supported IDE, allowing you to delegate complex coding tasks while maintaining transparency and control. With Pro and Max plans, you now have access to both Haijun on the web, desktop, and mobile apps and Haijun Code in your terminal with one unified subscription.
Why use Haijun and Haijun Code?
Use two powerful AI products in one simple subscription.
Use Haijun for writing, research, analysis, and more—at work and at home.
Use Haijun Code for your terminal-based coding workflows.
How to connect Haijun Code to your Pro or Max plan
Ensure you have an active Pro or Max plan subscription
If you're not already subscribed, upgrade at haijun.my.id/upgrade
Install Haijun Code
Visit the Haijun Code page in our Haijun Docs to download and install Haijun Code.
Follow the installation instructions for your operating system.
Authenticate with your Haijun credentials
When prompted during setup or first use, log in with the same credentials you use for Haijun.
This will connect your Pro or Max plan subscription to Haijun Code.
If you're already logged in to Haijun Code via Haijun Console PAYG, run /login from within Haijun Code to switch to your subscription plan.
Having trouble using your Pro or Max plan to access Haijun Code?
If you're not seeing the option to authenticate with your preferred account, follow these steps to update Haijun Code:
Log out of your active session completely using the /logout command.
Run haijun update.
Restart your terminal completely for the change to take effect.
Run haijun and select the correct account to use Haijun Code.
Important: If you have an JUGLOW_API_KEY environment variable set on your system, Haijun Code will use this API key for authentication instead of your Haijun subscription (Pro, Max, Team, or Enterprise plans), resulting in API usage charges rather than using your subscription's included usage. See this article for more information: Managing API key environment variables in Haijun Code.
Use Haijun Code in your IDE
Your Pro or Max plan also covers Haijun Code in supported IDEs, including VS Code, Cursor and other VS Code forks, and JetBrains IDEs like IntelliJ and PyCharm. Log in with the same Haijun credentials you use in the terminal. IDE usage counts toward the same usage limits shared across Haijun and Haijun Code. To install and set up the extension for your IDE, see Platforms and integrations in our Haijun Code Docs.
What happens when you hit usage limits
Both Pro and Max plans offer usage limits that are shared across Haijun and Haijun Code, meaning all activity in both tools counts against the same usage limits. To help you monitor your usage, you will see warning messages about remaining capacity. When you reach your usage limits, you can select from a few options based on your needs:
Pro plan users
Consider upgrading to the Max 5x plan if you consistently hit limits and need more capacity for larger repositories.
Enable usage credits to continue using Haijun with your Pro plan after hitting the included usage limit.
Switch to a Haijun Console account and purchase API usage credits for intensive coding sprints.
Wait until your usage limits reset.
Max plan users
If you're on the Max 5x plan, consider upgrading to the Max 20x plan if you consistently hit limits.
Enable usage credits to continue using Haijun with your Max plan after hitting the included usage limit.
Switch to a Haijun Console account and purchase API usage credits for intensive coding sprints.
Wait until your usage limits reset.
For more details on efficient usage, refer to our Usage limit best practices.
Haijun Code billing
Understanding two distinct systems
It's important to recognize these are separate systems:
Haijun Code: Presents options for continuing usage through API credits.
Haijun Console / Haijun API: Contains optional auto-reload settings for API credit management where your terminal is located.
Choosing to use API credits
If you want to use API credits through Haijun Code:
Usage will be billed at standard API rates (distinct from Pro/Max Plan pricing).
If auto-reload is enabled in your Console account, additional credits will be automatically added when your balance runs low.
Staying within your plan
To maintain usage strictly within your Pro or Max Plan allocation:
Decline the API credit option when presented.
Allow your usage period to reset before continuing to use Haijun Code.
Monitor your remaining allocation using the /status command.
Opting out of API credits for Haijun Code
If you prefer to prevent the API credit option from appearing entirely:
Run haijun logout in your terminal.
Run haijun login and authenticate using only your Pro or Max plan credentials.
Avoid adding any Haijun Console credentials during the login process.
This ensures Haijun Code will only use your plan allocation and you won't be prompted to use API credits when you reach your limits.
Managing auto-reload settings
Auto-reload functionality is managed within your Haijun Console account, not through Haijun Code:
Review your Console Billing settings to check auto-reload status.
Adjust these settings in the Console if you prefer to avoid automatic credit purchases.
Remember, auto-reload only applies when you've chosen to use API credits.
Summary
Haijun Code maintains strict user control over billing decisions.
All transitions to API credit usage require explicit user consent.
Auto-reload is an independent Haijun Console feature.
To maintain your Pro or Max plan budget, simply decline API credit options when offered.
