BroadRouter
Get started

Use open models in coding agents: Aider, Cline, opencode, Codex

By the BroadNet Inference team · 4 min read · Published · Updated

Every major coding agent takes three values for a custom model: a base URL, an API key and a model ID. Aider uses OPENAI_API_BASE, Cline and Roo Code an OpenAI Compatible provider, opencode a custom provider, Continue apiBase. Codex CLI now speaks only the Responses API, so a chat-completions endpoint needs a translating proxy such as LiteLLM.

A developer working at a laptop with code on screen, at dusk.

Coding agents were built for one or two big providers, but almost all of them now accept a custom OpenAI-compatible endpoint. That lets you run them on open models: cheaper per task, often with larger context, and on infrastructure you choose. This page is the map. It gives the exact setting names for each agent and links to a full step-by-step guide where we have one.

What do you need from the provider?

Every agent below needs the same three values:

Value BroadNet Inference
Base URL https://inference.broadnet.ai/v1
API key Your pay-as-you-go or plan key
Model ID broadnet/glm-5.3, broadnet/deepseek-v4.1-flash or broadnet/qwen3.8-27b

Two more settings matter for every agent: the context window and the max output tokens. Agents can’t detect them for custom model IDs, so they guess. Set them from the models page.

Agent by agent: the exact settings

Agent Where you set it Base URL field Model field Full guide
Aider Environment variables OPENAI_API_BASE --model openai/<id> Aider guide
Cline Settings, API Provider: OpenAI Compatible Base URL Model Cline guide
Roo Code / Zoo Code Settings, API Provider: OpenAI Compatible Base URL Model Roo Code guide
opencode opencode.jsonc, providers settings.baseURL models.<key>.modelID opencode guide
Continue config.yaml, provider: openai apiBase model Continue guide
Codex CLI config.toml, [model_providers.<id>] base_url model See below

Aider

export OPENAI_API_BASE=https://inference.broadnet.ai/v1
export OPENAI_API_KEY=your-key
aider --model openai/broadnet/deepseek-v4.1-flash

The openai/ prefix tells Aider to use the OpenAI-compatible route. Aider may warn that it doesn’t know the model’s context size; that’s expected for models outside its list.

Cline

Pick OpenAI Compatible as the API Provider, then fill Base URL, API Key and Model. Open Model Configuration and set the context window and max output tokens. Cline can use different models for Plan and Act modes, which is a cheap way to save the more expensive model for planning.

Roo Code and Zoo Code

Roo Code’s repository was archived on May 15, 2026, and its README says the extension was shut down. It points to Zoo Code, a fork started by the Roo Code community that continues its development, and to Cline. Existing Roo Code installs use the same OpenAI Compatible fields as Cline, and Roo’s changelog shows legacy XML tool calling was removed, so pick a model listed with native tool calling. For Zoo Code, follow its own docs.

opencode

opencode adds providers in opencode.jsonc under providers, with the OpenAI-compatible package and settings.baseURL. BroadNet IDs already contain a slash, so use a short map key such as glm-5.3 and put the full ID in modelID. Set capabilities and limit yourself; otherwise opencode falls back to assumptions.

Continue

models:
  - name: GLM 5.3
    provider: openai
    model: broadnet/glm-5.3
    apiBase: https://inference.broadnet.ai/v1
    apiKey: your-key
    capabilities: [tool_use]
    defaultCompletionOptions:
      contextLength: 1048576
      maxTokens: 8000

Continue needs tool_use for Agent mode. Leave it out for models without tool calling.

Codex CLI

Codex defines providers in config.toml with base_url and env_key. Its current config reference says responses is the only supported wire_api value, and Codex now rejects wire_api = "chat" with an error. BroadNet Inference serves /v1/chat/completions, so Codex can’t call it directly. The workaround is a proxy that translates. LiteLLM’s docs say its proxy exposes /v1/responses and can bridge it through chat completions:

  1. Run the LiteLLM proxy with BroadNet as an OpenAI-compatible backend, and turn on the chat-completions bridge as LiteLLM’s Responses API page describes.
  2. Point Codex’s base_url at the proxy.
  3. Test a short task. Bridges can drop Responses-only features, so check tool calls work end to end.

If that sounds like too much plumbing, opencode and Aider are terminal agents that talk to chat completions natively.

How do you test the endpoint before the agent?

When an agent fails, it’s hard to tell whether the agent or the endpoint is at fault. Check the endpoint alone first, with one request that offers a tool:

curl -s https://inference.broadnet.ai/v1/chat/completions \
  -H "Authorization: Bearer $BROADNET_API_KEY" -H "Content-Type: application/json" \
  -d '{"model":"broadnet/glm-5.3","max_tokens":2000,
       "messages":[{"role":"user","content":"Read the file README.md"}],
       "tools":[{"type":"function","function":{"name":"read_file",
         "parameters":{"type":"object","properties":{"path":{"type":"string"}},"required":["path"]}}}]}'

If the reply has finish_reason: "tool_calls" and a read_file call, the model and key are fine, and any remaining problem is in the agent’s settings. If it answers in plain text, pick another model for tool-driven agents. The API request builder writes this request for you in curl, Python or Node.

What breaks most often?

  1. Wrong model ID. Copy it exactly, including the broadnet/ prefix.
  2. Empty answers. All three large models reason before answering, and reasoning counts toward the output limit. Raise it. Why answers come back empty.
  3. Tool-call errors. Use a model with tool calling listed. BroadNet lists tools for GLM 5.3 and Qwen3.8 27B, not for DeepSeek V4.1 Flash. More on this in tool calling with open models.
  4. 429 errors. A pay-as-you-go key allows 30 requests a minute and 4 in flight. Two editor windows on one key add up. See errors and retries.
  5. Responses API by default. Some tools default to OpenAI’s newer API. Switch them to chat completions where they allow it.

Which model to choose per agent is covered in best open model for coding agents. How the three most popular agents differ is in Cline vs Roo Code vs Aider.

Where BroadNet Inference fits

BroadNet Inference gives every agent above one OpenAI-compatible endpoint for GLM 5.3, DeepSeek V4.1 Flash and Qwen3.8 27B, with zero data retention. Its unlimited plans make DeepSeek V4.1 Flash a flat $60 a month per session, which suits Aider and other agents that run all day. It is not a drop-in for Codex CLI without a proxy, and it doesn’t host provider-side tools such as web search. Start with a key at inference.broadnet.ai.

Questions

Can I use Codex CLI with an OpenAI-compatible API?

Only if the endpoint speaks the Responses API. Codex's config reference lists responses as the only supported wire_api value. For a chat-completions-only provider, put a proxy such as LiteLLM in front; its docs describe bridging /v1/responses through /v1/chat/completions.

Is Roo Code still maintained?

No. Its GitHub repository was archived on May 15, 2026 and the README says the extension was shut down. It points users to Zoo Code, which it calls a fork started by the Roo Code community, and to Cline.

Why does my agent say the model is not found?

The model ID must match the provider's ID exactly. BroadNet IDs include a prefix, for example broadnet/glm-5.3. In Aider you also add the openai/ prefix in front of it.

Why does the agent return empty answers with an open model?

Reasoning models spend part of the output budget thinking. If max output tokens is small, the visible answer never starts. Raise it to a few thousand tokens.

Which open model should I put in my coding agent?

For agents that work through tool calls, use a model with tool calling listed, such as GLM 5.3. For Aider, DeepSeek V4.1 Flash works well and is covered by BroadNet's unlimited plans.

Read as MarkdownAsk ChatGPTAsk ClaudeAsk Perplexity