---
title: "Kilo Code custom OpenAI-compatible provider setup | BroadRouter"
description: "Connect Kilo Code to BroadNet Inference as a custom OpenAI Compatible provider, in the VS Code dialog or kilo.json, with model IDs, limits and tool flags."
url: https://broadrouter.com/guides/kilo-code-openai-compatible/
lang: en
updated: 2026-11-16
publisher: BroadRouter (a BroadNet site); API by BroadNet Inference, https://inference.broadnet.ai
---

# Use Kilo Code with BroadNet Inference (OpenAI Compatible provider)

Updated 2026-11-16

In Kilo Code, open Settings, go to Providers and click Custom provider. Choose Provider API OpenAI Compatible, set Base URL to https://inference.broadnet.ai/v1, paste your BroadNet key, and add a model ID such as broadnet/glm-5.3 by hand. In kilo.json, use npm @ai-sdk/openai-compatible with options.baseURL and set limit.context and limit.output.

Kilo Code is an open-source coding agent for VS Code and the terminal. Any provider with an OpenAI Chat Completions API can be added as a **custom provider**. BroadNet Inference serves that format at `https://inference.broadnet.ai/v1`. BroadRouter is BroadNet’s own site; this guide follows [Kilo’s provider docs](https://kilo.ai/docs/ai-providers/openai-compatible) as they read on 15 November 2026.

## Setup in VS Code

1.  **Get a key.** Create a pay-as-you-go key in the BroadNet console, or use an [unlimited plan](https://broadrouter.com/guides/unlimited-llm-api-sessions/) key.
    
2.  Open **Settings** (gear icon) and go to the **Providers** tab.
    
3.  Scroll to the bottom and click **Custom provider**.
    
4.  Fill in the dialog:
    
    | Field | Value |
    | --- | --- |
    | Provider ID | `broadnet` |
    | Display name | BroadNet Inference |
    | Provider API | **OpenAI Compatible** |
    | Base URL | `https://inference.broadnet.ai/v1` |
    | API key | your BroadNet key |
    | Models | add `broadnet/glm-5.3` by hand (see below) |
    
5.  Click **Submit**. The model appears in the model picker.
    
6.  **Test it.** Start a task such as “explain this file”. If it answers, the connection works.
    

Kilo tries to fill the model list from the endpoint’s `/v1/models`. BroadNet’s docs describe that endpoint as catalogue metadata for monitors, and when we checked it on 15 November 2026 it listed only the two transcription models. Type the chat model IDs yourself, and don’t pick the transcription models.

## Setup in kilo.json (CLI, or for limits and tool flags)

Kilo’s dialog doesn’t set token limits or tool calling. Its docs point to the config file for that: `~/.config/kilo/kilo.json`, or `./kilo.json` in a project.

```jsonc
{
  "$schema": "https://app.kilo.ai/config.json",
  "model": "broadnet/glm-5.3",
  "provider": {
    "broadnet": {
      "npm": "@ai-sdk/openai-compatible",
      "env": ["BROADNET_API_KEY"],
      "options": {
        "baseURL": "https://inference.broadnet.ai/v1"
      },
      "models": {
        "glm-5.3": {
          "id": "broadnet/glm-5.3",
          "name": "GLM 5.3",
          "tool_call": true,
          "reasoning": true,
          "limit": { "context": 1048576, "output": 16000 }
        },
        "qwen3.8-27b": {
          "id": "broadnet/qwen3.8-27b",
          "name": "Qwen3.8 27B",
          "tool_call": true,
          "reasoning": true,
          "modalities": { "input": ["text", "image"], "output": ["text"] },
          "limit": { "context": 262144, "output": 16000 }
        },
        "deepseek-v4.1-flash": {
          "id": "broadnet/deepseek-v4.1-flash",
          "name": "DeepSeek V4.1 Flash",
          "reasoning": true,
          "limit": { "context": 1048576, "output": 16000 }
        }
      }
    }
  }
}
```

```bash
export BROADNET_API_KEY='your-broadnet-key'
```

-   The top-level `model` value, `broadnet/glm-5.3`, is the provider name plus the map key (`glm-5.3`), not the BroadNet ID. The `id` field is the model ID Kilo sends to BroadNet. Kilo’s docs say `id` defaults to the map key, so set it whenever the key isn’t the full BroadNet ID, as with the short keys here.
-   Always set `limit.context` and `limit.output`. For a custom model with no catalogue match, Kilo’s docs say both resolve to 0, which disables automatic context management. The output value of 16,000 is our suggestion; it leaves room for reasoning.
-   `tool_call` is left off DeepSeek V4.1 Flash on purpose: BroadNet’s docs don’t list tool calling for it. Add it after you have tested it.

## Which model to pick

| Task | Model | Notes |
| --- | --- | --- |
| Agent coding with tools | [GLM 5.3](https://broadrouter.com/models/glm-5.3/) | Tools and structured output listed; 1M context |
| Screenshots, Arabic | [Qwen3.8 27B](https://broadrouter.com/models/qwen3.8-27b/) | Tools and images; 262K context |
| Long sessions, flat price | [DeepSeek V4.1 Flash](https://broadrouter.com/models/deepseek-v4.1-flash/) | Unlimited plans; tools not listed by BroadNet |

Try the unlimited plan on a Meteor hour ($1) before a Full Moon month ($60).

## Troubleshooting

-   **“Invalid API Key” or 401.** Paste the key again. Check that the key has allowance left, and that `BROADNET_API_KEY` is set in the process that runs Kilo.
-   **“Model Not Found”.** Check the ID matches BroadNet’s exactly, with the `broadnet/` prefix. Paid models need a top-up; the $5 credit covers only `broadnet/gemma-4-26b-a4b` and the two Transcribe models.
-   **Empty answer or “response may be incomplete”.** Kilo warns when a reasoning model spends the whole output on reasoning. Raise `limit.output`. [Why answers come back empty](https://broadrouter.com/guides/reasoning-tokens-empty-response/).
-   **429.** A pay-as-you-go key allows 30 requests a minute and 4 in flight. See [errors and retries](https://broadrouter.com/guides/errors-and-retries/).
-   **Parallel subagents on a plan key wait or fail.** A plan session runs one request at a time, so give each parallel subagent its own session.
-   **Connection errors.** The Base URL must end in `/v1`. If your key has an [IP allow-list](https://broadrouter.com/guides/api-keys-ip-allow-lists/), add your machine’s address.

## Terms in this guide

[Tool calling](https://broadrouter.com/glossary/tool-calling/)

Tool calling, also called function calling, is an LLM API feature in which the model returns a structured request to run a function the developer has defined, with JSON arguments. The application runs the function and sends the result back; the model never runs code itself.

[Pay-as-you-go](https://broadrouter.com/glossary/pay-as-you-go/)

Pay-as-you-go is a pricing model in which you pay only for what you use, metered per unit such as tokens, requests or audio minutes, with no subscription or minimum commitment. Most LLM APIs bill this way, from a prepaid balance or a periodic invoice.

[API key](https://broadrouter.com/glossary/api-key/)

An API key is a secret string that identifies and authorizes a client calling an API. LLM APIs usually expect it in an Authorization: Bearer header, and anyone who holds the key can make requests that are billed to the account that owns it.

[Base URL](https://broadrouter.com/glossary/base-url/)

A base URL is the fixed root address of an API, such as https://api.example.com/v1, that a client puts in front of every endpoint path, such as /chat/completions. In OpenAI-compatible SDKs, changing the base URL, together with the API key and model ID, points the same code at a different provider.

[Chat Completions API](https://broadrouter.com/glossary/chat-completions-api/)

The Chat Completions API is OpenAI's HTTP endpoint, POST /v1/chat/completions, that takes a model name and a list of role-tagged messages and returns the model's next message. Its request and response shape became the common format that OpenAI-compatible providers and SDKs reuse.

[Subagent](https://broadrouter.com/glossary/subagent/)

A subagent is a separate agent that a main agent starts to handle one focused task. It runs with its own context window, system prompt and tool access, does the work, and returns only a result or summary to the main agent, which keeps the main conversation small.

[AI coding agent](https://broadrouter.com/glossary/coding-agent/)

An AI coding agent is a software tool in which a language model works on a codebase in a loop: it reads files, edits them, runs commands such as tests, reads the output and decides the next step until the task is done or a limit is reached.

[Concurrency](https://broadrouter.com/glossary/concurrency/)

Concurrency is the number of requests a client has in flight at the same time. LLM APIs often cap it per key or plan, separately from requests per minute, because each open request holds GPU capacity until its response has finished.

## Questions

### Why doesn't Kilo Code list BroadNet's chat models after I enter the Base URL?

Kilo fetches models from the endpoint's /v1/models list. When we checked on 15 November 2026, BroadNet's public /v1/models listed only its two transcription models, so add the chat model IDs by hand.

### What should limit.context be for BroadNet models?

1048576 for GLM 5.3 and DeepSeek V4.1 Flash, 262144 for Qwen3.8 27B and 32768 for BroadNet Gemma 4 VL 26B. Kilo's docs say a missing limit resolves to 0 for custom models, which turns off automatic context management.

### Can I use Kilo Code on the BroadNet unlimited plan?

Yes. The plans cover DeepSeek V4.1 Flash, ID broadnet/deepseek-v4.1-flash. Use the plan key as the API key. BroadNet's docs don't list tool calling for that model, so test an agent task first.

### Should I pick OpenAI Compatible or OpenAI Responses as the Provider API?

OpenAI Compatible. BroadNet serves chat completions at /v1/chat/completions and does not list the Responses API.

## Related guides

-   [Use Cline with BroadNet Inference (OpenAI Compatible provider)](https://broadrouter.com/guides/cline-openai-compatible/)
-   [Add BroadNet Inference to opencode as a custom provider](https://broadrouter.com/guides/opencode-custom-provider/)
-   [How the unlimited LLM API plans work for agents](https://broadrouter.com/guides/unlimited-llm-api-sessions/)
-   [Why a reasoning model returns an empty answer](https://broadrouter.com/guides/reasoning-tokens-empty-response/)
-   [All tools that work with BroadNet Inference](https://broadrouter.com/integrations/): SDKs, coding agents, chat UIs and automation tools, with exact settings for each

Try it on your real workload. New accounts start with $5 of credit for Gemma and transcription. DeepSeek, GLM and Qwen3.8 need a top-up.

[Get started](https://inference.broadnet.ai/account/?utm_source=broadrouter&utm_medium=referral&utm_campaign=guides-kilo-code-openai-compatible&utm_content=page-cta) ·

**Sources**

-   [Kilo Code docs, Using OpenAI-Compatible Providers (checked 2026-11-15)](https://kilo.ai/docs/ai-providers/openai-compatible)
-   [Kilo Code docs, Custom Models (id, tool\_call, limit fields) (checked 2026-11-15)](https://kilo.ai/docs/code-with-ai/agents/custom-models)
-   [BroadNet Inference API reference (checked 2026-11-15)](https://inference.broadnet.ai/docs?utm_source=broadrouter&utm_medium=referral&utm_campaign=guides-kilo-code-openai-compatible&utm_content=sources)
