OpenCode
Use Fusion Model with OpenCode.
Fusion configuration
Use a FUMO Dashboard key for an account registered and funded online.
| Parameter | Value |
|---|---|
| Base URL | https://capi.fumolab.ai/api/fusion/v1 |
| Available model IDs | fusion-max-2.0, fusion-code-1.0 |
| API protocol | OpenAI Chat Completions API |
What is OpenCode?
OpenCode↗ is an open-source coding agent available in the terminal and as a desktop application. It supports custom providers, project-aware coding workflows, multiple sessions, and language-server integration.
Fusion connects through OpenCode's OpenAI-compatible Chat Completions adapter.
Quick start
Step 1: Install OpenCode
Install OpenCode using its install script:
curl -fsSL https://opencode.ai/install | bash
For npm, Homebrew, Windows, and other installation methods, see the OpenCode installation guide↗.
Step 2: Get your FUMO API key
Follow Getting started for online self-service accounts (see Enterprise onboarding for enterprise accounts) to create and store your API key. If you use FUMO and have a sales representative, enter their Sales Code at signup or bind it later as described in Console and account.
Step 3: Add your Fusion credential
Start OpenCode in your project:
cd /path/to/your/project
opencode
Run /connect, scroll to Other, and enter:
Provider ID: fumo
API key: your FUMO API key
The provider ID must be fumo so it matches the configuration below.
Step 4: Configure the provider
Create or update opencode.json in your project:
{
"$schema": "https://opencode.ai/config.json",
"model": "fumo/fusion-max-2.0",
"provider": {
"fumo": {
"npm": "@ai-sdk/openai-compatible",
"name": "FUMO",
"options": {
"baseURL": "https://capi.fumolab.ai/api/fusion/v1"
},
"models": {
"fusion-code-1.0": {
"name": "Fusion Code"
},
"fusion-max-2.0": {
"name": "Fusion Max 2.0"
}
}
}
}
}
@ai-sdk/openai-compatible keeps this configuration on /chat/completions. Fusion also exposes /responses; OpenCode uses @ai-sdk/openai for providers configured on that endpoint.
Step 5: Select Fusion Max 2.0
Run:
/models
The configuration above defaults to Fusion Max 2.0. To select it manually, choose FUMO, then Fusion Max 2.0. Your OpenCode requests will use fusion-max-2.0.
Choose a model ID
Use /models at any time to switch between the model IDs authorized for your key:
- Fusion Max 2.0 — the recommended default for coding, agents, and document analysis.
- Fusion Code — available for coding and software-agent workflows.
OpenCode requires named models in its provider configuration. The public gateway validates the transmitted ID; after acceptance, the Fusion core treats it as a compatibility label and the internal topology remains configuration-controlled.
Troubleshooting
Authentication error
Run opencode auth list and confirm that a credential exists for fumo. If necessary, repeat /connect and use the same provider ID as opencode.json.
Model not found
Confirm that the ID is listed under provider.fumo.models in opencode.json and authorized for your key. A client or public gateway may reject the model before the request reaches the Fusion core.
404 from the API
Set options.baseURL to https://capi.fumolab.ai/api/fusion/v1. OpenCode appends /chat/completions.
Tools do not work
Confirm that the provider uses @ai-sdk/openai-compatible. If the client adds provider-specific request fields, compare the request with the Fusion Chat Completions contract.
Resources
- OpenCode website↗
- OpenCode provider documentation↗
- OpenCode model configuration↗
- OpenCode on GitHub↗
- Fusion Chat Completions API
- Fusion Responses API
Supported models: fusion-max-2.0, fusion-code-1.0. Only Max 2.0 supports low / medium / high / xhigh / max effort (recommended high, default medium); Code 1.0 does not support adjustment.

