inference.eu

Coding agents · OpenCode

Use OpenCode with open-source models hosted in the EU

OpenCode is an open-source coding agent for the terminal. Add inference.eu as a custom provider in opencode.json and every prompt, file excerpt and tool call it sends is processed in European data centres, on open-weight models, under a GDPR data processing agreement.

  1. 01API format: OpenAI
  2. 02EU data centres
  3. 03Covered by one DPA

Set it up in a few minutes

  1. 1

    Create an API key in your inference.eu account and export it as INFERENCE_EU_API_KEY in your shell profile.

  2. 2

    Install OpenCode with curl -fsSL https://opencode.ai/install | bash, or npm install -g opencode-ai on Windows.

  3. 3

    Add the inference-eu provider block to opencode.json in your project, or to ~/.config/opencode/opencode.json to use it everywhere.

  4. 4

    Start opencode in your repository and pick a model with /models. Each one is listed as inference-eu/<model id>.

  5. 5

    Ask for a small change, such as a unit test, to confirm that tool calls and file edits work end to end.

opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "model": "inference-eu/qwen3-coder-480b-a35b-instruct",
  "small_model": "inference-eu/gpt-oss-120b",
  "provider": {
    "inference-eu": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "inference.eu",
      "options": {
        "baseURL": "https://api.inference.eu/v1",
        "apiKey": "{env:INFERENCE_EU_API_KEY}"
      },
      "models": {
        "qwen3-coder-480b-a35b-instruct": { "name": "Qwen3 Coder 480B" },
        "gpt-oss-120b": { "name": "gpt-oss-120b" },
        "glm-5.3": { "name": "GLM-5.3" },
        "kimi-k3": { "name": "Kimi K3" }
      }
    }
  }
}

What OpenCode is

OpenCode is an open-source, MIT-licensed coding agent that runs in your terminal. It reads your repository, plans changes, edits files and runs shell commands, asking for permission where you tell it to. It is not tied to one model vendor: providers are defined in a plain JSON file, and any service that speaks the OpenAI Chat Completions format can be added as a custom provider.

That makes it a natural fit for open-weight models. You keep the agent you like and choose where the model runs.

How the configuration works

OpenCode loads custom providers through the AI SDK. The npm field selects @ai-sdk/openai-compatible, which talks to the /chat/completions endpoint. options.baseURL points at inference.eu and options.apiKey reads your key from the environment with the {env:...} syntax, so the key never sits in a file you might commit.

OpenCode does not discover models from /v1/models. List each model you want under models; the key must be the exact model id. The model and small_model fields set the defaults, written as inference-eu/<model id>. You can add limit.context and limit.output per model so OpenCode knows how much context is left.

Which models to choose

For day-to-day agent work, start with qwen3-coder-480b-a35b-instruct. It is trained for code and agentic tool use, and it handles long multi-file edits well. glm-5.3 and kimi-k3 are strong general models with reliable tool calling and are worth trying on tasks that need more planning or reading of documentation.

Set small_model to gpt-oss-120b. OpenCode uses the small model for session titles and other light tasks, and a fast model keeps those calls cheap and quick. Switching models mid-session with /models is fine, so you can compare them on your own codebase.

Troubleshooting

A 401 error means the key did not reach OpenCode. Check that INFERENCE_EU_API_KEY is exported in the same shell you start opencode from, and run opencode auth list to see stored credentials. If you added the key with /connect, the provider id there must match inference-eu exactly.

A "model not found" error almost always means the key under models differs from the model id on inference.eu. Copy the id exactly. If the agent describes edits instead of making them, the model is not returning tool calls: switch to one of the coding models above. Make sure baseURL ends in /v1 and has no trailing path.

Keeping code and data in the EU

OpenCode runs locally and sends model requests straight from your machine to the provider you configure. With inference.eu as the only provider, prompts, file contents and tool results are processed in EU data centres and are never used to train models. We sign a data processing agreement under Article 28 GDPR and give you our subprocessor list, and usage is billed in euros.

To make sure nothing goes elsewhere, remove other providers from your config and set both model and small_model to inference.eu models, so background tasks such as titles stay on the same endpoint.

OpenCode: common questions

The questions buyers, developers and legal teams ask us most. Something missing? Ask us directly.

Ask a question

Move your AI workloads to EU infrastructure

Tell us which models you use and roughly how much traffic you have. We reply within one working day with pricing and next steps.

  • Reply within one working day
  • Pricing for your volume
  • DPA ready to sign