July 30, 2026
Kilo Code Custom Provider Setup: Base URL, Model ID, and Verification
Connect Kilo Code to a custom OpenAI-compatible provider, verify a real request, and fix empty model lists, invalid URLs, and model ID errors.
Kilo Code can connect to an OpenAI-compatible API without a provider-specific integration. The setup fails most often for ordinary reasons: the base URL is missing /v1, the model selector uses a display name instead of an API ID, or the provider can answer chat requests but its /models endpoint is not being reached.
The fastest way through is to configure one exact model, verify the API outside Kilo Code, and only then give the agent a repository task. This guide uses GlideflowAI as the compatible endpoint, but the same checks apply to another service when you substitute its URL, key, and model ID.
Add a custom provider in Kilo Code
Kilo Code’s current custom-model documentation describes this UI path:
- Open Kilo Code settings with the gear icon.
- Open Providers.
- Scroll to the bottom of the provider list.
- Choose Custom provider.
- Give the provider a local ID and display name.
- Keep the provider API set to OpenAI Compatible.
- Enter the base URL and API key.
- Fetch or add a model, then save the provider.
Use these values:
| Field | Value |
|---|---|
| Provider ID | glideflow |
| Display name | GlideflowAI |
| Provider API | OpenAI Compatible |
| Base URL | https://api.glideflowai.com/v1 |
| API key | Your restricted Glideflow key |
| Model ID | glm-5.2 |
The provider ID is local configuration. The model ID is sent to the API and must match the catalog exactly. GLM-5.2, glm 5.2, and GLM-5.2 via Glideflow are not substitutes for glm-5.2.
Kilo Code’s settings surface can differ between the editor extension, CLI, app, and later releases. If the labels have moved, follow the stable configuration principle: OpenAI-compatible adapter, versioned base URL, secret key, exact model ID. The official Kilo page above is the source for the current click path.
Use an explicit configuration file
Kilo Code also documents a JSON configuration for custom providers. This is useful when you want the provider definition to be inspectable and reproducible:
{ "$schema": "https://app.kilo.ai/config.json", "model": "openai-compatible/glm-5.2", "provider": { "openai-compatible": { "options": { "apiKey": "{env:GLIDEFLOW_API_KEY}", "baseURL": "https://api.glideflowai.com/v1" }, "models": { "glm-5.2": { "name": "GLM-5.2 via Glideflow", "tool_call": true, "limit": { "context": 1000000 } } } } }}Set the key in the shell that launches Kilo Code:
export GLIDEFLOW_API_KEY="sk-your-key"This file uses openai-compatible as its provider ID, so its selected model is openai-compatible/glm-5.2. That is a standalone alternative to the UI example above, where the local provider ID was glideflow. Do not combine the glideflow prefix from one setup with the openai-compatible provider object from the other.
Keep the environment-variable version in Kilo’s trusted global configuration under ~/.config/kilo, or supply it through KILO_CONFIG or KILO_CONFIG_CONTENT. Kilo’s security rules do not resolve {env:VAR} from a project-level kilo.json committed to a repository. This prevents an untrusted repository from pointing a stored credential at an attacker-controlled URL.
The configuration refers to the environment variable rather than embedding the credential. Do not commit a literal key in kilo.json, kilo.jsonc, a workspace file, or a screenshot.
The tool_call flag tells Kilo Code that you intend to use the model for agent tools. It does not make an incompatible route support tools. Verify one tool action after chat connectivity works. If your route is chat-only, omit or disable the flag and do not expect repository-agent behavior.
The 1000000 context value matches the 1M tag in Glideflow’s current GLM-5.2 catalog entry. Kilo warns that an unset context limit can prevent expected compaction, but you should still lower the value if your tested route accepts less. The output limit remains unset because this article does not have a verified route-specific value for it.
Verify the API before testing the agent
Run a direct models request with the same base URL and key:
export GLIDEFLOW_API_KEY="sk-your-key"
curl https://api.glideflowai.com/v1/models \ -H "Authorization: Bearer $GLIDEFLOW_API_KEY"Look for the exact glm-5.2 ID in the response. Do not paste the full response into a public issue because API diagnostics can expose account or route details even when the key is not echoed.
Next, send one minimal chat request:
curl https://api.glideflowai.com/v1/chat/completions \ -H "Authorization: Bearer $GLIDEFLOW_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "glm-5.2", "messages": [ {"role": "user", "content": "Reply with exactly: connection ok"} ], "max_tokens": 128 }'These commands separate provider connectivity from Kilo Code’s local state. If both succeed, the URL, key, and model ID work together. If Kilo still fails, inspect its provider configuration rather than repeatedly changing the server-side values.
The live /models page is the source for current IDs. The menu changes over time, so an ID copied from an old tutorial can disappear or be renamed.
Verify the connection inside Kilo Code
Select the custom provider and glm-5.2 in Kilo Code’s model picker. Use a read-only request first:
Read package.json and tell me the build command.Do not edit files or run commands.Then test one bounded tool action in a disposable branch:
Add one unit test for the existing normalizeSlug function.Change only its current test file.Run the named test and stop after reporting the result.Review the diff and command output. This second request checks more than connectivity: it exercises Kilo’s tool loop, the route’s tool-call handling, and the selected model’s ability to follow a file boundary.
Do not start with “fix the repository.” A broad task makes it difficult to tell whether a failure came from provider setup, model behavior, missing dependencies, or permissions.
Fix an empty model list
An empty model selector does not always mean the chat endpoint is unavailable. It means Kilo Code did not populate its UI from the model-discovery path. Check the following in order.
Confirm the base URL ends in /v1
The correct base is:
https://api.glideflowai.com/v1Kilo can append /models to an OpenAI-compatible root. If you enter https://api.glideflowai.com, it may request the wrong path. If you enter the full chat endpoint, it may construct a nonsensical path such as /chat/completions/models.
Also check for a duplicated suffix:
https://api.glideflowai.com/v1/v1Test /v1/models directly
Run the first curl command from the same network and machine as Kilo Code. Interpret the status before changing configuration:
401or403: the key is missing, invalid, or not authorized.404: the base URL or path is wrong.200with no expected ID: use a model that is actually enabled for that key.200with the expected ID: add the model manually if the Kilo UI still does not populate.
Those meanings are ordinary HTTP interpretations; read the JSON error body because a service can provide more specific context.
Add the exact model manually
Model discovery is a convenience, not a requirement for the explicit JSON setup. Add glm-5.2 under models and set:
"model": "openai-compatible/glm-5.2"The value has two parts: Kilo’s provider configuration key, then the API model ID. If you change the provider key in the JSON, update the prefix in model too.
Confirm the key reaches the Kilo process
An environment variable exported in one terminal is not automatically available to an app launched from the desktop. Launch Kilo from the configured shell for the test, or use its supported local credential UI. Avoid printing the full key while debugging.
If the direct request succeeds but Kilo reports unauthorized, the local process probably does not see the same credential.
Check proxy and certificate handling
A corporate proxy, local TLS inspector, VPN, or restrictive network can let a browser open the dashboard while blocking an editor process. Test curl from the same environment. Do not disable certificate verification as a permanent fix; correct the trusted certificate or proxy configuration.
Diagnose other common errors
“Model not found”
Copy the API ID from the catalog and compare punctuation and case. The UI label belongs in name; the API ID belongs in the models object key.
Chat works but tool calls fail
The OpenAI-compatible label covers a request shape, not every optional behavior. Confirm tool-call support for the selected route, keep tool_call aligned with reality, and test one harmless tool. A different route may be required for agent work even if ordinary chat succeeds.
Responses stop early
Inspect the finish reason and token usage. Do not immediately invent a larger model limit in configuration. Check the model’s documented output limit, Kilo’s configured limit, and the request’s own cap.
The wrong model receives the request
Check the top-level model value and the active session selector. A provider can define several models while the session continues to use an older default. Start a new session after changing the model if your installed version retains session-level selection.
Requests repeat after an error
Set a turn or spend limit while testing. Automatic retries can turn a simple misconfiguration into repeated billed calls. Preserve one full error response, correct one variable, then retry once.
Choose a model for Kilo Code work
Use task evidence rather than a generic ranking. Give two candidate routes the same branch, prompt, permissions, turn cap, and test command. Record input tokens, output tokens, retries, test result, and manual cleanup.
Agent tasks often resend repository context and generate tool arguments across several turns. That means both input and output rates matter. Check /pricing before the experiment, and store the dated rate with your run log. The number-driven GPT, Claude, and Gemini comparison shows how request shape changes the total.
A custom provider reduces configuration friction; it does not make models interchangeable. Keep a known-good route for recovery, review every diff, and preserve the same branch protections you use for human changes.
Once the direct model request, read-only Kilo prompt, and one-file tool test all pass, use the Kilo Code app checklist to document the setup and create a separate restricted key at /start for the first real repository task.
