Skip to main content
OpenCode is a coding agent for the terminal.
Before you start: create a Fortytwo API key and buy credits — see Quickstart, step 1. Give each agent its own key with a Spend limit.
1

Install OpenCode

Open a new terminal window when the installer finishes: the opencode command works only there. Other install options: OpenCode on GitHub .
2

Add Fortytwo to the config

Open ~/.config/opencode/opencode.json and add the fortytwo provider. For a new file:
~ is your home folder. Folders that start with a dot, such as .pi, .config or .codex, are hidden. To show them: Cmd+Shift+. in Finder on macOS, View → Show → Hidden items in File Explorer on Windows, Ctrl+H in most Linux file managers.
~/.config/opencode/opencode.json
If the file has other settings, add fortytwo inside its provider object.Fortytwo is also in the OpenCode provider list, so /connect finds it without this file. OpenCode updates that list on its own schedule, so new Fortytwo models can appear there later. The config gives you every model at once.Another model works the same way: take its ID, context window and max output from Models.
3

Connect Fortytwo

  1. Start OpenCode in your project folder:
  1. Type /connect, search for Fortytwo and select it. OpenCode: Fortytwo in the Connect an integration list
  2. Paste your API key and press Enter. OpenCode shows Connected Fortytwo.
  3. OpenCode opens the model list. Choose Qwen3.8 27B. OpenCode: Qwen3.8 27B under Fortytwo, with the Connected Fortytwo message
  4. In Select variant, choose medium to turn on reasoning. OpenCode: Select variant with medium selected
The prompt shows Qwen3.8 27B Fortytwo · medium.OpenCode: prompt with Qwen3.8 27B Fortytwo and variant medium
4

Start a task

Type a task and press Enter. To change the model later, type /models; to change the reasoning level, type /variants.OpenCode: task done on Qwen3.8 27B Fortytwo with variant medium
The model ID inside OpenCode is fortytwo/qwen/qwen3.8-27b: the provider ID, then the Fortytwo model ID. More options: OpenCode custom provider .
Something not working with your agent, or using one we have not listed? Tell us in the platform: Feedback for ideas and small bugs, Contact support if it blocks your work, or Report a security issue.
Last modified on December 3, 2026