Skip to main content

Gemini CLI

Use Gemini CLI with NanoGPT to access Gemini, GPT, Claude, and 400+ models through a single API key.
Get started with NanoGPT for pay-as-you-go pricing with no monthly fees. Add credits and start immediately.
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 newer
This 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:

Step 3: Start Gemini CLI

From the gemini-cli folder, launch the CLI:
On first launch, the CLI may prompt you to select a theme or complete authentication required by the fork.

Models

Once connected, you can use any model listed on the NanoGPT pricing page, including:
  • google/gemini-3-pro-preview
  • google/gemini-3-flash-preview
  • openai/gpt-5.2
  • anthropic/claude-opus-4.5

Optional: Verify Your Connection

Troubleshooting