BroadRouter

Run Aider on unlimited DeepSeek V4.1 Flash

Updated

Aider connects to any OpenAI-compatible API. Set OPENAI_API_BASE to https://inference.broadnet.ai/v1 and OPENAI_API_KEY to your BroadNet key, then run aider --model openai/broadnet/deepseek-v4.1-flash. The openai/ prefix selects Aider's OpenAI-compatible route. On an unlimited plan key, DeepSeek V4.1 Flash tokens are not metered, so long repository sessions stay at a flat price.

Coding agents resend large parts of your repository on every turn, so per-token billing grows fast. An unlimited plan session removes the meter. These steps follow Aider’s OpenAI-compatible setup.

1. Install Aider

python -m pip install aider-install
aider-install

2. Point it at BroadNet Inference

export OPENAI_API_BASE=https://inference.broadnet.ai/v1
export OPENAI_API_KEY='your-broadnet-plan-key'

On Windows, use setx OPENAI_API_BASE https://inference.broadnet.ai/v1 and setx OPENAI_API_KEY your-key, then open a new terminal. Aider’s docs say to restart the shell after setx.

Keep the /v1 at the end of the base URL. Aider adds the chat-completions path itself.

3. Start it on your codebase

cd /path/to/your/project
aider --model openai/broadnet/deepseek-v4.1-flash

The openai/ prefix tells Aider to use the OpenAI-compatible endpoint; the rest is BroadNet’s model ID. Aider will warn: “Unknown context window size and costs, using sane defaults.” That is expected for models outside its built-in list. Its model warnings page says the warning can usually be ignored.

4. Optional: tell Aider about the model

To remove the warning and give the model room to reason, add two files to your home directory or the repository root. Aider reads both from either place, as described in its advanced model settings docs.

.aider.model.metadata.json:

{
  "openai/broadnet/deepseek-v4.1-flash": {
    "max_input_tokens": 1048576,
    "litellm_provider": "openai",
    "mode": "chat"
  }
}

.aider.model.settings.yml:

- name: openai/broadnet/deepseek-v4.1-flash
  edit_format: diff
  extra_params:
    max_tokens: 16000

Aider’s default edit format for unknown models is whole, which resends whole files. diff sends only the changed blocks. If edits fail to apply, remove the edit_format line to go back to whole.

Tips

  • One Aider window, one session. If you run two Aider instances at the same time, buy two sessions or they queue behind each other.
  • Reasoning uses tokens. DeepSeek V4.1 Flash reasons before it answers, and BroadNet counts that toward max_tokens. Why answers come back empty.
  • Try an hour first. A Meteor plan costs $1 for one hour, which is enough to judge it on a real task.

Troubleshooting

  • 401 Unauthorized. OPENAI_API_KEY is missing, wrong or expired. Check that the shell running Aider has the variable; on Windows, open a new terminal after setx.
  • Requests go to OpenAI instead of BroadNet. OPENAI_API_BASE isn’t set in this shell, or the model name lacks the openai/ prefix. Run echo $OPENAI_API_BASE to check.
  • Model not found. The part after openai/ must be broadnet/deepseek-v4.1-flash exactly. A plan key covers DeepSeek V4.1 Flash only; other BroadNet models need a pay-as-you-go key.
  • Empty or cut-off replies. Raise max_tokens in .aider.model.settings.yml as shown above.
  • Edits don’t apply. Switch edit_format back to whole, or try --edit-format whole on the command line.
  • Slow replies or 429. A plan session runs one request at a time; a second Aider window queues. A pay-as-you-go key allows 30 requests a minute and 4 at once. See errors and retries.

Prefer an agent inside VS Code? See the Cline setup guide, or compare them in Cline vs Roo Code vs Aider.

Choose a plan on BroadNet Inference

Questions

How do I use Aider with an OpenAI-compatible API?

Set OPENAI_API_BASE to the provider's base URL and OPENAI_API_KEY to its key, then start aider with --model openai/ followed by the provider's model ID. For BroadNet that is openai/broadnet/deepseek-v4.1-flash with base URL https://inference.broadnet.ai/v1.

Why does Aider say "Unknown context window size and costs"?

Aider has no built-in metadata for BroadNet model IDs, so it assumes an unlimited context and zero cost. Aider's docs say the warning can usually be ignored. To remove it, add the model to .aider.model.metadata.json.

Do I need the openai/ prefix if the model ID already starts with broadnet/?

Yes. Aider reads the first part as the provider route. openai/ sends the request to OPENAI_API_BASE, and broadnet/deepseek-v4.1-flash is the model ID BroadNet receives.

Why does Aider get empty or cut-off replies from DeepSeek V4.1 Flash?

The model reasons before it answers, and BroadNet counts reasoning toward max_tokens. Set a higher max_tokens through extra_params in .aider.model.settings.yml.

Read as MarkdownAsk ChatGPTAsk ClaudeAsk Perplexity