Skip to content
DOCS / OpenCode

OpenCode

Add Inference.net as an OpenCode provider.

fast opencode on adds an inference-net provider to ~/.config/opencode/opencode.json and sets it as OpenCode's model and small_model. Other providers and settings in the file are left in place.

Connect OpenCode

  1. Install

    bash
    npm install -g @inference/fast
  2. Activate

    bash
    fast opencode on

    The first run signs you in through the browser and creates an API key for this machine. The command backs up OpenCode's config before editing it.

  3. Restart OpenCode

    Restart OpenCode and send a prompt; the request appears under Usage.

Choose a model

OpenCode uses kimi-k3-fast unless you pick another ID from the model catalog:

bash
# Set the model for every agent
fast opencode on --model kimi-k3-fast

# Set the model per agent
fast opencode on --build kimi-k3-fast --plan deepseek-v4-flash-0731

--build and --plan pin OpenCode's build and plan agents; both default to --model. Run on again to change them. Restart OpenCode afterward.

Switch models in OpenCode

Every model from the model catalog is registered under the inference-net provider. Open the picker with /models (or Ctrl+X then M); the choice is remembered for your next session. Reasoning models expose their effort levels as variants — cycle them with Ctrl+T.

Check status

bash
fast opencode status

Shows the connection, model, and config paths.

Disconnect

bash
fast opencode off

Restores opencode.json to the backup taken by on, so edits made after connecting are lost. Restart OpenCode afterward.

Troubleshooting

  • fast opencode on fails to read the config — fix the JSON syntax in opencode.json first.
  • Requests return 401 — run fast status, then fast opencode on.
  • Model rejected — pick an ID from the model catalog.