OpenCode talks to Dahl as an OpenAI-compatible provider. It needs three things: the base URL with /v1, a key with tokens on it, and a model ID.
Setup
- Get a key with tokens — in /account create a key and Allocate tokens to it from the pool (a new key starts at 0).
- Add the provider — put this into
~/.config/opencode/opencode.json(oropencode.jsonin the project):
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"dahl": {
"npm": "@ai-sdk/openai-compatible",
"name": "Dahl",
"options": {
"baseURL": "https://inference.dahl.global/v1",
"apiKey": "{env:DAHL_API_KEY}"
},
"models": {
"MiniMaxAI/MiniMax-M2.7": { "name": "MiniMax M2.7" },
"deepseek-ai/DeepSeek-V4-Flash-0731": { "name": "DeepSeek V4 Flash" },
"zai-org/GLM-5.3-Flash": { "name": "GLM 5.3 Flash" }
}
}
}
}3. Give OpenCode the key. Either export it in the shell where you run opencode:
export DAHL_API_KEY="dahl_…"
or store it in OpenCode instead of an env var:
opencode auth login # → Other → provider id: dahl → paste your dahl_… key
4. Pick the model — run opencode, type /models, choose a Dahl model. Start with MiniMaxAI/MiniMax-M2.7; current IDs are in GET /v1/models.
Common errors
| Message | Cause | Fix |
|---|---|---|
| No active credentials for provider: dahl | The provider is configured but has no key | Export DAHL_API_KEY in the same shell, or run opencode auth login |
Method Not Allowed (405) | baseURL without /v1 | Use https://inference.dahl.global/v1 |
available tokens exhausted (402) | The key has 0 tokens | Allocate from the pool in /account |
| This model is not currently offered | Stale model ID | Pick an id from GET /v1/models and update models in the config |