Use MiniMax M3 with opencode — velqa.dev
Configure opencode to use MiniMax M3 through velqa.dev. Checkout is Stripe, in USD, by international card.
Prerequisites
- opencode installed (
npm install -g opencode-aior via your package manager) - A velqa.dev API key (see the quickstart)
Configuration
opencode reads its config file from ~/.config/opencode/config.json (global) or ./opencode.json at your project root (takes precedence).
Create or edit this file:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"velqa": {
"npm": "@ai-sdk/openai-compatible",
"name": "Velqa",
"options": {
"baseURL": "https://api.velqa.dev/v1",
"apiKey": "{env:VELQA_API_KEY}"
},
"models": {
"minimax-m3": {
"name": "MiniMax M3",
"limit": {
"context": 131072,
"output": 16384
}
},
"hy3": {
"name": "Hunyuan Hy3",
"limit": {
"context": 262144,
"output": 16384
}
},
"glm-4.7-flash": {
"name": "GLM-4.7 Flash",
"limit": {
"context": 200000,
"output": 16384
}
},
"deepseek-v4-flash": {
"name": "DeepSeek V4 Flash",
"limit": {
"context": 65536,
"output": 8192
}
}
}
}
},
"compaction": {
"auto": true,
"prune": true,
"reserved": 10000
}
}The limit block (context window + max output per model) and the compaction block are important: they tell opencode when to automatically compact a long session. compaction.prune drops stale tool outputs that are no longer relevant. Without them, context grows unbounded during an agentic session and eventually triggers Trop de tokens demandes. Reessaie plus tard. — while also burning through your quota faster. The context values match each model's real window (see velqa.dev/models).
Then export the environment variable (add it to your ~/.bashrc or ~/.zshrc):
export VELQA_API_KEY="sk-..."Alternatively, you can hardcode the key in the file (not recommended if the file is version-controlled):
"apiKey": "sk-..."Quick test
Launch opencode in your project:
opencodeType /models to check that the Velqa models appear in the list. Select minimax-m3 and ask a question — the response confirms the connection works.
Recommended models
| Model | Use case | Minimum plan |
|---|---|---|
hy3 | General-purpose and agentic, excellent perf/price ratio | Starter |
minimax-m3 | Code generation, refactoring | Dev |
glm-4.7-flash | General chat, quick tasks — the most responsive | Starter |
deepseek-v4-flash | High-volume, economical | Starter |
Pricing
See velqa.dev/models for the current USD catalogue. Checkout is Stripe, in USD, by international card.
