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.
- Open the evroc Console.
- Click + Create Project in the left sidebar.
- Enter a name for your project (e.g.,
opencode). - 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.
- In the evroc Console, select your project from the left sidebar.
- Navigate to Think > Models.
- Click + New in the top right corner.
- Select Model, then choose the Shared tab.
- Enter a name for your key, for example your username.
- Select any model with the Code tag — the key works with all Shared Models.
- Click Create API Key.
- 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.
- Open OpenCode by running
opencodein your terminal. - Type
/connectand hit enter - Select evroc from the list of providers.
- Enter your API key when prompted.
- 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
- Explore OpenCode's features in the OpenCode documentation
- Learn about the available models in Think Models concepts
- Missing a model or want to integrate with some other tool? Reach out to support!