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
opencode command works only there. Other install options: OpenCode on GitHub .2
Add Fortytwo to the config
Open If the file has other settings, add
~/.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
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
- Start OpenCode in your project folder:
-
Type
/connect, search forFortytwoand select it.
- Paste your API key and press Enter. OpenCode shows Connected Fortytwo.
-
OpenCode opens the model list. Choose Qwen3.8 27B.

-
In Select variant, choose medium to turn on reasoning.


4
Start a task
Type a task and press Enter. To change the model later, type 
/models; to change the reasoning level, type /variants.
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.