Gemini configuration

Use Gemini through the dedicated Gemini channel. Create a dashboard API key, choose Gemini as its channel, and use that key in your client. The channel changes consumption speed (0.5×); it does not change the amount of token quota you purchased.

Supported models

ModelChannelInputCacheOutput
gemini-3.5-flashGemini · default0.500.051.50
gemini-3.7-flashGemini0.500.051.50
gemini-3.8-flashGemini · new0.500.051.50

Prices shown are the effective Gemini-channel rates in USD per 1M tokens (the upstream rates multiplied by the channel's 0.5× consumption factor). Gemini models cannot be called with AWSQ, CCMAX, or Codex keys.

Gemini CLI

Install the official Gemini CLI with Node.js 18 or newer:

1
npm install -g @google/gemini-cli
2
gemini --version

Point the CLI at this service and authenticate with your dashboard key:

1
export GEMINI_API_KEY="YOUR_DASHBOARD_API_KEY"
2
export GOOGLE_GEMINI_BASE_URL="https://aiinide.com/api/gemini"
3
gemini

Never put the server's upstream GEMINI_API_KEY in a client. Use the key generated in your own dashboard.

Environment variables

The same variables can be used by Gemini-compatible tools. The base URL stops at /api/gemini; the client appends the v1beta/models/... path.

1
export GEMINI_API_KEY="YOUR_DASHBOARD_API_KEY"
2
export GOOGLE_GEMINI_BASE_URL="https://aiinide.com/api/gemini"

Generate content

The REST endpoint follows the Gemini generateContent format:

1
curl https://aiinide.com/api/gemini/v1beta/models/gemini-3.8-flash:generateContent \
2
  -H "x-goog-api-key: $GEMINI_API_KEY" \
3
  -H "Content-Type: application/json" \
4
  -d '{
5
    "contents": [{
6
      "role": "user",
7
      "parts": [{"text": "Explain this repository in three bullet points."}]
8
    }],
9
    "generationConfig": {"temperature": 0.2}
10
  }'

The model can also be sent in the request body. The URL model and body model should match. The proxy forwards the request upstream and records usage after the response.

Streaming responses

Use streamGenerateContent and keep the response stream open with curl -N:

1
curl -N "https://aiinide.com/api/gemini/v1beta/models/gemini-3.8-flash:streamGenerateContent?alt=sse" \
2
  -H "x-goog-api-key: $GEMINI_API_KEY" \
3
  -H "Content-Type: application/json" \
4
  -d '{
5
    "contents": [{"role": "user", "parts": [{"text": "Summarize this code."}]}]
6
  }'

Troubleshooting

  • 401: use a valid, non-expired dashboard key with the Gemini channel.
  • 400: check the model name and make sure the key belongs to the Gemini channel.
  • 429: the API key's purchased quota or request limit has been reached.
  • 503: the Gemini upstream is temporarily unavailable; retry later.

Do not use the Anthropic-compatible /api/anthropic endpoint for Gemini requests. Gemini requests must use /api/gemini.

Gemini configuration - AI in IDE Documentation | AI in IDE | Affordable AI Coding in Your IDE