AI

How to Use Cline, Aider and Continue With an OpenAI-Compatible API (on Clean Energy)

Point Cline, Aider or Continue at any OpenAI-compatible API in a few lines. Tested setups for each, the gotchas we hit, and how to run them on renewable-powered models with the Viro API.

Cline, Aider and Continue are three of the most popular open coding agents, and all three can use any API that speaks the OpenAI format. That means you choose where your model calls go, including to models that run on clean energy.

We set each one up against the Viro API and gave it a small real job: fix a bug in a Python file (for Cline and Continue, run the failing test before and after; for Aider, fix and commit). Below is what worked, and the small traps we hit along the way. The same steps work with any OpenAI-compatible provider; only the base URL, key and model names change.

What you need

Every OpenAI-compatible setup comes down to three things:

  • Base URL: https://api.viro.app/v1
  • API key: from console.viro.app (new accounts get free credit, no card)
  • Model ID: for example viro/clean, a router that picks a model on 100% renewable-powered infrastructure for each request. The full list is on the models page.

Cline

Cline has an OpenAI Compatible provider built in. In the VS Code extension:

  1. Open Cline’s settings and set API Provider to OpenAI Compatible.
  2. Set Base URL to https://api.viro.app/v1 and paste your key into API Key.
  3. Pick a Model ID. Cline loads the list from the API once the URL and key are in, routers included.

Then open Model Configuration under the model: it defaults to a 128,000-token context window and image support switched on. Set the real context window from the models page, and turn images off for text-only models.

The Cline CLI takes the same settings in one command:

npm install -g cline
cline auth -p openai -b https://api.viro.app/v1 -k <your-viro-key> -m viro/clean
cline "Run the tests and fix what fails."

In our test, viro/clean, viro/optimized, viro/frontier, viro/gpt-oss-120b and Claude Sonnet 5 all finished the task using Cline’s own tools. Full details in the Cline guide.

Aider

Aider connects through two environment variables:

python -m pip install aider-install
aider-install

export OPENAI_API_BASE=https://api.viro.app/v1
export OPENAI_API_KEY=<your-viro-key>

Then start it with openai/ in front of the model name:

aider --model openai/viro/clean --weak-model openai/viro/gpt-oss-20b

The double prefix looks wrong and is correct. Aider uses openai/ to pick the OpenAI-compatible client, then removes it, so the API receives viro/clean. The --weak-model handles commit messages and summaries; point it at something small so a one-line commit message doesn’t cost frontier prices.

Two things worth knowing:

  • Edit format. For model names it doesn’t recognise, Aider rewrites whole files. That works, but on big files you pay for every line again. Models that handle diffs well can use edit_format: diff in .aider.model.settings.yml.
  • A warning you can ignore. Aider prints “Unknown context window size and costs” for models it doesn’t ship details for. Nothing else changes; your real spend is in your console.

Full details, including the settings and metadata files, in the Aider guide.

Continue

Continue reads one config file, ~/.continue/config.yaml, for its VS Code and JetBrains extensions and its cn CLI:

name: My Config
version: 0.0.1
schema: v1

models:
  - name: Viro Clean
    provider: openai
    model: viro/clean
    apiBase: https://api.viro.app/v1
    apiKey: <your-viro-key>
    capabilities:
      - tool_use
    defaultCompletionOptions:
      contextLength: 128000

The trap here is capabilities: [tool_use]. The extensions guess whether a model can use tools from its name, and they don’t recognise names like viro/clean, so without that line Agent mode treats the model as unable to use tools. Declaring it fixes that.

To run the same config from a terminal:

npm install -g @continuedev/cli
cn --config ~/.continue/config.yaml "Run the tests and fix what fails."

The task passed on viro/clean, viro/optimized, GPT-5.6 Terra and Claude Sonnet 5. Full details in the Continue guide.

Bonus: let the agent check your account

Cline and Continue can connect to MCP servers. Add Viro’s at https://console.viro.app/mcp with your key and the agent can read the Viro docs, look up live models, and answer “is my key working?”, “what did I spend this week?” or “why did my last request fail?”. The MCP setup page has the exact config for both. New to MCP? Start with what an MCP server is.

Why run them on clean energy?

Coding agents send your code back to the model at every step, so they use far more AI than a chat does. With the Viro API, Viro-hosted open models run on 100% renewable energy, and frontier models like Claude and GPT-5.6 have their electricity matched with renewables, labelled separately so you always know which is which. Every request shows up in your console with its cost and estimated energy.

Using Claude Code or Codex instead? See how to run Claude Code on clean energy and how to run Codex on clean energy, or the announcement for every agent we support.

Frequently asked questions

What do I need to connect a coding agent to an OpenAI-compatible API?

Three things: the API's base URL (for Viro, https://api.viro.app/v1), an API key, and a model ID the API serves. Cline, Aider and Continue all take those three.

Why does Aider need openai/ in front of the model name?

Aider picks its client from a prefix on the model name, and openai/ means the OpenAI-compatible endpoint you configured. Aider removes it before sending, so Viro receives viro/clean when you pass openai/viro/clean.

Do Cline and Continue need tool calling turned on?

Cline sends its tools to any model. Continue's VS Code and JetBrains extensions guess tool support from the model name and don't recognise Viro's names, so add capabilities: [tool_use] to the model in config.yaml for Agent mode.

Which model should I use?

viro/clean is a router that picks a model on 100% renewable-powered infrastructure for each request. For long, many-step tasks, viro/frontier or a named frontier model is the safer pick.

Can these agents use Viro's MCP server?

Cline and Continue can: connect https://console.viro.app/mcp with your key and the agent can read Viro's docs and check your setup, spend and failed requests. Aider doesn't support MCP.

Sources

  1. Cline integration guide, Viro
  2. Aider integration guide, Viro
  3. Continue integration guide, Viro
  4. Viro MCP server, Viro

Cover photo by Harshit Katiyar on Unsplash

Chat with AI that funds clean energy

Viro AI is free on web, iPhone, Android, Mac and Windows.

Try Viro AI