Integrating OpenCode with HPC-AI Tech
In the rapidly evolving landscape of AI agents and developer tooling, OpenCode is emerging as a powerful framework for building flexible, code-driven AI workflows. But like any framework, its true potential depends on the models behind it.
Today, we’ll walk you through how to integrate OpenCode with the HPC-AI Tech Model APIs platform. By the end of this guide, you’ll be able to leverage high-performance models like Minimax-M2.5 directly inside your OpenCode environment.

🚀 Prerequisites
Before we dive in, make sure you have:
-
OpenCode installed and set up
-
An HPC-AI Tech API Key (from the Model APIs platform)
🛠️ Configuration: Choose Your Method
OpenCode offers multiple ways to configure providers depending on your workflow. Pick what suits you best.
Method 1: Interactive Configuration (Recommended)
Best for developers who prefer a guided, in-app setup.
-
Enter your project directory
-
Start OpenCode
-
Run the command:
-
/connect
-
Select provider type:
-
Choose “Other” or “Custom Provider”
-
Or search for the provider name directly
-
-
Enter the following:
-
Base URL: https://api.hpc-ai.com/inference/v1
-
API Key: your-hpc-ai-api-key
-
-
Select the model:
minimax/minimax-m2.5
Method 2: Config File (The Structured Way)
Best for reproducibility, automation, or team environments.
Step 1: Create Config
Create or edit the config file at:
~/.config/opencode/config.json
Add the following:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"hpc-ai": {
"npm": "@ai-sdk/openai-compatible",
"name": "HPC-AI Tech",
"options": {
"baseURL": "https://api.hpc-ai.com/inference/v1",
"apiKey": "{env:HPC_AI_API_KEY}"
},
"models": {
"minimax/minimax-m2.5": {
"name": "HPC-AI Tech"
}
}
}
},
"model": "minimax/minimax-m2.5"
}
Step 2: Add API Key
Create or edit:
~/.local/share/opencode/auth.json
{
"hpc-ai": {
"type": "api",
"key": "sk-your-hpc-ai-api-key"
}
}
Config Priority (Important)
OpenCode resolves configs in the following order:
Method 3: Environmental Variables (The Lightweight Way)
Best for quick setups or CI/CD pipelines.
export HPC_AI_API_KEY="sk-your-hpc-ai-api-key"
export OPENAI_API_BASE="https://api.hpc-ai.com/inference/v1"
✅ Verifying the Connection
After configuration, it’s important to confirm everything is working correctly.
-
Restart OpenCode (if required)
-
Run a test query or agent workflow
-
Ensure responses are returned successfully from the model
A successful response confirms:
-
Your API key is valid
-
The endpoint is reachable
-
The model is correctly configured
🎯 Summary
By integrating OpenCode with HPC-AI Tech, you unlock:
-
Massive context windows
-
Cost-efficient inference
-
Seamless compatibility with OpenAI-style APIs
Whether you're building developer tools, autonomous agents, or production workflows, this setup gives you the performance and flexibility needed to scale.
Happy coding!