Skip to main content

kunji

Bring your own key. Every AI model in one clean, professional terminal.

Kunji (कुंजी) means "key" in Hindi.

CI License Python Providers Platforms

┌─  kunji chat  ─────────────────────────────────────────────────┐
│  Provider     Model            Key         Budget        State │
│────────────────────────────────────────────────────────────────│
│  Anthropic    claude-sonnet    keychain    $0.38 / $2    READY │
└────────────────────────────────────────────────────────────────┘
enter send  ·  alt+enter newline  ·  / commands  ·  ctrl+d quit

› explain recursion in one line
  A function that solves a problem by calling itself on a smaller
  piece of it, until it reaches a case simple enough to answer.
  claude-sonnet · 18 in · 31 out · $0.0005 · 1.2s

› /model groq:llama-3.3-70b-versatile
✓ Switched to groq:llama-3.3-70b-versatile  conversation kept

Kunji is a terminal app for chatting with any AI model using your own API keys. You pay each provider directly. Kunji never sees your bill, your keys or your prompts.

Why kunji

  • One tool, every provider. OpenAI, Anthropic, Google Gemini, Groq, OpenRouter, DeepSeek, Mistral, xAI, Together, Ollama (local), plus any OpenAI-compatible server.
  • Switch models mid-conversation with /model — the conversation carries over.
  • Live cost meter. Every reply shows tokens and cost. /cost and kunji usage show totals, in your currency.
  • Daily budgets. Warns at 80%, blocks at 100%, per provider or overall.
  • Compare mode. One prompt, several models, side by side — fastest and cheapest highlighted.
  • Automatic fallback. Rate-limited or down? Kunji retries on your next model.
  • Keys in your OS keychain (Windows Credential Manager, macOS Keychain, Secret Service), never in a plain-text file.
  • Pipes. npm test 2>&1 | kunji ask "why is this failing?"
  • Looks professional. Minimal monochrome design, responsive to any terminal size.

Install

Requires Python 3.11+.

pipx install kunji        # recommended
# or
uv tool install kunji
# or
python -m pip install --user kunji
System Easiest way
Windows pipx install kunji, or download kunji-windows-x64.exe from the latest release (no Python needed)
macOS pipx install kunji
Linux pipx install kunji, or download kunji-linux-x64 from the latest release

winget, Scoop and Homebrew packages are on the roadmap.

Quick start

kunji keys add            # pick a provider, paste your key, choose a default model
kunji                     # start chatting

Free and local? Install Ollama, then kunji keys add ollama.

Commands

Command What it does
kunji / kunji chat Interactive chat (-m provider:model, -s "system prompt")
kunji ask "…" One-shot answer. Reads piped input. --raw for scripts
kunji compare "…" -m a -m b Same prompt to several models, side by side
kunji keys add [provider] Add or replace a key (verified, then saved to the keychain)
kunji keys list / test / remove Manage keys (always masked)
kunji models [provider] Live model list with prices
kunji use provider:model Set your default model
kunji providers Supported providers; providers add for custom servers
kunji usage Tokens and cost per model (stored locally only)
kunji budget set <provider|all> <amount> Daily spending limit
kunji config show / set / path Settings
kunji doctor Check Python, config, keychain and providers

In chat

Input Action
/model provider:model Switch model (tab completes)
/models [filter] List models of the current provider
/cost Session and today's cost
/system … Set the system prompt
/retry · /clear · /save [file] Regenerate · new conversation · export markdown
enter · alt+enter / ctrl+j Send · new line
ctrl+c · ctrl+d Stop the reply · quit

Providers

ID Provider Key env variable
openai OpenAI OPENAI_API_KEY
anthropic Anthropic ANTHROPIC_API_KEY
gemini Google Gemini GEMINI_API_KEY / GOOGLE_API_KEY
groq Groq GROQ_API_KEY
openrouter OpenRouter OPENROUTER_API_KEY
deepseek DeepSeek DEEPSEEK_API_KEY
mistral Mistral MISTRAL_API_KEY
xai xAI XAI_API_KEY
together Together AI TOGETHER_API_KEY
ollama Ollama (local) none

Any OpenAI-compatible server (LM Studio, vLLM, LiteLLM proxy…):

kunji providers add lmstudio --base-url http://localhost:1234/v1 --no-key

Security and privacy

  • API keys are stored only in your operating system's credential store, or read from environment variables. They are sent only to the provider they belong to.
  • Kunji's config file never contains keys. Errors are scrubbed so keys never appear on screen.
  • Usage and cost history stay on your machine (kunji config path).
  • Network calls kunji makes on its own: the public model price list (OpenRouter, plus this repo's catalog/pricing.json) and the PyPI version check. Neither sends anything about you. Turn them off with kunji config set network.catalog false and kunji config set updates.check false.
  • Found a vulnerability? Please follow SECURITY.md.

Details: docs/PRIVACY.md.

Configuration

kunji config set display.currency INR
kunji config set display.usd_rate 84          # your conversion rate
kunji budget set all 200                      # ₹200/day across every provider
kunji config set fallback '["groq:llama-3.3-70b-versatile", "ollama:qwen2.5"]'

All options: docs/CONFIG.md.

Free and Pro

Everything that runs on your machine is free and open source, forever — chat, switching, keys, cost meter, budgets, compare, fallback, pipes. A future optional Pro plan will add cloud features that need a server (sync across devices, shared team keys with per-person budgets, a smart router). See ROADMAP.md.

Contributing

Bug reports, ideas and pull requests are welcome — start with CONTRIBUTING.md. Architecture overview: docs/ARCHITECTURE.md.

License

Apache-2.0. "kunji" and the kunji logo are not covered by the license; please use a different name for forks.

Metadata

Release files for kunji 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kunji 0.1.0
File Size Uploaded Provenance Actions
kunji-0.1.0.tar.gz 49.2 kB With provenance Details for kunji-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kunji 0.1.0
File Interpreter ABI Platform Actions
kunji-0.1.0-py3-none-any.whl Python 3 none any Details for kunji-0.1.0-py3-none-any.whl

Total release size: 101.1 kB

Release files / kunji-0.1.0.tar.gz

Download URL kunji-0.1.0.tar.gz
Size 49.2 kB
Tags Source
SHA-256 checksum
How to use checksums
68c8b5aa491749aa0ef7ebfe8b10bc10c7798a953f4fb128341caad0e0712473
BLAKE2b-256 checksum
How to use checksums
fa3035f185f48b0871efabd6528bc33786de911cb97f134dd235da5586a62d95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Release files / kunji-0.1.0-py3-none-any.whl

Download URL kunji-0.1.0-py3-none-any.whl
Size 51.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0338a498bfe3be8bc7fabef86fa5d8ed1feb0e679501e071e00b4a682c605ec4
BLAKE2b-256 checksum
How to use checksums
608850eacc77c9977ad8cf4e831dc662efc554d19e4ace1cd0fe8f351cb3077f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Security for kunji 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kunji-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page