BrainwriteDocs
Agent engines

Other model providers

Use OpenRouter, Fireworks AI, DeepSeek, Cline, or your own OpenAI- or Anthropic-compatible service.

This page covers what works today in each engine and version-specific differences with OpenCode 2.x.

What works today

ProviderOpenCodeChat engineClaude CodeCodex
OpenRouterYesYesOnly through Claude Code's own settingsNot yet
Fireworks AIYesYesOnly through Claude Code's own settingsNot yet
DeepSeekYesYesOnly through Claude Code's own settingsNot yet
ClineYesYesNoNo
Your own OpenAI-compatible addressYes, in OpenCode's config fileYesNoNot yet
Your own Anthropic-compatible addressNot testedNoOnly through Claude Code's own settingsNo

"Chat engine" is Brainwrite's built-in engine for OpenAI-compatible services. In a bot's model picker it is called OpenAI-compatible (OpenRouter / Groq) and, for now, sits in the Local group.

The Cline row lists its hosted model service. To run Cline's own coding agent, use the Cline engine.

Other engines (Antigravity, Cursor, Gemini, Qwen, Grok, Droid, Kimi, Hermes, Pi and custom agents) use their own sign-in.

Keys you export in your shell (~/.zshrc, ~/.bashrc) don't reach the desktop app when you open it from the Dock, Finder or an app menu: it copies only PATH from your shell. Use the steps below instead.

OpenCode

OpenCode already supports OpenRouter, Fireworks AI, DeepSeek and ClinePass. It just needs your key.

  1. In a terminal, run opencode auth login.
  2. Pick OpenRouter, Fireworks AI, DeepSeek or ClinePass and paste your key.
  3. In Brainwrite, open a bot's model picker, choose OpenCode and press the refresh button (Refresh models). The provider's models appear in the list. Brainwrite reads the model list from an ACP session on both OpenCode 1.x and 2.x.

Brainwrite uses your normal OpenCode sign-ins and settings, so there is nothing to set up inside the app. Sign in with the same OpenCode version that your bots use (see OpenCode 2.x).

Your own OpenAI-compatible address (this includes Cline credits, at https://api.cline.bot/api/v1):

  1. Run opencode auth login, pick Other, type a short ID such as myrouter, and paste your key.

  2. Add the provider to ~/.config/opencode/opencode.json (%USERPROFILE%\.config\opencode\opencode.json on Windows):

    {
      "$schema": "https://opencode.ai/config.json",
      "provider": {
        "myrouter": {
          "npm": "@ai-sdk/openai-compatible",
          "name": "My router",
          "options": { "baseURL": "https://router.example.com/v1" },
          "models": { "model-id": { "name": "Model name" } }
        }
      }
    }

    Keep this file plain JSON, with no comments or trailing commas. Brainwrite edits it when an OpenCode bot uses a model running on this computer.

  3. Refresh OpenCode's models in Brainwrite.

OpenCode's provider guide has more examples. OpenCode can also use Anthropic-compatible addresses, but we haven't tested that with Brainwrite.

Chat engine

The chat engine uses one provider at a time.

  1. Open Settings → API keys → Provider keys.

  2. Paste your key into OpenAI-compatible API key and set OpenAI-compatible base URL:

    ProviderBase URL
    OpenRouterhttps://openrouter.ai/api/v1 (the default)
    Fireworks AIhttps://api.fireworks.ai/inference/v1
    DeepSeekhttps://api.deepseek.com
    Clinehttps://api.cline.bot/api/v1
    Anything elseThe OpenAI-compatible address your provider gives you, usually ending in /v1
  3. Press Test. Then pick OpenAI-compatible (OpenRouter / Groq) in a bot's model picker and choose a model.

To use more than one provider at once, add extra openai-compat engines to config.json. Give each one its own key. An engine without a key uses the key from API keys and sends it to that engine's address.

Free OpenRouter models

A new OpenRouter account with no credit can only use free models. Paid models stop with "This model needs OpenRouter credit".

  • Picking one: the model picker marks free models (free). When the key belongs to a free account, free models that can use tools come first and one of them is the default. Pressing Test on the key says so. A model you chose yourself is never changed.
  • Privacy setting: if OpenRouter's privacy settings block free models, turns stop with "OpenRouter's privacy settings block this free model". Allow free model endpoints at openrouter.ai/settings/privacy, or pick another model.
  • Daily limit: OpenRouter limits how many requests free models take each day, and every step of a bot's turn counts as one. When the limit is used up, wait for it to reset or add credit at openrouter.ai/credits to raise it.

Cline engine

  1. Install the standalone CLI with npm install -g cline.
  2. Run cline auth in a terminal to choose its provider, model and account.
  3. In Brainwrite's bot model picker, select Cline and Cline default (configured).

Brainwrite uses Cline's selected provider and saved credentials. Change the provider or model through cline auth; the configured model is pinned before each prompt. An unconfigured account remains unavailable. Set CLI can select a wrapper with --config or --data-dir for a separate Cline home.

Cline receives the bot's scoped MCP tools and uses Brainwrite's approval broker, including Full Access. Native Cline tool selection is not supported.

Claude Code

The app has no place yet to point Claude Code at another provider. The Anthropic API key in API keys is for Anthropic only.

You can point Claude Code itself at OpenRouter, Fireworks AI or DeepSeek, and your Claude bots follow it:

  • Put ANTHROPIC_BASE_URL and your key in the env block of ~/.claude/settings.json. Fireworks' FireConnect does this for you. OpenRouter's and DeepSeek's guides use shell exports, which the desktop app doesn't see, so copy those lines into the env block.
  • If you also set ANTHROPIC_MODEL there, that model appears under Use a local model in the Claude model picker; pick it. So do ANTHROPIC_CUSTOM_MODEL_OPTION and each ANTHROPIC_DEFAULT_*_MODEL that isn't a Claude model. Otherwise bots ask for Claude models, which OpenRouter bills as Claude and DeepSeek replaces with its own model. FireConnect's model list doesn't show up in Brainwrite, so add ANTHROPIC_MODEL yourself. A bot runs only the model you pick: ANTHROPIC_DEFAULT_*_MODEL and CLAUDE_CODE_SUBAGENT_MODEL aren't carried over.
  • It applies only while no Anthropic API key is saved in API keys.
  • It changes Claude Code everywhere on this computer, not just in Brainwrite.

Codex

Not yet. Codex bots use your ChatGPT sign-in, or your organisation's models.

Current limits

There is no shared provider list that configures every engine. Use each engine's setup above, and do not assume a key saved for one engine changes another engine's sign-in or model list.

OpenCode 2.x

Brainwrite installs and tests OpenCode 1.x (the opencode-ai npm package). OpenCode 2.x is a separate package, @opencode/cli, and it also installs a command called opencode.

  • If you installed OpenCode from Brainwrite's Settings, bots use that copy. Otherwise they use the first opencode on your PATH, which is 2.x if you installed @opencode/cli. Settings → Model providers shows the version in use.
  • 2.x works on a best-effort basis. Version-specific differences:
    • Some 2.x releases have reported missing configured providers in new ACP sessions. If a provider is missing, check the installed version and OpenCode's updates before changing your credentials.
    • When a provider key is set in the environment (for example OPENROUTER_API_KEY), 2.x hides OpenCode's free models and makes a paid model the default.
    • 2.x keeps its sign-ins apart from 1.x, so a sign-in made with one may not be seen by the other. Run opencode auth login with the version your bots use.

On this page