> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://respan.ai/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://respan.ai/docs/_mcp/server.

# Gemini CLI (gateway)

> Set up Gemini CLI with the Respan gateway.

Route Gemini CLI's LLM calls through the Respan gateway for automatic logging, caching, and model switching. Only your `RESPAN_API_KEY` is needed.

## Setup

#### Install Gemini CLI

```bash
npm install -g @google/gemini-cli
```

#### Set environment variables

Add to your shell profile (`.bashrc`, `.zshrc`, or PowerShell `$PROFILE`):

```bash
# Gemini API
export GOOGLE_GEMINI_BASE_URL="https://api.respan.ai/api/google/gemini"
export GEMINI_API_KEY="YOUR_RESPAN_API_KEY"
```

No separate Google API key needed — the Respan gateway handles provider authentication.

#### Run Gemini CLI

```bash
gemini "your prompt"
```

All LLM calls now route through Respan.

## Switch models

Once routed through the gateway, you can use any supported Gemini model.

```bash
gemini --model gemini-3.5-flash
gemini --model gemini-3.1-flash-lite
gemini --model gemini-3.1-pro-preview
```

See the [full model list](https://platform.respan.ai/platform/models).