Skip to content

Use OpenAI in your terminal

Use OpenAI models with your own key. You pay OpenAI directly; kunji never sees your bill.

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

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

For CI or scripts you can skip the keychain:

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