Skip to main content

OpenCode

OpenCode is an open-source AI coding assistant.

Quick Start

# Install config + launch OpenCode via gateway
bankr llm opencode

This auto-installs the Bankr provider to ~/.config/opencode/opencode.json and launches OpenCode.

Specify a Model

Models use bankr/<model-id> format:

bankr llm opencode -m bankr/claude-opus-4.6
bankr llm opencode -m bankr/gemini-3-pro
bankr llm opencode -m bankr/gpt-5.2

Setup Only (Without Launching)

# Auto-install Bankr provider into ~/.config/opencode/opencode.json
bankr llm setup opencode --install

# Preview the config without writing it
bankr llm setup opencode

Manual Configuration

Create or edit ~/.config/opencode/opencode.json:

{
"$schema": "https://opencode.ai/config.json",
"provider": {
"bankr": {
"npm": "@ai-sdk/openai-compatible",
"name": "Bankr LLM Gateway",
"options": {
"baseURL": "https://llm.bankr.bot/v1",
"apiKey": "{env:BANKR_API_KEY}"
},
"models": {
"claude-opus-4.6": { "name": "Claude Opus 4.6" },
"gemini-3-pro": { "name": "Gemini 3 Pro" },
"gpt-5.2": { "name": "GPT 5.2" }
}
}
}
}

Then launch with:

opencode -m bankr/claude-opus-4.6

See Available Models for all supported models.