Skip to main content

Gemini CLI

Gemini CLI is Google’s official command-line interface for interacting with Gemini models. This guide shows you how to configure it to use KiosAPI.

Prerequisites

  • Node.js 20+ — check with node --version
  • A KiosAPI API key (starts with sk-) created in the Gemini group

Get the right API key

Gemini models on KiosAPI are served through the Gemini group (0.05× multiplier):
  1. Log in to the KiosAPI Dashboard.
  2. Go to Console → Tokens → Add Token.
  3. Select the group Gemini.
  4. Save and copy the key.
A key from another group cannot call Gemini models. If you get a model-not-found error, check the token’s group first. See Choosing a Token Group.

Installation

Install Gemini CLI globally via npm:
Verify the installation:

Current Gemini models on KiosAPI

The authoritative list is the Models & Pricing page (filter by the Gemini group).

Configuration

1. Set the base URL

Create ~/.gemini/.env:
The base URL must end with a trailing slash /. Gemini CLI appends the API path after it.

2. Configure settings

Create ~/.gemini/settings.json:

3. Start Gemini CLI

On first launch, if prompted to select an authentication method, choose API key — not Google Login. Gemini CLI will read the key from GOOGLE_API_KEY in ~/.gemini/.env.

Usage

Interactive mode

Direct question

Switching models

Inside the interactive session:

Troubleshooting

401 Unauthorized / Invalid API key

  • Ensure GOOGLE_API_KEY contains your KiosAPI key (sk-...), not a Google AI key
  • Ensure auth.selectedType is api-key in ~/.gemini/settings.json
  • If the CLI still tries Google Login, remove cached auth: delete ~/.gemini/oauth_creds.json and restart

Model Not Found / No Available Channel

  • Verify your token is in the Gemini group
  • Verify the model name is current (old names like gemini-2.5-pro no longer exist) — check the pricing page

Connection Error

  • Ensure GOOGLE_GEMINI_BASE_URL is https://kiosapi.com/ with the trailing slash
  • Check your network connection

Verify Your Setup

Need Help?