Skip to content
Last verified:

Verification scope not recorded

OpenCode Guide ​

OpenCode is an open-source AI coding assistant framework. It supports integration with multiple AI models, including code generation, modification, and review workflows.

Installation ​

Choose an installation method based on your workflow.

macOS / Linux

bash
curl -fsSL https://opencode.ai/install | bash

Windows PowerShell

Using WSL is recommended. Install it with the macOS / Linux method above inside WSL.

Connect to Flux ​

After installation, choose one of the following methods to connect OpenCode to Flux.

Using CC-Switch is recommended for centralized configuration.

Steps:

  1. Follow Create API Key to generate an API key.
  2. Follow CC-Switch to configure a unified provider.
  3. Restart OpenCode after configuration is complete.

Verify the Setup ​

Either configuration path can be confirmed with:

bash
opencode models
opencode run -m openai/<model-id> "Reply with OK only"

opencode models lists the loaded models; seeing your model ID there means the configuration was picked up. opencode run makes a real, billed call, and a reply means the setup works.

If the commands fail or the model list is empty, first rule the client out with Test the Key and Endpoint on Their Own, then review opencode.json.

Flux Integration Docs