Setup guide · Gemini API
Gemini CLI is Google's terminal coding agent. The BangunWeb router now speaks the Gemini API format, so Gemini CLI can use every model we sell, not only Gemini: DeepSeek, GPT, Kimi and even Claude. Set three environment variables and go.
The three values you need
https://router.bangunweb.combwr_live_YOUR_KEYbw-focusSign in and create an API key to have the blocks below filled in automatically. Until then you will see the example bwr_live_YOUR_KEY.
Install it from the official instructions, for example npm install -g @google/gemini-cli (needs Node.js 20 or newer).
Sign in to the BangunWeb AI dashboard, open the Keys tab and copy a key starting with bwr_live_.
The base URL for Gemini CLI has NO /v1. GEMINI_MODEL must be one of our model names, for example bw-focus. Without it Gemini CLI uses Google's default model name, which is not in our catalog.
Write the settings.json below, or when Gemini CLI first asks how to sign in, choose "Use Gemini API key". Otherwise you get "Invalid auth method selected".
# macOS / Linux (bash, zsh) export GOOGLE_GEMINI_BASE_URL="https://router.bangunweb.com" export GEMINI_API_KEY="bwr_live_YOUR_KEY" export GEMINI_MODEL="bw-focus" gemini
# Windows PowerShell $env:GOOGLE_GEMINI_BASE_URL="https://router.bangunweb.com" $env:GEMINI_API_KEY="bwr_live_YOUR_KEY" $env:GEMINI_MODEL="bw-focus" gemini
// ~/.gemini/settings.json
{
"security": { "auth": { "selectedType": "gemini-api-key" } },
"model": { "name": "bw-focus" }
}Open your project folder and run gemini. Type /about to see the active model. Switch any time with /model or gemini -m bw-swift.
Every catalog model works through Gemini CLI. Tool calling (read/write files, shell commands) was tested with bw-focus, deepseek-v4-pro, deepseek-v4.1-flash and gemini-3.8-flash. Use bw-swift for light tasks to save tokens.
If this command replies with text, your key and model are correct. Any remaining problem is in the tool settings.
curl "https://router.bangunweb.com/v1beta/models/bw-focus:generateContent" \
-H "x-goog-api-key: bwr_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"contents":[{"role":"user","parts":[{"text":"Halo"}]}]}'Pulled from the live catalog: only models that are currently active. Mode names (bw-...) never change and automatically fail over to a backup model when the main one has trouble.
| Model | Best for | Estimated cost per step | Success, 7 days |
|---|---|---|---|
Focus (DeepSeek V4 Pro)mode
bw-focus
|
Everyday coding agent. The main pick.reads images | $0.0028 | 99.9% |
DeepSeek V4 Pro
deepseek-v4-pro
|
The model behind Focus, if you want a fixed model.reads images | $0.0028 | 99.9% |
Swift (DeepSeek V4.1 Flash)mode
bw-swift
|
Light tasks, summaries, titles, the small model.reads images | $0.00078 | 100% |
GPT 6 Sol
gpt-6-sol
|
Complex logic and code review.reads images | $0.0013 | 100% |
Apex (Claude Opus 5.5)mode
bw-apex
|
The hardest tasks. Much higher cost per request.reads images | $0.080 | 99.3% |
Claude Sonnet 5.5
claude-sonnet-5.5
|
Claude directly. Use sparingly.reads images | $0.052 | 100% |
One step = one typical coding-agent request (about 20 thousand tokens in and 1 thousand out) at the Saver package rate. A coding agent can send dozens of steps for a single task.
Gemini CLI does not know you use an API key yet. Write the settings.json above (security.auth.selectedType = gemini-api-key) and run it again.
GEMINI_MODEL was not picked up, so Gemini CLI fell back to Google's default model. Set GEMINI_MODEL=bw-focus in the same terminal, put "model": {"name": "bw-focus"} in settings.json, or run gemini -m bw-focus.
GOOGLE_GEMINI_BASE_URL or GEMINI_API_KEY is not set in this terminal. Check with echo $GEMINI_API_KEY.
In non-interactive mode (gemini -p), trust the folder once in interactive mode, or set GEMINI_CLI_TRUST_WORKSPACE=true.
The key was copied wrong or has been revoked. Copy it again from the Keys tab in the AI dashboard (it starts with bwr_live_), with no leading or trailing spaces.
Your token balance is empty or too low for one request on that model. Top up tokens, or switch to a cheaper model such as bw-swift.
The model name must exactly match the list at GET https://router.bangunweb.com/v1/models (lowercase, with dots and hyphens). Do not add prefixes such as openai/.
For OpenAI-style tools the base URL must end with /v1. For Anthropic-style tools (Claude Code) the base URL has NO /v1.
Reasoning models spend part of the tokens on thinking. Raise max tokens (at least 1024) or remove the limit in the tool settings.
Coding agents send large contexts. Use bw-swift for light tasks, and start a new task when the conversation gets very long.
One key for DeepSeek, GPT, Claude and dozens of other models. Pay per token, no subscription. Sign up free, get 2M test tokens.