OpenCode¶
Getting started¶
- OpenCode Docs
-
curl -fsSL https://opencode.ai/install | bash
This installation assumes a Linux or MacOS operating system. For Windows, see this page. All steps are done in the terminal.
Configure a custom LLM provider (VT-ARC)¶
Get your API key from VT-ARC¶
- In your web browser, open: https://llm.arc.vt.edu/
- Log in using your VT credentials (PID and password)
- Once logged in, click on your profile icon in the top-right corner
- Select "Settings" from the dropdown menu
- In the Settings page, navigate to the "Account" section
- Look for the "API Keys" section
- Click "Create New Secret Key" or "+ Create API Key"
- Give your key a descriptive name (e.g., "Coding agent")
- Click "Create" or "Generate"
- Copy the generated API key.
⚠️ Important: Copy the API key immediately and save it securely!
The key will only be displayed once. Store it in a password manager or secure location.
Add API key to OpenCode¶
opencode auth login
This opens a new dialog. Go thought the following configuration steps:
- Select provider prompt: type "other" (then hit
Enterkey) - Enter provider id prompt: type "vt-arc" (then hit
Enterkey) - Enter your API key prompt: paste API key (then hit
Enterkey)
Verify API credentials:
opencode auth list
You should see vt-arc listed among your configured providers.
Create a configuration file for OpenCode¶
Open the following file in an editor (for example using Vim):
vim ~/.config/opencode/opencode.json
(If you just installed OpenCode this will be a new file.)
Add this configuration:
{
"$schema": "https://opencode.ai/config.json",
// Provider: llm.arc.vt.edu
"provider": {
"vt-arc": {
"npm": "@ai-sdk/openai-compatible",
"name": "VT-ARC",
"options": {
"baseURL": "https://llm-api.arc.vt.edu/api/v1"
},
"models": {
"gpt-oss-120b": {
"name": "GPT-OSS 120b"
},
"Kimi-K2-Thinking": {
"name": "Kimi K2 Thinking"
}
}
}
},
// Agents
"agent": {
"build": {
"mode": "primary",
"model": "vt-arc/Kimi-K2-Thinking"
},
"plan": {
"mode": "primary",
"model": "vt-arc/gpt-oss-120b"
}
},
}
This configuration sets a model for (general purpose) build mode and another model
for (slightly simpler) plan mode. In OpenCode, you can switch between build and
plan modes with the Tab key.