Connect Kilo CLI to ModelGo: Setup & Troubleshooting
Kilo CLI is a terminal coding agent that connects to ModelGo through a custom OpenAI-compatible provider. You need an API key from the ModelGo Console and a logical model ID from the Model Catalog.
1. Install
bash
npm install -g @kilocode/cli
kilo --version2. Add a ModelGo provider
Edit the global config ~/.config/kilo/kilo.jsonc. {env:MODELGO_API_KEY} is resolved only in trusted locations such as the global config; in a project-level kilo.jsonc committed to a repository it is ignored and authentication fails.
jsonc
{
"$schema": "https://app.kilo.ai/config.json",
"model": "modelgo/your-model-id",
"provider": {
"modelgo": {
"options": {
"apiKey": "{env:MODELGO_API_KEY}",
"baseURL": "https://api.modelgo.ai/v1"
},
"models": {
"your-model-id": {
"name": "ModelGo / your-model-id",
"tool_call": true
}
}
}
}
}bash
export MODELGO_API_KEY="mgk_your_api_key"Set baseURL to https://api.modelgo.ai/v1; do not append /chat/completions. Alternatively choose /connect → OpenAI Compatible in the TUI and enter the same Base URL, key, and model ID.
3. Verify
bash
curl https://api.modelgo.ai/v1/models \
-H "Authorization: Bearer $MODELGO_API_KEY"
kiloSelect modelgo/your-model-id in the model picker and send a small read-only task.
Troubleshooting
- The provider is missing: check the JSONC syntax of
~/.config/kilo/kilo.jsonc, the provider ID, and themodelpath, then restart Kilo. - 401: confirm
MODELGO_API_KEYis exported and the config lives in the globalkilo.jsonc. - 404:
baseURLmust be exactlyhttps://api.modelgo.ai/v1, not a full endpoint path.