Connect OpenCode
Connect OpenCode Desktop to Maple Proxy with a custom OpenAI-compatible provider, a Maple API key and a tool-capable model, with a link to CLI setup.
Start Maple Work’s Local API or Maple Research’s Local Proxy. For coding agents, choose a model with tool support. Research also has a filled-in guide under Local Proxy → Connect your tools.
OpenCode Desktop
- Create a Maple API key.
- In OpenCode, open Settings → Providers → Custom Provider → Connect.
- Enter these values, then connect and select the model:
| Field | Value |
|---|---|
| Provider ID | maple-local |
| Display name | Maple (local proxy) |
| Base URL | The URL shown in Maple; default http://127.0.0.1:8080/v1 |
| API key | The Maple key you just created |
| Model ID | gpt-oss-120b, or another tool-capable Maple model |
| Model name | Any label you like |
| Headers | Leave blank |
Use a real key: Work requires it on every API request, and a placeholder overrides Research’s saved key. When rotating a key, disconnect and reconnect the provider.
Set the context limit
OpenCode does not read a custom provider’s context window, so a long session can grow past what the model accepts and stop with a 400 error. Add each model’s limit to your opencode.json, under the same provider ID:
{
"provider": {
"maple-local": {
"models": {
"gpt-oss-120b": {
"limit": { "context": 131072, "output": 32000 }
}
}
}
}
} Take context from the model table; for kimi-k3-1-pro it is 262144. OpenCode then compacts the session before it fills the window. If a request is still rejected for its context length, run /compact and continue.
OpenCode CLI
Follow OpenCode’s custom provider setup. Use the same base URL, real Maple key, model ID and context limit above with its OpenAI-compatible provider. For request failures, see troubleshooting.