> ## Documentation Index
> Fetch the complete documentation index at: https://apione.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Gemini CLI to APIONE

> Use APIONE through the Gemini-compatible API from your terminal.

## Prepare

Install [Gemini CLI](https://geminicli.com/docs/get-started/installation/), create an [APIONE key](https://apione.ai/en/app/api-keys), and copy the ID of a model supporting the Gemini protocol.

## Windows installation

Install and check the version in PowerShell.

```powershell theme={null}
npm install -g @google/gemini-cli
gemini --version
```

![PowerShell showing added 12 packages after installing Gemini CLI](https://mintcdn.com/apione/-Fh541-B7_4U7vxR/images/integrations/screenshots/gemini-cli-install-powershell.png?fit=max\&auto=format\&n=-Fh541-B7_4U7vxR\&q=85\&s=a8f855efad12dd0c20ca619ebeffe130)

Example output of installing Gemini CLI in Windows PowerShell.

The image shows `added 12 packages`. After installation, run `gemini --version` to confirm the command is available before proceeding with configuration.

## Configure authentication and the endpoint

Add the following to `~/.gemini/.env`, where \~ is your home directory:

```dotenv theme={null}
GEMINI_API_KEY=YOUR_APIONE_KEY
GEMINI_MODEL=YOUR_APIONE_MODEL_ID
GOOGLE_GEMINI_BASE_URL=https://api.apione.ai
GOOGLE_GENAI_API_VERSION=v1beta
```

Replace the key and model placeholders. Use the root address here; the client appends the API version and model path.

Start `gemini` and select API Key authentication. If you already have settings.json, merge this without removing other settings:

```json theme={null}
{"security":{"auth":{"selectedType":"gemini-api-key"}}}
```

## Verify

```bash theme={null}
gemini -p "Reply with OK only." --output-format json
```

After receiving a response, test reading a file in a test project. Verify tool calls separately from basic text generation.

## Troubleshoot

* A Google login prompt usually means the selected authentication mode is not API Key.
* For 404, check that /v1beta is not duplicated and that the model supports Gemini.
* For tool errors, check model capabilities and CLI version before modifying local code.
* If environment settings are ignored, stop the old process and launch from a new terminal that loads them.

See the [official configuration reference](https://geminicli.com/docs/reference/configuration/) for current fields.

***

[Integration directory](https://apione.ai/docs/en/guides/clients.md) · [Choose a model](https://apione.ai/docs/en/models/catalog.md) · [Troubleshooting](https://apione.ai/docs/en/support/errors.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.