Terminal coding agent · ScaleMax integration
Configure OpenCode with the ScaleMax API
OpenCode reads providers from opencode.json. Add a ScaleMax provider on the OpenAI-compatible adapter, keep the key in its own file, and select models with the scalemax/ prefix.
- Choose in the client
- A custom provider using @ai-sdk/openai-compatible in opencode.json
- Protocol
- OpenAI Chat Completions
- ScaleMax installer
- Supported
- Video lesson
- In the dashboard
OpenCode settings for ScaleMax
Enter these values in OpenCode. A Pay as you go key and a token pack key use different base URLs — use the one that matches the key you bought.
| Setting | Value |
|---|---|
| Config file | ~/.config/opencode/opencode.json |
| Key file | ~/.config/opencode/scalemax.key (never in the JSON itself) |
| baseURL | https://api.scalemax.pro/v1 — change only this to https://api.scalemax.pro/token/v1 for a token pack |
| Model | scalemax/<model-id>, for example scalemax/gpt-5.6-terra |
{
"provider": {
"scalemax": {
"npm": "@ai-sdk/openai-compatible",
"name": "ScaleMax",
"options": {
"baseURL": "https://api.scalemax.pro/v1",
"apiKey": "{file:~/.config/opencode/scalemax.key}"
},
"models": { "gpt-5.6-terra": {}, "gpt-5.6-luna": {} }
}
},
"model": "scalemax/gpt-5.6-terra",
"small_model": "scalemax/gpt-5.6-luna"
}Step by step
- Save your key on its own line in ~/.config/opencode/scalemax.key.
- Add the scalemax provider block to opencode.json with the base URL for your key.
- List the model IDs you want under "models" and set "model" and "small_model" with the scalemax/ prefix.
- Start OpenCode and run a short prompt to confirm.
Or let the installer do it
Choose OpenCode. The installer backs up your existing opencode.json before writing the provider.
npm install -g scalemax@latest && scalemaxA recorded walkthrough is on the Video setup page in the ScaleMax dashboard (sign-in required).
Models to use in OpenCode
Rates are the published ScaleMax rates per million tokens, read from the live catalogue. Your key must include a model before OpenCode can call it — GET /v1/models with the key lists exactly which.
GPT models
| Model | Model ID | Input / 1M tokens | Output / 1M tokens |
|---|---|---|---|
| GPT-6.1 Sol | gpt-6.1-sol | $2 | $10 |
| GPT-6 Sol | gpt-6-sol | $2 | $10 |
| GPT-6 Luna | gpt-6-luna | $0.10 | $0.50 |
Claude models
| Model | Model ID | Input / 1M tokens | Output / 1M tokens |
|---|---|---|---|
| Claude Haiku 4.5 | claude-haiku-4-5-20251001 | $1 | $5 |
| Claude Haiku 5.5 | claude-haiku-5-5 | $0.20 | $1 |
| Claude Opus 4.6 | claude-opus-4-6 | $5 | $25 |
DeepSeek, Gemini and other models
| Model | Model ID | Input / 1M tokens | Output / 1M tokens |
|---|---|---|---|
| DeepSeek V4 Pro | deepseek-v4-pro | $1 | $4 |
| DeepSeek V4 Flash | deepseek-v4-flash | $0.19 | $0.51 |
| Gemini 3.8 Flash | gemini-3.8-flash | $0.75 | $3.75 |
Good to know
- The scalemax/ prefix only selects OpenCode’s provider; ScaleMax receives the exact model ID after the slash.
- For Claude models, add per-model limit values so OpenCode does not request more output than the model allows.
- OpenCode talks to ScaleMax through an OpenAI-compatible adapter, so a few Responses-only behaviours are not available.
Troubleshooting
- OpenCode says the provider has no key
- Check the {file:…} path matches where you saved the key and that the file holds only the key.
- Model not found
- Use the ID exactly as the catalogue lists it after the scalemax/ prefix, and make sure your key includes that model.
ScaleMax is not affiliated with the makers of OpenCode. Compatibility describes the API protocol; OpenCode's own features and plans are provided by its developer.
OpenCode and ScaleMax: questions
Where does OpenCode keep the ScaleMax configuration?
In ~/.config/opencode/opencode.json, with the key in a separate ~/.config/opencode/scalemax.key file that the JSON reads with {file:…}.
How do I use a token pack key in OpenCode?
Change only the baseURL to https://api.scalemax.pro/token/v1. Everything else stays the same.
Are there OpenCode setup videos?
Yes. The ScaleMax dashboard’s Video setup page has two OpenCode lessons for Windows. You need to be signed in to watch them.
Related setup guides
Run OpenCode on a prepaid key
Pay by UPI, card or crypto, copy the base URL and model ID, and you are coding in minutes. No subscription.