Skip to content

OpenCode

Getting started

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

  1. In your web browser, open: https://llm.arc.vt.edu/
  2. Log in using your VT credentials (PID and password)
  3. Once logged in, click on your profile icon in the top-right corner
  4. Select "Settings" from the dropdown menu
  5. In the Settings page, navigate to the "Account" section
  6. Look for the "API Keys" section
  7. Click "Create New Secret Key" or "+ Create API Key"
  8. Give your key a descriptive name (e.g., "Coding agent")
  9. Click "Create" or "Generate"
  10. 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:

  1. Select provider prompt: type "other" (then hit Enter key)
  2. Enter provider id prompt: type "vt-arc" (then hit Enter key)
  3. Enter your API key prompt: paste API key (then hit Enter key)

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.