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.
- Custom provider
- Provider list
Add Fortytwo as a custom OpenAI-compatible provider in the OpenCode config file. This gives you every Fortytwo model as soon as it is available. OpenCode in the terminal reads the same file.
1
Install OpenCode Desktop
Download the app from opencode.ai/download :
.dmg for macOS (Apple Silicon or Intel), .exe for Windows, .deb, .rpm or AppImage for Linux. Install it.On macOS, you can also install it with Homebrew:2
Add Fortytwo to the config
Open If the file has other settings, add
~/.config/opencode/opencode.json and add the fortytwo provider with the Fortytwo models. 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. If you set up Fortytwo earlier, for example for OpenCode in the terminal, it is already in this file: add the models it does not have yet.Then open OpenCode Desktop. If it was open, quit and open it again.3
Connect Fortytwo
-
On the home screen, open Settings (Cmd+, on macOS, Ctrl+, on Windows and Linux), then Providers. If the config is correct, Connected providers shows Fortytwo with the Config tag. To use it, enter your API key in the next steps.


-
Select Show more providers at the bottom of the page. Type
Fortytwoin Search providers and select Fortytwo.
-
Paste your API key into Fortytwo API key and select Continue.

-
OpenCode shows Fortytwo connected and the list of Fortytwo models. Choose DeepSeek V4.1 Flash 1017, or another model from the config.

4
Choose the reasoning level
In the reasoning picker next to the model under the message box, keep Default, the model’s own level (
high on DeepSeek V4.1 Flash 1017), or choose Low, Medium or High. Shift+Cmd+D (Shift+Ctrl+D on Windows and Linux) switches to the next level.
5
Start a task
Type a task in the message box and press Enter. To change the model later, select it under the message box (Cmd+’ on macOS, Ctrl+’ on Windows and Linux).

fortytwo/qwen/qwen3.8-27b. More options: OpenCode providers .
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.

