> ## Documentation Index
> Fetch the complete documentation index at: https://continuum-three-olive.vercel.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenRouter via OpenCode

> OpenRouter and other models through a shared opencode serve process, with BYO API keys and dollar-cost usage tracking.

Continuum runs OpenRouter models through a shared `opencode serve` process on the Mac. This is the bring-your-own-API-key path: you authenticate your own provider key with OpenCode and Continuum drives it.

OpenCode is more than an OpenRouter delivery vehicle. It is an orchestrator that can front many upstream providers — Anthropic, OpenAI, Google, OpenRouter, Z.ai, and others — using whichever key you've signed in with. Continuum surfaces **OpenCode Go**, **OpenRouter**, and **[Z.ai Coding](/docs/providers/zai)** as their own provider rows, plus an **OpenCode Authenticated Providers** section for any other provider you authenticate through OpenCode. All of them run on the same runtime.

## Requirements

`opencode` must be installed (Continuum checks `/opt/homebrew/bin`, `/usr/local/bin`, then `$PATH`). Authenticate your OpenRouter — or other supported — API key with:

```bash theme={"dark"}
opencode auth login
```

You can also paste a key directly in **Settings → Providers**, which writes the same entry into OpenCode's own `~/.local/share/opencode/auth.json`. Continuum reads that auth file and starts `opencode serve` automatically.

## How it integrates

OpenCode runs as a **single shared process** for the whole app — every Continuum OpenCode session is a concurrent client of that one server, which bounds memory regardless of session count. Continuum:

* Spawns `opencode serve --port <ephemeral> --hostname 127.0.0.1` with a per-launch server password, then health-checks it until reachable.
* Sends prompts through OpenCode's localhost HTTP API.
* Consumes the `GET /event` Server-Sent Events stream `opencode serve` emits for turn lifecycle, reconnecting with `Last-Event-ID` replay on disconnect.
* Maps OpenCode usage events into the Continuum analytics layer.
* Probes `opencode auth list` and the live model list so **Settings → Providers** can show which providers you've signed into and which models are available.

The `opencode serve` process is owned by the Mac. iOS sessions are proxied to the paired Mac over the pairing transport — there is no separate OpenCode process on the phone.

OpenCode sessions appear in the [Code tab](/docs/surfaces/code) session list and the [Usage tab](/docs/surfaces/usage).

<Note>
  Mid-session provider switches are the one thing this transport can't do. OpenCode's runtime is an SSE-driven serve process with no in-place teardown-and-respawn analogue, so switching a live session to or from OpenCode is declined with an explicit reason rather than a silent no-op — start a new session for the other model.
</Note>

## Models

The bundled OpenRouter list covers GPT-5.5, xAI Grok 4.5, Claude Opus 5, Claude Opus 4.7, Claude Sonnet 4.6, and Gemini 3 Pro. It is only a fallback: when you have a key configured, the live model list is fetched from OpenRouter and shown in **Settings → Providers** with its model.dev metadata, and the model picker is populated from that live list. Discovery is cached briefly and falls back to the bundled list on any failure.

## Effort

OpenRouter has no effort dial that reaches the model. You choose a model; no reasoning-effort value is passed through the OpenCode transport. The same is true of OpenCode Go and Z.ai Coding.

## Usage analytics

OpenRouter (BYO key) has no subscription quota to report, so Continuum tracks it as a **dollar-cost lane** in the Usage tab rather than a percentage gauge. Costs are computed from the token counts on each usage event against the underlying model and the bundled pricing snapshot, then attributed to the OpenCode analytics column — so OpenCode-routed spend shows separately even when the underlying model is identical to one you'd hit through Claude or Codex directly. Models not yet in the pricing snapshot land with non-zero tokens at \$0 and are surfaced as "unpriced model" attribution rather than appearing free.

<Note>
  **OpenCode Go** is a separate row with real 5h / weekly / monthly quota windows — but they are only readable through OpenCode's web dashboard, not an API key. Connect them under **Settings → Providers → Configure quota tracking**, which asks for your workspace id and session cookie. Until then the row shows a connect prompt rather than a fabricated meter.
</Note>

<Note>
  **[Z.ai Coding](/docs/providers/zai)** also rides this connector but has its own analytics column and its own 5h + weekly quota gauge.
</Note>

## Multiple accounts

Additional OpenRouter accounts are isolated with `XDG_DATA_HOME`, which points OpenCode at a separate `auth.json`. Because usage is dollar-cost rather than a per-account subscription meter, secondary accounts don't produce independent quota readings.

## Broadcast

OpenRouter via OpenCode can participate in the Chat surface's multi-provider [broadcast](/docs/features/broadcast) mode — one prompt to several providers, answers side by side.

<Note>
  The Chat tab is hidden by default across every client while the product is focused on Code, so broadcast is not reachable from the default UI. See [Chat](/docs/surfaces/chat).
</Note>

<Note>
  Provider CLI telemetry is owned by OpenCode and its upstream providers, not Continuum. Continuum consumes OpenCode's localhost SSE stream and has no visibility into OpenCode's upstream API calls to OpenRouter or other providers. See [Privacy](/docs/privacy) for the full egress breakdown.
</Note>
