RunOpenCode throughtheprivate router.

One key connects OpenCode to 200+ models behind a single OpenAI-compatible endpoint. Prompts, diffs, and keys pass through in memory and are never stored.

The OpenCode start screen with GLM-5.2 selected as the model

Why AnonRouter

Your agent reads everything. The router remembers nothing.

A coding agent ships files, diffs, and shell output with every request. AnonRouter forwards it all in memory and settles billing from usage metadata alone.

One key, every model

A single key reaches 200+ chat models across providers. Add routes to opencode.json and switch between them with /models, no extra accounts.

Nothing stored

Prompts, diffs, responses, and keys are never written to disk. There is no request history to leak, resell, or train on.

Labeled privacy

Every route is labeled with the guarantee it actually provides: Anonymous, Private, TEE, or E2EE. E2EE adds client-side encryption to TEE isolation.

Setup

Connected in four steps

OpenCode already speaks the OpenAI API, so there is nothing to patch and no plugin to install. Point it at the router, hand it a key, and every catalog model is a /models away.

STEP 01

Install OpenCode

OpenCode is an open-source coding agent that runs in your terminal and works with any OpenAI-compatible provider. One command installs it.

# One-line install
curl -fsSL "https://opencode.ai/install" | bash

# Or with a package manager
npm install -g opencode-ai
brew install opencode

STEP 02

Create a compatibility key

Create an inference key in the dashboard and enable OpenAI-compatible access on it. The key is prefixed ar_ and shown once, so copy it right away. Then run /connect inside OpenCode, scroll to Other, and enter anonrouter as the provider id.

Create a key
/connect

Select provider
Other


Provider id
anonrouter


API key
ar_****************

STEP 03

Add the provider

Drop this into opencode.json in your project root, or into ~/.config/opencode/opencode.json to use the router everywhere. Any model id from the catalog works as an entry. Prefer environment variables over /connect? Set "apiKey": "{env:ANONROUTER_API_KEY}" under options instead.

Browse model ids
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "anonrouter": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "AnonRouter",
      "options": {
        "baseURL": "https://api.anonrouter.ai/v1"
      },
      "models": {
        "anthropic/claude-opus-4.8": {
          "name": "Claude Opus 4.8",
          "limit": { "context": 200000, "output": 64000 }
        },
        "anthropic/claude-sonnet-5": {
          "name": "Claude Sonnet 5"
        },
        "moonshotai/kimi-k2.5": {
          "name": "Kimi K2.5"
        },
        "qwen/qwen-3-coder-480b-turbo": {
          "name": "Qwen 3 Coder 480B"
        }
      }
    }
  }
}

STEP 04

Pick a model and build

Start opencode, run /models, and select a route. Switch models mid-session whenever the task changes. Every request is billed at the provider rate and metered from usage metadata alone.

/models

Select model
Claude Opus 4.8       anonrouter
Claude Sonnet 5       anonrouter
Kimi K2.5             anonrouter
Qwen 3 Coder 480B     anonrouter
enter to select
Compatibility mode

OpenCode authenticates with a static key, so requests ride the compatibility broker: the key is verified, a single-use ticket is minted in memory, and the request is forwarded with metadata-only logging. Building your own client? The ticket flow offers full unlinkability. Read the docs

Frequently asked questions

Any inference key works once OpenAI-compatible access is enabled on it. Tick the compatibility option when you create the key in the dashboard; a key without it returns a permission error telling you to enable it.
Yes. OpenCode's file edits, shell commands, and searches travel in the standard tools field, which the router forwards unchanged, and responses stream normally. A stream ends with its final [DONE] only after billing has settled.

Usage metadata only: model, token counts, status, latency, and cost. Prompts, diffs, and responses pass through in memory and are never written to disk.

Read how the gateway forgets

Claude Opus 4.8 and Claude Sonnet 5 are the strongest all-rounders for agentic coding. Kimi K2.5, GLM 5.2, and Qwen 3 Coder 480B are capable open-weight alternatives at a fraction of the price. Add several to your config and switch per task with /models.

Browse the catalog

Yes. Add "/auto" as an entry in your models map and select it. The router classifies each request in memory, filters to models inside your privacy boundary, then picks the cheapest capable route. Classification labels are never stored.

Your code is not our business.

Get API key
Use OpenCode with AnonRouter - the private AI router