Skip to content

How to use Gemini CLI with a 5abeer API key

Install Gemini CLI, put the 5abeer base URL, your key and a model in ~/.gemini/.env, pick API key sign-in and run it on Gemini models from your balance.

Updated October 31, 2026

Waiting for a test run on the staging stack before publishing

On this page

To use Gemini CLI with 5abeer, install Gemini CLI, then put three variables in ~/.gemini/.env: the 5abeer base URL, your 5abeer API key and a model. Choose API key sign-in, run gemini in your project and ask for anything. Every request is paid from your 5abeer balance. With a subscription, the 5abeer AI app does this setup for you.

What you get#

  • Gemini CLI exactly as it ships, with its commands and settings.
  • The Gemini models that support the Gemini format at 5abeer, below their official price.
  • Usage and cost per key in your dashboard.

Before you start#

  • A terminal on macOS, Linux or Windows.
  • Node.js 20 or newer, if you install Gemini CLI with npm.
  • An API key for Gemini models (create one).

With a subscription: the 5abeer AI app#

If you have a 5abeer subscription that includes Gemini, the 5abeer AI app sets Gemini CLI up on your subscription in one click, with no API key and no files to edit. The app runs on Mac, Windows and Linux; the steps are in How a subscription works. With an API key, follow the manual setup below.

Manual setup#

  1. Install Gemini CLI#

    npm install -g @google/gemini-cli
  2. Add the settings#

    Gemini CLI reads three variables from ~/.gemini/.env: GOOGLE_GEMINI_BASE_URL for the base URL, GEMINI_API_KEY for your key, and GEMINI_MODEL for the model. Put these values in it, replacing YOUR_5ABEER_API_KEY with your key:

    GOOGLE_GEMINI_BASE_URL=https://api.5abeer.ai
    GEMINI_API_KEY=YOUR_5ABEER_API_KEY
    GEMINI_MODEL=gemini-4-argon
    

    ~/.gemini/.env

  3. Sign in with the API key#

    Set the sign-in method to the API key in ~/.gemini/settings.json, or choose "Use Gemini API Key" when Gemini CLI asks on its first run:

    ~/.gemini/settings.json
    {
      "security": {
        "auth": {
          "selectedType": "gemini-api-key"
        }
      }
    }
  4. Run it#

    Terminal
    cd your-project
    gemini

    On the first run in a new folder, Gemini CLI may ask whether you trust it; agree so it reads the settings. Then ask for anything: if a reply comes back, you're set.

Pick a model#

Every model that supports the Gemini format at 5abeer runs in Gemini CLI. Each model's page in the models list shows the formats it supports; put the model id in GEMINI_MODEL.

If you get an error#

Every code and what it means is in Errors and fixes.

Questions#

Do I need a Google account?#

No. With API key sign-in, Gemini CLI sends your 5abeer key from GEMINI_API_KEY to the 5abeer base URL, so you don't sign in with Google.

Why does Gemini CLI still ask me to sign in?#

The sign-in method isn't set to the API key yet. Add the settings.json block above, or choose "Use Gemini API Key" in the prompt, then run gemini again.

Can I use Claude or GPT models in Gemini CLI?#

No. Gemini CLI speaks only the Gemini format, so it runs the models that support that format at 5abeer, with a key for Gemini models.

How is a request billed?#

Each request is paid from your balance by the tokens it uses, at the model's 5abeer price. Details in Pricing and balance.