Kilo CLI
Kilo CLI is an open source, terminal-based AI coding tool. Connect it to Openference to use high-quality models directly from your terminal. With Kilo CLI, you can:- Edit code across multiple files without leaving the terminal
- Generate, explain, and refactor code with AI assistance
- Automate repetitive tasks such as writing unit tests, fixing bugs, and reviewing changes
- Switch between models based on task complexity
Prerequisites
Before you begin:- An Openference account and API key (create one at openference.com)
- Node.js 18.0 or later
Install Kilo CLI
Install Kilo CLI globally:Get your API key
Create an API key in the Openference dashboard. Copy it — it is shown only once. You will use theOPENFERENCE_API_KEY environment variable.
Configure the connection
Edit the Kilo CLI configuration file:~/.config/kilo/kilo.jsonc:
Tip: theExport your API key in the shell (add to your profile for persistence):limitblock tells Kilo each model’s real context window and max output. Without it, coding agents assume a small default (~128k) and start compacting the session around ~100k tokens. Current values are advertised ascontext_lengthandmax_output_tokensinGET /v1/models.
Select a model and start coding
- Run
/modelsin Kilo CLI and select the Openference provider. - Pick a model (e.g.
openference/GLM-5.2).
Recommended models
When configuring or picking a default model, use the models in this order:- GLM-5.2 — top tier (most capable for complex reasoning, agents, and architecture)
- Kimi K2.6 — all rounder (strong general-purpose choice for most tasks)
- DeepSeek-V4-Pro — medium (balanced performance and value)
- Qwen3.7 Plus — Vision (use when you need image / multimodal understanding)
- DeepSeek-V4-Flash — instant (fast and lightweight responses)
Always verify the exact IDs available to your key:
FAQ
I get an error or no response after connecting
- Verify that
OPENFERENCE_API_KEYis exported in the current shell. - Confirm the model name exactly matches an ID from
GET /v1/models(including spaces and casing). - Check JSON syntax in
config.json(missing commas are a common cause).
How do I switch models?
Run/models inside Kilo CLI, search for Openference, and select a different model. You can also edit the models block in config.json and restart.