AI-assisted coding with OpenCode

This tutorial shows you how to set up OpenCode, an open-source AI coding assistant, to use evroc Think's hosted models. By the end, you'll have a working AI coding environment that runs entirely on European infrastructure.

Why OpenCode with evroc Think?

OpenCode is an open-source alternative to tools like Claude Code and GitHub Copilot. It runs in your terminal and uses AI models to help you write, debug, and understand code.

By connecting OpenCode to evroc Think, you get:

  • Data sovereignty — Your code and prompts stay on European infrastructure
  • Open-source models — Use leading models like Kimi-K2, Llama, and Mistral without vendor lock-in

Prerequisites

Before you begin, you'll need:

  • An evroc account
  • A terminal with command-line access
  • Node.js installed (needed by OpenCode)

Create a project

If you don't already have a project to use, create one in the evroc Console.

  1. Open the evroc Console.
  2. Click + Create Project in the left sidebar.
  3. Enter a name for your project (e.g., opencode).
  4. Click Create.

You can also use an existing project if you have one.

Create an API key

To connect OpenCode to evroc Think, you'll need an API key for the Shared Models service.

  1. In the evroc Console, select your project from the left sidebar.
  2. Navigate to Think > Models.
  3. Click + New in the top right corner.
  4. Select Model, then choose the Shared tab.
  5. Enter a name for your key, for example your username.
  6. Select any model with the Code tag — the key works with all Shared Models.
  7. Click Create API Key.
  8. Copy the API key and save it somewhere secure.

Important: The API key is only shown once. If you lose it, you'll need to create a new one.

Install OpenCode

Install OpenCode following the instructions at opencode.ai/docs/#install.

The easiest way to install OpenCode is through their install script:

curl -fsSL https://opencode.ai/install | bash

Once installed, restart your terminal, then verify it's working by running:

opencode --version

Troubleshooting: If you get command not found, your terminal hasn't loaded the updated PATH. Restart your terminal and try again.

Connect your API key and select a model

Now connect OpenCode to your evroc provider and choose a model.

  1. Open OpenCode by running opencode in your terminal.
  2. Type /connect and hit enter
  3. Select evroc from the list of providers.
  4. Enter your API key when prompted.
  5. Select a model. If you're unsure, we recommend starting with moonshotai/Kimi-K2.5. This can be changed at any point by typing /models.

Try it out

You're ready to use OpenCode with evroc Think. Close the current OpenCode session by pressing Ctrl+C, then navigate to a project directory and start OpenCode again:

cd ~/your-project
opencode

A good starting point is usually to create/update an AGENTS.md file in the project root. OpenCode will use it in future sessions, acting as context for the AI. Do this by entering /init.

Then, try asking the agent to do something:

  • "Explain the structure of this codebase"
  • "Find and fix any bugs in the main function"
  • "Write tests for the authentication module"

OpenCode will read your files, reason about the task, and suggest or make changes.

Important: By default, all tools in OpenCode are enabled, meaning that the agent may decide to run (possibly destructive) bash commands. Therefore, we suggest adding more restrictive permissions to force the agent to ask first. Below is an example that can be put (~/your-project/opencode.json):

{
  "$schema": "https://opencode.ai/config.json",
  "permission": {
    "*": "allow",
    "bash": "ask",
    "websearch": "ask",
    "webfetch": "ask"
  }
}

Next steps