Gemini CLI

Use Gemini models in Gemini CLI through SipToken.

Before you start

  • A SipToken key in the Official group. If you don't have one yet, see Quickstart.
  • Base URL: https://api.siptoken.ai. No /v1: Gemini CLI appends /v1beta/... itself.
  • Available models: gemini-4-argon, gemini-4-neon, gemini-3.8-flash. Gemini CLI only sends Gemini-format requests, so stick to these three.

Gemini CLI also calls helper models in the background, such as small models for compressing the conversation and detecting loops. Those model names aren't on SipToken's list, so the calls fail and the matching helper features may not work. The built-in web search and web fetch tools may not work either.

Install

You need Node.js 20 or later. If you don't have it, install it from nodejs.org.

npm works on all three systems:

npm install -g @google/gemini-cli

On macOS / Linux you can also use Homebrew:

brew install gemini-cli

To try it without installing:

npx @google/gemini-cli

Check the version after installing:

gemini --version

Project page: github.com/google-gemini/gemini-cli.

Configure

You edit two files, both in the .gemini folder in your home directory:

FileWhat goes in it
settings.jsonAuth method and default model
.envKey and Base URL

macOS / Linux

The files are ~/.gemini/settings.json and ~/.gemini/.env:

mkdir -p ~/.gemini
nano ~/.gemini/settings.json

Windows

The files are %USERPROFILE%\.gemini\settings.json and %USERPROFILE%\.gemini\.env:

New-Item -ItemType Directory -Force "$env:USERPROFILE\.gemini" | Out-Null
notepad "$env:USERPROFILE\.gemini\settings.json"

settings.json contents

{
  "security": {
    "auth": {
      "selectedType": "gemini-api-key"
    }
  },
  "model": {
    "name": "gemini-4-argon"
  }
}
  • selectedType fixes the auth method to API key, so Gemini CLI stops asking how to sign in at startup.
  • model.name is the default model.
  • If the file already has other settings, merge these two in. Don't overwrite the whole file.

.env contents

macOS / Linux:

nano ~/.gemini/.env

Windows PowerShell:

notepad "$env:USERPROFILE\.gemini\.env"

The contents are the same on both systems:

GEMINI_API_KEY=sk-xxxxxxxx
GOOGLE_GEMINI_BASE_URL=https://api.siptoken.ai

Replace sk-xxxxxxxx with your key. The Base URL must start with https://.

Gemini CLI only loads the first .env it finds. It searches from the current directory upward, and only falls back to ~/.gemini/.env if it finds nothing. If your project has its own .env, ~/.gemini/.env is ignored. In that case, add the two lines to the project's .env, or use the environment variables below.

Use environment variables

Environment variables take priority over .env and settings.json. You still need the settings.json step.

To try it in the current terminal only, on macOS / Linux:

export GEMINI_API_KEY="$SIPTOKEN_API_KEY"
export GOOGLE_GEMINI_BASE_URL="https://api.siptoken.ai"
gemini

Windows PowerShell:

$env:GEMINI_API_KEY = $env:SIPTOKEN_API_KEY
$env:GOOGLE_GEMINI_BASE_URL = "https://api.siptoken.ai"
gemini

They're gone when you close the terminal. To make them permanent on macOS / Linux, add the two export lines to ~/.zshrc or ~/.bashrc. On Windows, use setx to save them as user environment variables. They apply to terminals you open afterwards:

setx GEMINI_API_KEY "sk-xxxxxxxx"
setx GOOGLE_GEMINI_BASE_URL "https://api.siptoken.ai"

Verify

gemini -p "Reply with exactly: ok"

If it returns ok, you're connected.

You can also run gemini, then type /about to confirm that the auth method is Gemini API Key and the model is the one you set.

If it fails, test the key itself with the curl commands in Quickstart. If curl works and Gemini CLI doesn't, the problem is in the configuration.

Common errors

ErrorCause and fix
When using Gemini API, you must specify the GEMINI_API_KEY environment variable.The key wasn't found. Check where .env is and the variable name, or whether another .env in the current directory takes precedence.
Please set an Auth method in your …No auth method in -p mode. Set up settings.json and .env as above.
Invalid auth method selected.GOOGLE_GEMINI_BASE_URL is set but settings.json has no selectedType. Add "selectedType": "gemini-api-key".
401, "invalid token"Usually the key is wrong or no longer valid. Check it on the Tokens page and copy it again.
403, mentions quotaUsually your balance or the key's quota is used up. Top up on the Wallet page or raise the key's quota.
404Usually the Base URL has an extra /v1 or /v1beta. Change it to https://api.siptoken.ai.
429You've hit 120 requests per minute. Helper model requests count too. Wait a moment and retry.
503, "no available channel", with the model you choseUsually a typo in the model name. Use -m gemini-4-argon or fix model.name.
503, "no available channel", with a model you didn't chooseGemini CLI is calling a helper model that SipToken doesn't have. See the FAQ below.
Says the Base URL must be HTTPSGOOGLE_GEMINI_BASE_URL starts with http://. Change it to https://api.siptoken.ai.
Timeout, 5xxUsually a temporary failure. Retry, and check the status page.

FAQ

It still asks me how to sign in

Pick Use Gemini API Key. When Gemini CLI finds GEMINI_API_KEY, it preselects this option and shows Existing API key detected (GEMINI_API_KEY). To stop the prompt for good, set selectedType in settings.json.

How do I switch models?

Start with gemini -m gemini-4-neon. To make it permanent, change model.name in settings.json, or set the GEMINI_MODEL environment variable. Command-line flags win, then environment variables, then settings.json.

What do I do about 503 errors from helper models?

Gemini CLI is calling a model name that SipToken doesn't have. It usually only affects the matching helper feature, such as automatic compression of long conversations. If the main conversation still returns normally, you can leave it.

Does signing in with a Google account go through SipToken?

No. Neither Login with Google nor Vertex AI reads your SipToken key, and their requests don't go through SipToken.

Can I use Claude or GPT models?

We don't recommend it. Gemini CLI only sends Gemini-format requests. For other models, use the matching tool, such as Claude Code or Codex.

No key yet?Sign up and top up, then create one on the Tokens page in the console.
Create one in the console →