Skip to content

Use OpenRouter in your terminal

OpenRouter gives you hundreds of models from many companies with one key, and kunji reads its prices automatically.

  1. Create an API key at https://openrouter.ai/keys.
  2. Run kunji keys add openrouter 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 openrouter
Type OpenAI-compatible API
API address https://openrouter.ai/api/v1
Key variable OPENROUTER_API_KEY
Terminal window
kunji models openrouter # see available models
kunji use openrouter:<model> # make one your default
kunji chat -m openrouter:<model> # or chat with it once

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

For CI or scripts you can skip the keychain:

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