Skip to content

Use Google Gemini in your terminal

Google AI Studio has a free tier, which makes Gemini a good first provider.

  1. Create an API key at https://aistudio.google.com/apikey.
  2. Run kunji keys add gemini and paste the key. kunji checks it works, then stores it in your OS keychain.
  3. Pick a default model from the list (type to search).
  4. Run kunji and start chatting.
Provider id gemini
Type OpenAI-compatible API
API address https://generativelanguage.googleapis.com/v1beta/openai
Key variable GEMINI_API_KEY or GOOGLE_API_KEY
Terminal window
kunji models gemini # see available models
kunji use gemini:<model> # make one your default
kunji chat -m gemini:<model> # or chat with it once

Inside a chat, switch to it with /model gemini:<model>; the conversation carries over.

For CI or scripts you can skip the keychain:

Terminal window
export GEMINI_API_KEY=your-key-here
kunji ask -m gemini:<model> "Hello"