1. Recharge
Go to here to recharge you account.
2. API Key
Create Bailian API Key from here.
3. Setup your AI agents
You can browse the website to find out the instructions for different AI agents. This post only lists “Claude Code” and “OpenCode”.
Claude Code
Create the “~/.calude/settings.json” file with the following content:
1 | { |
Notes
Use your API key to replace “YOUR_API_KEY”.
The “ANTHROPIC_BASE_URL” here is for the “usage-based pricing” mode. For the other modes like “token plan for team” and “coding plan”, there’re different URLs. More details can be found here. Note that if you’re out of China, the website may give you different URLs.
OpenCode
Create the “~/.config/opencode/opencode.json” file with the following content:
1 | { |
Notes
Use your API key to replace “YOUR_API_KEY”.
The “baseURL” here is for the “usage-based pricing” mode. For the other modes like “token plan for team” and “coding plan”, there’re different URLs. More details can be found here. Note that if you’re out of China, the website may give you different URLs.