# OpenCode × Vivgrid

> Source: https://vivgrid.com/docs/tutorials/opencode

How to use Vivgrid with gemini-4-argon in OpenCode.ai

## OpenCode

[OpenCode.ai](https://opencode.ai) is an open-source, model-agnostic AI coding agent designed to bring powerful AI assistance directly into developers’ workflows—whether you are working in the terminal, using a desktop application, or inside an IDE extension.

Key features include:

- **Terminal-first, multi-interface design**\
  A native terminal UI (TUI), with optional desktop and IDE extensions, allows developers to work in their preferred environment.
- **Context-aware intelligence**\
  Language Server Protocol (LSP) integration enables deep understanding of project structure and symbols.
- **Multi-session collaboration**\
  Run parallel agent sessions within the same repository and share them for collaborative debugging or review.
- **Privacy-first by design**\
  Code and project context are not stored on remote servers, making OpenCode suitable for sensitive or proprietary codebases.

## Configure OpenCode.ai to Use Vivgrid (Gemini 4 Argon)

One of OpenCode’s core strengths is its clean separation between **authentication** and **runtime model configuration**. Credentials are configured independently from model selection, allowing you to switch providers or models without changing your workflow.

To use [Vivgrid](https://vivgrid.com) as the provider and `gemini-4-argon` as the model, you only need to configure as:

<Steps>
  <Step title ="Step 1: Open OpenCode">
    ![](/images/opencode/oc-1.png)
  </Step>

  <Step title ="Step 2: `/models`">
    ![](/images/opencode/oc-2.png)
  </Step>

  <Step title ="Step 3: Precess `ctrl-a` to see all providers">
    ![](/images/opencode/oc-3.png)
  </Step>

  <Step title ="Step 4: Search `vivgrid`">
    ![](/images/opencode/oc-5.png)
  </Step>

  <Step title ="Step 5: Enter your vivgrid api-key which can be grab from [Vivgrid Console](https://console.vivgrid.com)">
    ![](/images/opencode/oc-6.png)
  </Step>

  <Step title ="Step 6: Select `gemini-4-argon`, or any other model you want to use">
    ![](/images/opencode/oc-7.png)
  </Step>

  <Step title ="Step 8: Enjoy">
    ![](/images/opencode/oc-8.png)
  </Step>
</Steps>

## Make gemini-4-argon the Default

OpenCode remembers the last model you picked. To pin `gemini-4-argon` as the default for every new session, set `model` in `~/.config/opencode/opencode.json`:

```json title="~/.config/opencode/opencode.json" lines icon="json" highlight={3}
{
  "$schema": "https://opencode.ai/config.json",
  "model": "vivgrid/gemini-4-argon"
}
```

## Debugging

If you encounter issues, enable detailed logs:

```sh
opencode run "hello" --print-logs --log-level DEBUG
```

This will surface provider initialization, model resolution, and API-level errors.

## GUI

This configuration also works for OpenCode GUI App.

<Card title="OpenCode with Vivgrid Provider">
  ![](/images/opencode/opencode-4.png)

  ![](/images/opencode/opencode-gui.png)
</Card>

## Summary

With only two small configuration files, [OpenCode](https://opencode.ai) becomes a provider-agnostic AI coding agent, while [Vivgrid](https://vivgrid.com) serves as a drop-in, OpenAI-compatible backend for [gemini-4-argon](/docs/models/gemini-4-argon), [gpt-6-sol](/docs/models/gpt-6-sol) and [gpt-6-astra](/docs/models/gpt-6-astra).

This clear separation between credential management and runtime configuration is what makes OpenCode especially well-suited for advanced models, custom providers, and production-grade AI coding workflows.
