Connect Gemini CLI
Route Gemini CLI through AnyInt's Gemini-compatible gateway with an API key.
Gemini CLI supports a custom Gemini API origin when using API-key authentication. AnyInt exposes the Gemini Developer API under the /gemini gateway root.
Before You Start
- Install or update Gemini CLI from the official Gemini CLI repository.
- Create an AnyInt API key.
- Choose a Gemini-compatible model ID from the model catalog.
Configure the Gateway
Gemini CLI reads GEMINI_API_KEY for API-key authentication and the base-URL variable shown below for the API origin.
export ANYINT_API_KEY="your_api_key"
export GEMINI_API_KEY="$ANYINT_API_KEY"
export GOOGLE_GEMINI_\
BASE_URL="https://api.anyint.ai/gemini"
export GEMINI_MODEL="YOUR_MODEL_ID"Start the CLI and choose Use Gemini API key when prompted:
geminiVerify and Troubleshoot
- A
401response means the AnyInt key was not supplied or is inactive. - A model error means
GEMINI_MODELdoes not name a Gemini-compatible model available to the key. - Remove conflicting Google Cloud authentication variables while isolating an API-key setup problem.
- Keep
.envfiles containing keys out of source control. Gemini CLI also supports a user-level.gemini/.envfile when you need persistent local configuration.
See the official Gemini CLI configuration and authentication documentation for current variable behavior.