Source: https://ailoot.ai/docs/integrations/gemini-cli/
Canonical: https://ailoot.ai/docs/en/integrations/gemini-cli/
Language: en

[Terminal agents](https://ailoot.ai/docs/en/integrations/#agents) 

# Gemini CLI

[Markdown](https://ailoot.ai/docs/en/integrations/gemini-cli/index.md)

Terminal agent · Gemini

| Format | Where to set it up |
| --- | --- |
| Gemini | GEMINI\_API\_KEY and GOOGLE\_GEMINI\_BASE\_URL environment variables; authentication method: ~/.gemini/settings.json → security.auth.selectedType = "gemini-api-key"; model: GEMINI\_MODEL or the -m flag |

## [](https://ailoot.ai/docs/integrations/gemini-cli/#setup)Setup

Copy the configuration and replace `sk-...` with your key from the Ailoot Dashboard. Prefer storing the key in the environment variable `AILOOT_API_KEY`, if the application supports it.

Before starting, request GET /v1/models with your Ailoot key. Choose an exact model ID whose methods include POST /v1beta/models/{model}:generateContent, then use that ID in the configuration. For agents, also check tool support and the features required by your client version.

```bash
export AILOOT_API_KEY="sk-..."
export GEMINI_API_KEY="$AILOOT_API_KEY"
export GOOGLE_GEMINI_BASE_URL=https://api.ailoot.ai
export GEMINI_MODEL=gemini-3.8-flash
gemini
```

`~/.gemini/settings.json`

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

Example model: `gemini-3.8-flash`. Choose any other model from the [catalog](https://ailoot.ai/models/en/) — check that it supports the format you need.

## [](https://ailoot.ai/docs/integrations/gemini-cli/#notes)Good to know

Use an address without /v1beta: the SDK appends /v1beta/models/{model}:generateContent automatically. The address must use HTTPS. The key is sent in the x-goog-api-key header, which Ailoot accepts. Only models listed with the Gemini format in the catalog are suitable. Before running a request, check that the exact ID and this method are available to your key. Ailoot delivers paid Gemini responses in full after calculating the cost, not word by word, so text takes longer to appear for long responses.

## [](https://ailoot.ai/docs/integrations/gemini-cli/#check)Test

- For the Gemini format, the URL is `https://api.ailoot.ai` without `/v1beta`.
- Ask a short question. If you get an error, check the code and Request ID, then consult [Errors and limits](https://ailoot.ai/docs/en/errors/).
- `404`: `https://api.ailoot.ai` → `/v1beta/models/{model}:generateContent`. Before starting, request GET /v1/models with your Ailoot key. Choose an exact model ID whose methods include POST /v1beta/models/{model}:generateContent, then use that ID in the configuration. For agents, also check tool support and the features required by your client version.
- 402 — insufficient balance for the reserve. Agents reserve more than chat: [why](https://ailoot.ai/docs/en/billing/reserve/).

Application documentation: [https://geminicli.com/docs/reference/configuration/](https://geminicli.com/docs/reference/configuration/)

Still have questions? Send your Request ID and a description — we'll help you troubleshoot.[Contact support](mailto:support@ailoot.ai)

## Ailoot · The company and its project portfolio





Ailoot combines established operating experience, a large client base, stable service and ongoing KPI control.





The company and its project portfolio: millions of customers; monthly sales in the billions.





Ailoot brings that operating experience to API access for AI features in customer products, agents, applications and automations.
