---
title: "How to Use Claude in OpenCode"
description: "What OpenCode 2 is, and how to connect CodingPass models (Claude, GPT and open-weight) with a single opencode.jsonc."
url: https://codingpass.ai/blog/how-to-use-claude-in-opencode
language: en
updated: 2026-11-19
---
# How to Use Claude in OpenCode

OpenCode 2 changed how custom providers are configured, and the custom provider form in the desktop settings will not save. This guide connects CodingPass with a single opencode.jsonc.

[CodingPass team](https://codingpass.ai/about) Published Nov 19, 2026 Updated Nov 19, 2026 8 min read

This guide connects CodingPass to OpenCode 2: one key for Claude, GPT, and open-weight models like DeepSeek and Kimi, sharing a single config between the CLI and desktop app. If you only want the step-by-step reference, the [OpenCode setup guide](https://codingpass.ai/tools/opencode) covers that; this post also explains what OpenCode 2 is.

## What OpenCode is

OpenCode is an open-source coding agent hosted at `anomalyco/opencode` on GitHub under the MIT license. It is not tied to a single model vendor: it ships a set of free models that work without an account, and also connects to APIs from OpenAI, Anthropic, xAI, and others, or existing ChatGPT Plus / Pro and GitHub Copilot subscriptions. OpenCode itself is free; any usage charges come from the provider you connect.

There are several entry points:

- **Terminal UI**: runs in any shell, an editor's built-in terminal, or on a remote server
- **Desktop app**: supports macOS, Windows, and Linux with tabbed sessions, diff review, and a built-in browser preview
- **Others**: a web interface (`opencode pair`), mobile apps, and an SDK

Starting with OpenCode 2, a shared background service runs by default and all of these clients connect to it—so a session started in the terminal stays visible in the desktop app. As of November 18, the latest release is v2.3.2.

Once connected to CodingPass, a group of CodingPass models appears in your model list. On November 18, `GET https://codingpass.ai/v1/models` returned 26 models across Claude (Sonnet 5.5, Opus 5.5, Fable 5.2, and more), GPT (GPT-6.2 Sol, GPT-6.1 Terra, and more), Gemini, Grok, and open-weight models including DeepSeek, Kimi, GLM, Qwen, MiniMax, MiMo, and Hy4. Check the [Models page](https://codingpass.ai/models) to see which models your plan includes.

## Setup walkthrough

### Prerequisites

- Install OpenCode 2 so that `opencode --version` outputs `v2.x`.
- Open the Keys page in the CodingPass dashboard and create a key with the tool set to OpenCode.

### 1. Write the config file

Save the following to `~/.config/opencode/opencode.jsonc`. Claude and open-weight models use the Anthropic package, while GPT uses the Responses package:

~/.config/opencode/opencode.jsonc

```
{
  "$schema": "https://opencode.ai/config.json",
  "model": "codingpass/claude-sonnet-5-5",
  "providers": {
    "codingpass": {
      "name": "CodingPass",
      "env": ["CODINGPASS_API_KEY"],
      "package": "@opencode/ai/providers/anthropic",
      "settings": { "baseURL": "https://codingpass.ai/v1" },
      "models": {
        "claude-sonnet-5-5": { "name": "Claude Sonnet 5.5" },
        "claude-opus-5-5": { "name": "Claude Opus 5.5" },
        "deepseek-v4.1-flash": { "name": "DeepSeek V4.1 Flash" },
        "kimi-k2.7-code": { "name": "Kimi K2.7 Code" }
      }
    },
    "codingpass-openai": {
      "name": "CodingPass (OpenAI)",
      "env": ["CODINGPASS_API_KEY"],
      "package": "@opencode/ai/providers/openai-compatible/responses",
      "settings": { "baseURL": "https://codingpass.ai/v1" },
      "models": {
        "gpt-6.2-sol": { "name": "GPT-6.2 Sol" },
        "gpt-6.1-terra": { "name": "GPT-6.1 Terra" }
      }
    }
  }
}
```

`baseURL` must include `/v1` or requests will return 404. Add or remove entries under `models` to match your plan—look up exact model IDs on the [Models page](https://codingpass.ai/models).

### 2. Set your key

Terminal

```
opencode service set env CODINGPASS_API_KEY cp-live-…
```

This stores the key in the OpenCode background service environment, so both the CLI and the desktop app can read it.

### 3. Pick a model and send a message

Restart OpenCode, run `/models`, select Claude Sonnet 5.5 under CodingPass, and send any message. If it replies, you are connected.

Terminal

```
opencode
/models
```

![OpenCode terminal UI showing Say hi in five words, reply Hello there, nice to meet you!, and Build · Claude Sonnet 5.5 CodingPass at the bottom](https://codingpass.ai/assets/img/tools/opencode/tui-models.webp)

*OpenCode 2.3.2 terminal UI running Claude Sonnet 5.5 under CodingPass.*

### Desktop app

Download the desktop app from [opencode.ai/desktop](https://opencode.ai/desktop). It reads the same config file and key with no extra setup—just pick a CodingPass model from the model selector next to the input box.

![OpenCode desktop app session showing Say hi in five words, reply Hello there, nice to meet you!, and CodingPass / Claude Sonnet 5.5 in the model selector below the input box](https://codingpass.ai/assets/img/tools/opencode/desktop-model-picker.webp)

*The desktop app needs no separate setup; CodingPass appears directly in the model selector.*

Written by CodingPass team

We run CodingPass and test each guide against the latest stable release of the tool before we publish it. Spotted something out of date? Write to [support@codingpass.ai](mailto:support@codingpass.ai).

## Related reading.

Guide

### [OpenCode setup guide](https://codingpass.ai/tools/opencode)

Three-step setup, default models for each plan, and allowances for open-weight models.

Guide

### [OpenCode 2 works great, until Claude returns a 400](https://codingpass.ai/blog/opencode-claude-third-party-400)

What changed in OpenCode 2, and where the 400 comes from when you connect a Claude subscription.

Models

### [All models](https://codingpass.ai/models)

Model IDs, required tiers, and monthly allowances.
