AI providers

OpenAI, Anthropic, Ollama or fully offline: set up your keys.

gitmit supports five providers:

ProviderNeedsData leaves your machineDefault model
accountgitmit login, with a key saved in your gitmit accountYes, after the secret scan, through gitmit's serverYour saved model, or the provider's default
openaiOPENAI_API_KEYYes, after the secret scangpt-5-mini
anthropicANTHROPIC_API_KEYYes, after the secret scanclaude-opus-5-5
ollamaOllama running locallyNo (unless OLLAMA_HOST points to another machine)llama3.2
rulesNothingNoNo model; template messages

Adding an API key

Put keys in your personal gitmit file, which lives outside every repository so it can never be committed by accident:

SystemFile
macOS and Linux~/.config/gitmit/.env (or $XDG_CONFIG_HOME/gitmit/.env)
Windows%APPDATA%\gitmit\.env
mkdir -p ~/.config/gitmit
echo 'OPENAI_API_KEY=sk-...' >> ~/.config/gitmit/.env

The file can hold any of these:

OPENAI_API_KEY=
OPENAI_MODEL=           # optional, default gpt-5-mini
ANTHROPIC_API_KEY=
ANTHROPIC_MODEL=        # optional, default claude-opus-5-5
OLLAMA_HOST=            # optional, default http://localhost:11434
OLLAMA_MODEL=           # optional, default llama3.2

Environment variables with the same names work too, and take priority over the file.

Your gitmit account

Instead of putting a key on every computer, you can save it once in your gitmit account and use it everywhere: on the website, in the CLI and in VS Code.

  1. Go to gitmit-frontend.vercel.app/account, sign in with GitHub, and save your OpenAI or Anthropic key.
  2. In your terminal, run gitmit login. It shows a short code; approve it on github.com.
  3. In VS Code, run gitmit: Sign In with GitHub.

That's it: gitmit now uses your saved key wherever you're signed in. gitmit account shows what's saved, and gitmit logout signs this computer out.

How your key is protected:

  • Write-only. Once saved, the key can't be read back by anyone, including you. The website only shows its last four characters.
  • Encrypted. Keys are encrypted with AES-256-GCM. The encryption key is kept only in the server's environment, never in the database.
  • Your code stays on your machine. The CLI and VS Code read, filter and secret-scan your changes locally, and send only the final summary, the same text the AI provider would receive. gitmit's server adds your key and passes it on.
  • Nothing is logged. Not prompts, not diffs, not keys.
  • You're in control. Sign out any device, remove a key, or delete your account and everything in it, from the account page.

Accounts are optional. Everything else in this section works without one.

Which provider is used

  1. --provider on the command line, if given.
  2. provider in your gitmit config, if set.
  3. Otherwise, the first provider with a local key: OpenAI, then Anthropic.
  4. Otherwise, your gitmit account, if you're signed in.
  5. Otherwise, the offline rules provider.

Run gitmit config at any time to see which provider and model will be used.

Using Ollama (local models)

ollama pull llama3.2
gitmit --provider ollama

Or set "provider": "ollama" in your config. Nothing leaves your machine, so no secret scan is needed. If OLLAMA_HOST points to another machine, gitmit treats it as remote and scans first.