How to use Gemini CLI with any AI model

Run Gemini 3 Flash and Pro through AnyModel's OpenAI-compatible endpoint — and switch to GPT or Claude with a one-word change to the model id.

Setup

  1. 1.
    Create a free account and copy your API key.
  2. 2.

    Run one command — it writes the config for you:

    bash <(curl -fsSL "https://anymodel.org/i?tool=codex&model=gemini-3-flash-preview") <YOUR_API_KEY>

    On Windows, use the PowerShell variant from your Instructions page (the key is shown there).

  3. 3.
    Start coding. Switch models any time by changing the model id — same key, same endpoint.

Popular models for Gemini CLI

See all on the models page, or compare two side by side.

FAQ

Do I need a subscription to use Gemini CLI?

No. AnyModel is pay-per-token — you start on free credits (1,000,000 tokens, 6,000,000 if you link Telegram) and then pay only for what you use, no subscription.

Which models can I use in Gemini CLI?

All of them — GPT, Claude, Gemini, DeepSeek, Qwen and more, through one endpoint. You switch by changing the model id.

Is my data stored?

By default we keep request history. For sensitive work, turn on Ghost Mode for a zero-retention key — prompts and responses aren't stored on our side.