Skip to main content
Have an API key from the ViVi-API dashboard ready, and confirm that its group supports your chosen model. Back up any existing configuration before merging the fields below.

1. Choose a configuration location

The simplest option is to create opencode.jsonc in your project’s root directory. JSONC supports comments, making the file easier to maintain. The default global configuration is ~/.config/opencode/opencode.jsonc. On Windows, ~ refers to your user home directory. If you use a custom configuration directory, check the location the client actually loads; do not assume it is under %APPDATA%. Run opencode --version first. Newer versions use providers / package / settings; older versions use provider / npm / options. Do not mix the two formats.

2. Set the API key environment variable

The examples below use Anthropic Messages with Claude models. Replace the model IDs with Claude models your token can access.

3. Configure the provider

opencode.jsonc
{env:VIVI_API_KEY} reads the environment variable available to the process that launches OpenCode. To use Gemini or an OpenAI-compatible protocol, change the provider adapter, URL, and model list together. Replacing only the model name in the Anthropic example is not enough.

4. Restart and select a model

  1. Close the old session. If you saved user-level environment variables, open a new terminal. If you set them only in the current terminal, launch from that terminal.
  2. Run opencode in your project directory.
  3. Enter /models and search for viviapi or ViVi-API.
  4. Select the model and send a short test message.
For version-specific changes, see the OpenCode configuration docs and provider docs. See the Integration overview and FAQ for more help.