Skip to main content

Gemini CLI Custom Base URL with v1beta

· One min read
AI Supermarket
AI API Gateway Docs

Gemini CLI users often search for GOOGLE_GENAI_API_VERSION or custom Base URL setup details. This is a strong long-tail niche because the query usually comes from someone who is already configuring a client.

With AI Supermarket, Gemini CLI uses the gateway root:

https://aisupermarket.work

and the API version is set separately:

GOOGLE_GENAI_API_VERSION=v1beta

macOS / Linux

export GOOGLE_GEMINI_BASE_URL="https://aisupermarket.work"
export GOOGLE_GENAI_API_VERSION="v1beta"
export GEMINI_API_KEY="your-api-key"
export GEMINI_MODEL="your-gemini-model"

Windows PowerShell

$env:GOOGLE_GEMINI_BASE_URL="https://aisupermarket.work"
$env:GOOGLE_GENAI_API_VERSION="v1beta"
$env:GEMINI_API_KEY="your-api-key"
$env:GEMINI_MODEL="your-gemini-model"

Common Mistake: Adding /v1beta Twice

Some clients expect the root URL and append the version path themselves. If you put /v1beta in both the Base URL and the version variable, the final request path may be wrong.

Use:

GOOGLE_GEMINI_BASE_URL=https://aisupermarket.work
GOOGLE_GENAI_API_VERSION=v1beta

Model Name Checklist

Before debugging code, confirm:

  • your Key group supports Gemini-compatible calls
  • the model name is available for your account
  • GEMINI_MODEL matches the exposed model name
  • the terminal session was restarted after setting variables