Skip to content

Gemini CLI

Gemini CLI uses the Gemini v1beta protocol. With QuotaAPI, set the Base URL to https://quotarouter.ai and use the API Key created in the console.

Environment variables

Gemini clients may read different variable names. Prefer the names documented by your client. A common setup is:

bash
export GEMINI_BASE_URL="https://quotarouter.ai"
export GEMINI_API_KEY="YOUR_QUOTAAPI_KEY"

If the client expects the full API prefix, use:

bash
export GEMINI_BASE_URL="https://quotarouter.ai/v1beta"

Which form is correct depends on whether the client appends /v1beta automatically. If you see a duplicated /v1beta/v1beta path, change the Base URL back to https://quotarouter.ai.

List models

bash
curl "https://quotarouter.ai/v1beta/models?key=YOUR_QUOTAAPI_KEY"

After the model list works, test generateContent:

bash
curl "https://quotarouter.ai/v1beta/models/gemini-3.5-pro:generateContent?key=YOUR_QUOTAAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [
          { "text": "Reply with a short Gemini CLI test message." }
        ]
      }
    ],
    "generationConfig": {
      "maxOutputTokens": 80
    }
  }'

Model names

Common Gemini examples:

ModelGood for
gemini-3.5-proGeneral reasoning, writing and code understanding
gemini-3.1-pro-previewPreview testing, with stability depending on console availability

If you add a Gemini model in the console but the CLI still fails, check:

  1. The model is enabled in a Gemini group.
  2. The API Key has access to that group.
  3. The client sends the exact model name shown in the console.
  4. The Base URL is not producing an incorrect path.

Troubleshooting

  • API key not valid: confirm that the key is a QuotaAPI API Key.
  • model not found: check model name, group permissions and console model list.
  • 404: usually a Base URL path issue, especially duplicated /v1beta.
  • 403: the key does not have access to a Gemini group.

QuotaAPI is an AI API relay service for developers and teams.