Gemini CLI
Use Gemini CLI with NanoGPT to access Gemini, GPT, Claude, and 400+ models through a single API key.Gemini CLI is Google’s official command-line interface for Gemini. The official CLI only targets Google endpoints, so use the community fork that adds OpenRouter and OpenAI-compatible support to point it at NanoGPT.
Step 1: Install the OpenRouter Fork
Prerequisites: Node.js 18 or newerThis fork is community maintained. If the branch name changes or is missing, check the repository README for the latest OpenRouter-compatible branch.
Step 2: Configure NanoGPT
1
Get API Key
- Go to NanoGPT API
- Create an account or log in
- Copy your API key (starts with
sk-nano-)
2
Set Environment Variables
Set the base URL and API key in the same shell where you will run the CLI:For persistent configuration, add the exports to your shell profile:
- macOS/Linux
- Windows PowerShell
Step 3: Start Gemini CLI
From thegemini-cli folder, launch the CLI:
Models
Once connected, you can use any model listed on the NanoGPT pricing page, including:google/gemini-3-pro-previewgoogle/gemini-3-flash-previewopenai/gpt-5.2anthropic/claude-opus-4.5