Run Claude Code on a pay-as-you-go basis via Zeabur AI Hub. No monthly fees.
Anthropic launched our beloved coding tool: Claude Code, an incredible CLI tool that lets you code directly in your terminal with AI assistance. Usually, accessing the best models (like the new Sonnet or Haiku 4.5) requires a Claude Pro subscription ($20/month).
But what if you just want to try it out? Or what if you don't code enough to justify another monthly bill?
By connecting the Claude CLI to Zeabur AI Hub, you can use the exact same tool on a pay-as-you-go basis. No fixed fees—you only pay for the tokens you actually use.
Here is how to set it up in under 2 minutes.
Install Claude Code:
npm install -g @anthropic-ai/claude-code
Zeabur Credentials:
Choose your Endpoint
Zeabur currently provides two endpoints. For the fastest response time in your terminal, pick the one geographically closest to you:
https://hnd1.aihub.zeabur.ai/https://sfo1.aihub.zeabur.ai/You need to point the Claude CLI to Zeabur's server instead of the default Anthropic server.
If you want to test the waters for a single session without saving any settings:
# Choose hnd1 (Asia) or sfo1 (US)
export ANTHROPIC_BASE_URL="https://hnd1.aihub.zeabur.ai/"
export ANTHROPIC_AUTH_TOKEN="Your_Zeabur_AI_Hub_API_Key"
If you want to use this whenever you need it, add it to your profile.
Open your shell configuration (e.g., ~/.zshrc):
nano ~/.zshrc
Paste these lines at the bottom:
# Choose hnd1 (Asia) or sfo1 (US)
export ANTHROPIC_BASE_URL="https://hnd1.aihub.zeabur.ai/"
export ANTHROPIC_AUTH_TOKEN="Your_Zeabur_AI_Hub_API_Key"
Save (Ctrl+O -> Enter) and Exit (Ctrl+X).
Reload your settings: source ~/.zshrc
Now you can run the CLI tool. You will get the full power of Claude without the subscription lock-in.
# Run with the latest models
claude --model claude-sonnet-4-5
Why this is better for light users:
Happy Coding!