Black Friday: Pro half price, bonus credits on Max. Through Mon: 50% off Pro, bonus credits on Max
DocsMaple Proxy

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

  1. Create a Maple API key.
  2. In OpenCode, open Settings → Providers → Custom Provider → Connect.
  3. Enter these values, then connect and select the model:
FieldValue
Provider IDmaple-local
Display nameMaple (local proxy)
Base URLThe URL shown in Maple; default http://127.0.0.1:8080/v1
API keyThe Maple key you just created
Model IDgpt-oss-120b, or another tool-capable Maple model
Model nameAny label you like
HeadersLeave 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:

JSON
{
  "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.

Last updated