Kilo Code
Kilo Code is an open-source coding agent for VS Code and the terminal. It accepts any OpenAI-compatible provider.
Show the prompt
Help me set this up to use Bayle AI, an OpenAI-compatible API. Full guide: https://docs.bayle.ai/guides/coding-tools/kilo-code/
Goal: connect the Kilo Code agent (https://kilo.ai) to Bayle as an OpenAI-compatible provider.
1. Check that Kilo Code is installed. If not, tell me to install it from the Visual Studio Marketplace (https://marketplace.visualstudio.com/items?itemName=kilocode.Kilo-Code, using "Install Pre-Release Version", which is the current extension), or install the CLI:
npm install -g @kilocode/cli
Installation guide: https://kilo.ai/docs/getting-started/installing
2. Pick a model that supports function calling:
curl -s "https://api.bayle.ai/models?type=text" \
| jq -r '.data[] | select(.model_spec.capabilities.supportsFunctionCalling) | .id'
Show me the list, let me choose, and use that id as MODEL_ID.
3. Configure it in the global file ~/.config/kilo/kilo.jsonc, merging into what is there. Keep it global: Kilo ignores {env:...} references in a project-level config, so a key there would have to be written out. The key stays a reference:
{
"provider": {
"bayle": {
"npm": "@ai-sdk/openai-compatible",
"name": "Bayle",
"options": {
"baseURL": "https://api.bayle.ai",
"apiKey": "{env:BAYLE_API_KEY}"
},
"models": {
"MODEL_ID": { "name": "MODEL_ID" }
}
}
},
"model": "bayle/MODEL_ID"
}
If I use the editor instead, walk me through Settings, then Providers, then a custom provider: Provider API "OpenAI Compatible" (not "OpenAI Responses"), Base URL https://api.bayle.ai, the model id, and my key, which I paste myself.
4. Verify with a short non-interactive Kilo run on the chosen model, or a curl to POST https://api.bayle.ai/chat/completions if there is no such mode.
Rules:
1. The base URL is https://api.bayle.ai exactly as written. Append no path to it.
2. Read the key from the BAYLE_API_KEY environment variable. Never write the key itself into a file you create, a command, a commit or the chat. Where the tool keeps the key in its own settings screen, tell me where to paste it. If BAYLE_API_KEY is not set, stop and ask me to create a key at https://chat.bayle.ai/developers and export it.
3. Take model ids only from GET https://api.bayle.ai/models (no key needed). Never guess one.
4. Finish with one real test request, show me the result and list the files you changed.Install
Section titled “Install”Install the extension from the Visual Studio Marketplace by choosing Install Pre-Release Version, which is the current extension. For the terminal agent, which reads the config file below, install the CLI:
npm install -g @kilocode/cliThe official install guide covers the other options.
Configure in the editor
Section titled “Configure in the editor”-
Open Kilo Code’s settings and go to Providers.
-
Add a custom provider and fill in:
Field Value Provider API OpenAI Compatible Base URL https://api.bayle.aiAPI key Your Bayle key Model MODEL_ID -
Save and select the model.
Pick OpenAI Compatible, not OpenAI Responses: Bayle serves chat completions only.
Configure in a file
Section titled “Configure in a file”Kilo’s config uses the same provider shape as OpenCode. In ~/.config/kilo/kilo.jsonc:
{ "provider": { "bayle": { "npm": "@ai-sdk/openai-compatible", "name": "Bayle", "options": { "baseURL": "https://api.bayle.ai", "apiKey": "{env:BAYLE_API_KEY}" }, "models": { "MODEL_ID": { "name": "MODEL_ID" } } } }, "model": "bayle/MODEL_ID"}Keep this in the global file. Kilo ignores {env:...} references in a project-level config, so
a key there would have to be written out, and that file is likely to be committed.
Pick a model
Section titled “Pick a model”curl -s "https://api.bayle.ai/models?type=text" \ | jq -r '.data[] | select(.model_spec.capabilities.supportsFunctionCalling) | .id'