Compatible tools
Terminal agentWorks

Gemini CLI · Gatelum

Gemini CLI speaks only the Gemini API, and the gateway does not serve it, so Gemini CLI itself cannot be configured. This page configures Qwen Code — a Gemini CLI fork that accepts the OpenAI protocol — with a Gemini catalog model.

Connection values · not an app screenshot

Example setup

ApplicationGemini CLI
GatelumAPI gateway
Model IDgoogle/gemini-3.8-flash
Base URL
https://api.gatelum.com/v1
Your API key
glt_YOUR_KEY

Connection steps

  1. Install Qwen Code — the Gemini CLI fork that accepts an OpenAI-compatible endpoint.

  2. Create .qwen/.env in the project: Qwen Code checks it first, then .env higher up and ~/.qwen/.env.

  3. Set OPENAI_BASE_URL to the gateway address with /v1, OPENAI_API_KEY to your Gatelum key and OPENAI_MODEL to the Gemini catalog model ID.

  4. Start qwen and send a request; the model can be changed later with /model.

.qwen/.env (Qwen Code)
# Qwen Code is a Gemini CLI fork and accepts an OpenAI-compatible endpoint
OPENAI_BASE_URL=https://api.gatelum.com/v1
OPENAI_API_KEY=glt_YOUR_KEY
OPENAI_MODEL=google/gemini-3.8-flash

Connection check

Send one short request: it checks the key, the address and the chosen model.

curl
curl https://api.gatelum.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer glt_YOUR_KEY" \
  -d '{"model":"google/gemini-3.8-flash","messages":[{"role":"user","content":"ping"}]}'

A normal answer means the setup is correct. 401 points to the key, 404 to the address or model, 400 to the request format.

Good to knowQwen Code is what gets connected, not Gemini CLI: its .qwen/.env takes OPENAI_BASE_URL, OPENAI_API_KEY and OPENAI_MODEL, and the gateway answers on /v1/chat/completions. Qwen Code checks .qwen/.env in the project first, then .env higher up and ~/.qwen/.env.
Gateway capabilities and limitsAgentic modes work because the gateway can call functions. JSON output (response_format) is accepted on OpenAI-compatible routes, while a model reachable only through a direct Anthropic or Google connection answers unsupported_capability. The retired functions format behaves differently: it returns parameter_not_supported, so no parameter disappears without an explanation. Only models the catalog tags "Understands images" may accept pictures — they travel as an image_url part holding a data:image/png;base64,… address (PNG, JPEG and WebP are allowed, a file may weigh up to 5 MB, and a request carries at most 50). Remote addresses are never downloaded, while a model lacking the tag answers bad_request. Each error, bad_request as well as parameter_not_supported, states the reason plainly.