Skip to main content
Replicas supports Opencode as a first-class coding agent alongside Claude Code, Codex, Cursor, and Pi. Opencode chats run inside your workspace VM, with the same repository access and integrations as other agents. Opencode authenticates one of three ways:
  • OpenCode Go subscription: connect an OpenCode Go API key from OpenCode Zen.
  • Aster API key: use Aster’s OpenAI-compatible inference.
  • OpenRouter API key: bring your own OpenRouter key for pay-as-you-go model routing.
Within a credential scope, authentication priority is OpenCode Go, Aster, then OpenRouter. Any personal key wins over every organization one.

OpenCode Go Subscription

OpenCode Go uses your OpenCode Go subscription for Opencode’s hosted open-source models. Create an API key in OpenCode Zen and store it in Coding Agents settings.
  1. Open Organization → Coding Agents during onboarding or anytime later, expand Opencode → OpenCode Go, and click Connect OpenCode Go.
  2. Paste the API key from your OpenCode Zen account.
  3. Replicas stores the key in the credential vault and injects it into OpenCode workspaces.
Set org-level credentials for the whole team, or connect a personal subscription in Personal → Coding Agents that takes priority over org defaults. Use Reconnect OpenCode Go to replace the key, or Disconnect to remove the stored subscription.
Connecting or reconnecting an organization subscription refreshes warm workspaces so the new credentials take effect. Model usage bills to the connected OpenCode Go account. If the provider reports that the subscription limit has been reached, Replicas stops the active turn and shows the provider message in chat.

OpenRouter API Key

Use an OpenRouter API key instead of, or as a fallback to, OpenCode Go. The OpenRouter key is shared with Pi. Neither OpenCode Go nor OpenRouter uses an OAuth flow like Claude Code or Codex.
  1. Create an API key from the OpenRouter keys page.
  2. Paste it under Opencode → OpenRouter API Key in Coding Agents settings. The same credential also appears under Pi → OpenRouter API Key.
OpenCode Go and Aster are preferred when connected. Otherwise, Opencode uses the available personal or organization OpenRouter key. See Credentials for scope details and auth behavior.
OpenCode Go usage follows your subscription limits. OpenRouter usage bills to the OpenRouter account that owns the key.

Aster API Key

Use one Aster API key for Opencode and Pi.
  1. Create a key in the Aster console.
  2. Paste it under Opencode → Aster API Key or Pi → Aster API Key in Coding Agents settings.
Keys start with sk_aster_. Aster uses https://api.asterlab.ai/v1 for OpenAI-compatible inference.

Models

The workspace model picker follows the active Opencode credential. With an OpenCode Go key, it reads the active opencode-go entry from the OpenCode catalog and omits models marked alpha or deprecated. Aster provides: With OpenRouter, organization admins choose which models are available. Expand Opencode → OpenRouter models in Coding Agents settings and enable models from the connected OpenRouter account, listed by weekly popularity. The selection applies to the workspace picker, automation validation, and models requested through the API. A model that is not enabled is rejected. Until an admin changes the selection, OpenRouter provides: Set the default model under Organization → Settings → Preferences or per-user in Personal → Preferences. Each workspace remembers the model selected for Opencode in the composer’s harness/model picker. Thinking levels use Opencode’s native model variants when the selected model exposes a matching variant. Models without a matching variant use Opencode’s model default.

Using Opencode in Workspaces

Every workspace can have multiple chats. Pick Opencode from the composer’s harness/model picker to start or continue an Opencode session. Opencode agents can:
  • Read and edit files in the cloned repository
  • Run shell commands in the workspace VM
  • Use environment MCP servers
  • Create branches, commits, and pull requests
  • Use Plan Mode to propose a plan before changing code
  • Load repository skills when the runtime can discover them
Replicas pre-approves Opencode tool permissions inside disposable workspace VMs, so these actions do not pause for per-command approval. Opencode does not support Fast Mode or Codex goal mode (/goal).

Plan Mode

Start a message with /plan or toggle plan mode in the composer. Opencode runs in plan mode and returns a structured plan you can review in the Canvas tab before asking it to implement.

Chat history

Opencode chat history persists across turns and survives workspace sleep. Use replicas read from the CLI to inspect transcript history from your terminal.

Programmatic Use

Select Opencode anywhere Replicas accepts a coding agent: Example CLI:
Example API:

When to Use Opencode

Opencode is a strong fit when:
  • You want to bill against an OpenCode Go subscription with a single API key
  • You want OpenRouter-backed model routing inside Replicas workspaces
  • You want to compare GLM 5.2, MiniMax M3, MiMo V2.5 Pro, and Kimi K2.6 on the same repository
  • You want a non-Claude, non-OpenAI model family for implementation and iteration
Claude Code, Codex, and Cursor remain better choices when you need provider-specific features like Claude background tasks, Codex goal mode, Cursor Composer, or Fast Mode.