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.8
bankr llm opencode -m bankr/gemini-3.1-pro
bankr llm opencode -m bankr/gpt-5.4
Private Inference
bankr llm setup opencode --install also registers a :private variant for every model that can run in a hardware-secured enclave (TEE) — e.g. bankr/glm-5.2:private. Selecting it routes the request through a confidential-compute provider; the gateway verifies the enclave's attestation on every request and fail-closes rather than downgrading. Open-weight models only (Claude, GPT, and Gemini are not served confidentially). List the set with bankr llm models --private, and see Private Inference for details.
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.8": { "name": "Claude Opus 4.8" },
"gemini-3.1-pro": { "name": "Gemini 3.1 Pro" },
"gpt-5.4": { "name": "GPT 5.4" }
}
}
}
}
Then launch with:
opencode -m bankr/claude-opus-4.8
See Available Models for all supported models.