Skip to main content
OpenCode is an open-source coding agent. Sail is OpenAI-compatible, so plugging it in is just a config change.

Install

Follow the install instructions at opencode.ai. The most common path is:

Get your API key

Sign up for Sail and create an API key.

Configure

Create your OpenCode config with Sail as a provider:
Then put this in ~/.config/opencode/opencode.jsonc:
Replace YOUR_SAIL_API_KEY with the key you created above.

Run

Once OpenCode is up, run /models and search “Sail” to choose a GLM-5.2 completion window. See Completion windows for latency and cost tradeoffs.

Control reasoning

The GLM-5.2 entries above define none, high, and xhigh reasoning variants. Press Ctrl+T in the OpenCode terminal UI to switch variants. The selected variant sets Sail’s reasoning effort until you switch again. Run /thinking to show the reasoning blocks returned by the model:
/thinking only controls whether OpenCode displays those blocks. It does not change the model’s reasoning effort. See OpenCode’s reasoning variant and /thinking documentation for more detail. Sail accepts none, minimal, low, medium, high, and xhigh for models that support reasoning. See the API support matrix for the request and streaming response fields. The example includes the off, high, and maximum settings. You can add the other effort levels as variants if you need them. To make high reasoning the model default, add reasoningEffort to the model’s options:
OpenCode uses the camelCase reasoningEffort config key and sends it to Sail as reasoning_effort. For a non-interactive request, select the variant and show its reasoning with:

Tips

  • What’s next: see OpenCode’s Usage guide.
  • New models: add any other model from Sail’s model catalog under provider.Sail.models.