Kilo Code
Connect Kilo Code (VS Code, JetBrains, CLI) to GreenPT Code via its OpenAI Compatible provider with model auto-detection.
Kilo Code is an open-source agentic coding platform available as a VS Code extension, JetBrains plugin, and CLI. Its OpenAI Compatible provider connects to any Chat Completions-style endpoint, and it can auto-detect GreenPT's model list — making setup faster than most tools.
Prerequisites
- Kilo Code installed (VS Code, JetBrains, or CLI)
- A GreenPT API key from your GreenPT dashboard
Setup (VS Code / JetBrains)
- Click the gear icon in the Kilo Code panel to open settings.
- Under API Provider, choose OpenAI Compatible.
- Fill in the fields:
| Field | Value |
|---|---|
| Provider API | OpenAI Compatible (Chat Completions) |
| Base URL | https://api.greenpt.ai/v1 |
| API Key | Your GreenPT API key (raw, no Bearer prefix) |
| Models | Select from the auto-fetched list (see below) |
- Click Submit. GreenPT's models appear in the model picker.
Automatic model detection
Once you enter a valid Base URL and API key, Kilo Code queries GreenPT's
/v1/models endpoint and shows a searchable picker with all models available on
your account — no manual model-ID typing needed. Select the models you want
(e.g. glm-5.3 and deepseek-v4.1-flash) and submit.
If auto-detection fails, enter the model IDs manually — they must exactly match
GreenPT's /v1/models response, including case.
Recommended models
glm-5.3z.aiFlagshipThe newest z.ai flagship reasoning model, successor to glm-5.2, with agentic tool-use at the same price.
Use it for: The default: agentic, multi-file work across a large codebase.
deepseek-v4.1-flashDeepSeekDeepSeek V4.1 Flash, a multimodal reasoning model with a 1M-token context window for chat and agentic coding.
Use it for: Routine edits, quick questions and test runs, at a fraction of the cost.
Setup (CLI) — kilo.jsonc
The Kilo Code CLI bundles @ai-sdk/openai-compatible as its default fallback
provider. Add GreenPT to your kilo.jsonc config:
{
"$schema": "https://app.kilo.ai/config.json",
"model": "greenpt/glm-5.3",
"provider": {
"greenpt": {
"name": "GreenPT",
"options": {
"apiKey": "{env:GREENPT_API_KEY}",
"baseURL": "https://api.greenpt.ai/v1"
},
"models": {
"glm-5.3": {
"name": "GLM-5.3",
"tool_call": true,
"cost": {
"input": 1.1,
"output": 4.4
},
"limit": {
"context": 1000000,
"output": 32768
}
},
"deepseek-v4.1-flash": {
"name": "DeepSeek V4.1 Flash",
"tool_call": true,
"cost": {
"input": 0.22,
"output": 1.1
},
"limit": {
"context": 1000000,
"output": 32768
}
}
}
}
}
}Set the key in your shell:
export GREENPT_API_KEY="your-greenpt-key"Notes:
limit:limit.contextis the model's context window; if it stays unset (0), conversations grow without being compacted.limit.outputis the reply budget Kilo requests; 32,768 leaves room for reasoning tokens.cost: prices per million tokens, used for Kilo's in-session cost display. Values above match GreenPT's EU pricing so the display matches your actual billing.tool_call: true: required for agentic use; both models support tool calling.
Verify the connection
curl https://api.greenpt.ai/v1/models \
-H "Authorization: Bearer $GREENPT_API_KEY"You should get back a list including the model IDs above. This is also the endpoint Kilo's auto-detection uses — if this call works, the model picker will populate.
Troubleshooting
| Symptom | Fix |
|---|---|
| Models don't appear in auto-detect picker | Confirm the curl check above works; Base URL must expose /v1/models |
| "Model Not Found" | Model ID must exactly match GreenPT's /v1/models response (case-sensitive) |
| 401 Unauthorized | Paste the key raw — no Bearer prefix in the API Key field |
| Connection errors | Verify the Base URL and that GreenPT's endpoint is reachable from your network |
| CLI shows provider but wrong model responds | Set "model": "greenpt/<model-id>" at the top level of kilo.jsonc so the default doesn't fall back to another provider |
| Conversations never compact (CLI) | limit.context is unset for that model — add the real context size |