> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fortytwo.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect OpenCode Desktop

> Set up the OpenCode desktop app with the Fortytwo API: add Fortytwo as a custom OpenAI-compatible provider with every Fortytwo model, or connect it from the OpenCode provider list.

[OpenCode Desktop ](https://opencode.ai/download) is the desktop app of [OpenCode](https://docs.fortytwo.network/agents/opencode.md) for macOS, Windows and Linux.

> [!NOTE]
>
> **Before you start:** create a Fortytwo API key and buy credits — see [Quickstart, step 1](https://docs.fortytwo.network/docs/quickstart.md#1-create-an-api-key). Give each agent its own key with a **Spend limit**.
>
> | Setting | Value |
> | - | - |
> | Base URL | `https://api.fortytwo.network/v1` |
> | Model ID | `qwen/qwen3.8-27b` in this guide, or another ID from [Models](https://docs.fortytwo.network/docs/models.md) |

> [tab] Custom provider
>
> 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 ](https://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:
>
> ```bash theme={null}
> brew install --cask opencode-desktop
> ```
>
> **2. Add Fortytwo to the config**
>
> Open `~/.config/opencode/opencode.json` and add the `fortytwo` provider with the Fortytwo models. For a new file:
>
> > [!NOTE]
> >
> > `~` 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.
>
> ```json ~/.config/opencode/opencode.json theme={null}
> {
>   "$schema": "https://opencode.ai/config.json",
>   "provider": {
>     "fortytwo": {
>       "npm": "@ai-sdk/openai-compatible",
>       "name": "Fortytwo",
>       "options": {
>         "baseURL": "https://api.fortytwo.network/v1"
>       },
>       "models": {
>         "qwen/qwen3.8-27b": {
>           "name": "Qwen3.8 27B",
>           "reasoning": true,
>           "tool_call": true,
>           "attachment": true,
>           "modalities": { "input": ["text", "image"], "output": ["text"] },
>           "limit": { "context": 262144, "output": 235929 }
>         },
>         "deepseek/deepseek-v4.1-flash-1017": {
>           "name": "DeepSeek V4.1 Flash 1017",
>           "reasoning": true,
>           "tool_call": true,
>           "attachment": true,
>           "modalities": { "input": ["text", "image"], "output": ["text"] },
>           "limit": { "context": 1048576, "output": 262144 }
>         },
>         "deepseek/deepseek-v4.1-flash-1017:free": {
>           "name": "DeepSeek V4.1 Flash 1017 Free",
>           "reasoning": true,
>           "tool_call": true,
>           "attachment": true,
>           "modalities": { "input": ["text", "image"], "output": ["text"] },
>           "limit": { "context": 1048576, "output": 262144 }
>         },
>         "nvidia/nemotron-3.5-super-vl": {
>           "name": "Nemotron 3.5 Super VL",
>           "reasoning": true,
>           "tool_call": true,
>           "attachment": true,
>           "modalities": { "input": ["text", "image"], "output": ["text"] },
>           "limit": { "context": 262144, "output": 235929 }
>         }
>       }
>     }
>   }
> }
> ```
>
> If the file has other settings, add `fortytwo` inside its `provider` object. If you set up Fortytwo earlier, for example for [OpenCode](https://docs.fortytwo.network/agents/opencode.md) 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**
>
> 1. 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.
>
>    ![OpenCode Desktop: Settings on the home screen](https://mintcdn.com/fortytwo-f43ac997/5C0ZMS6iJTh4KOep/resources/illustrations/agents/opencode-desktop-2.png?fit=max\&auto=format\&n=5C0ZMS6iJTh4KOep\&q=85\&s=bb958c78654cf4ecf86d7d443aa1d440)
>
>    ![OpenCode Desktop: Fortytwo with the Config tag under Connected providers](https://mintcdn.com/fortytwo-f43ac997/5C0ZMS6iJTh4KOep/resources/illustrations/agents/opencode-desktop-json-2.png?fit=max\&auto=format\&n=5C0ZMS6iJTh4KOep\&q=85\&s=c9a3a2e154d168901b961b9eda5caad1)
>
> 2. Select **Show more providers** at the bottom of the page. Type `Fortytwo` in **Search providers** and select **Fortytwo**.
>
>    ![OpenCode Desktop: Fortytwo found in the Integrations search](https://mintcdn.com/fortytwo-f43ac997/5C0ZMS6iJTh4KOep/resources/illustrations/agents/opencode-desktop-3.png?fit=max\&auto=format\&n=5C0ZMS6iJTh4KOep\&q=85\&s=37bb994410d70ddb2d0915bfa9971d94)
>
> 3. Paste your API key into **Fortytwo API key** and select **Continue**.
>
>    ![OpenCode Desktop: Connect Fortytwo with the API key field and Continue](https://mintcdn.com/fortytwo-f43ac997/5C0ZMS6iJTh4KOep/resources/illustrations/agents/opencode-desktop-4.png?fit=max\&auto=format\&n=5C0ZMS6iJTh4KOep\&q=85\&s=38a5883b7734ad70228e42c430541a61)
>
> 4. OpenCode shows **Fortytwo connected** and the list of Fortytwo models. Choose **DeepSeek V4.1 Flash 1017**, or another model from the config.
>
>    ![OpenCode Desktop: Fortytwo models from the config, DeepSeek V4.1 Flash 1017 selected, Fortytwo connected](https://mintcdn.com/fortytwo-f43ac997/5C0ZMS6iJTh4KOep/resources/illustrations/agents/opencode-desktop-json-5.png?fit=max\&auto=format\&n=5C0ZMS6iJTh4KOep\&q=85\&s=322aa58a91799ad1a01b968a71234db9)
>
> **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.
>
> ![OpenCode Desktop: reasoning picker next to Fortytwo / DeepSeek V4.1 Flash 1017, with High](https://mintcdn.com/fortytwo-f43ac997/5C0ZMS6iJTh4KOep/resources/illustrations/agents/opencode-desktop-json-7.png?fit=max\&auto=format\&n=5C0ZMS6iJTh4KOep\&q=85\&s=5195af156a43a4679596eaca863cafb1)
>
> **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).
>
> ![OpenCode Desktop: reply from Fortytwo / DeepSeek V4.1 Flash 1017 with reasoning High](https://mintcdn.com/fortytwo-f43ac997/5C0ZMS6iJTh4KOep/resources/illustrations/agents/opencode-desktop-json-6.png?fit=max\&auto=format\&n=5C0ZMS6iJTh4KOep\&q=85\&s=0d8dfccfef8447c0ffa70c99e655a454)

> [tab] Provider list
>
> Fortytwo is in the OpenCode provider list: you connect it with your API key and do not edit a config file. OpenCode updates this list on its own schedule, so new Fortytwo models can appear here later. To use any Fortytwo model right away, follow the **Custom provider** tab.
>
> **1. Install OpenCode Desktop**
>
> Download the app from [opencode.ai/download ](https://opencode.ai/download): `.dmg` for macOS (Apple Silicon or Intel), `.exe` for Windows, `.deb`, `.rpm` or AppImage for Linux. Install it and open it.
>
> On macOS, you can also install it with Homebrew:
>
> ```bash theme={null}
> brew install --cask opencode-desktop
> ```
>
> **2. Connect Fortytwo**
>
> 1. On the home screen, open **Settings** (**Cmd+,** on macOS, **Ctrl+,** on Windows and Linux), then **Providers**.
>
>    ![OpenCode Desktop: Settings on the home screen](https://mintcdn.com/fortytwo-f43ac997/5C0ZMS6iJTh4KOep/resources/illustrations/agents/opencode-desktop-2.png?fit=max\&auto=format\&n=5C0ZMS6iJTh4KOep\&q=85\&s=bb958c78654cf4ecf86d7d443aa1d440)
>
> 2. Select **Show more providers** at the bottom of the page. Type `Fortytwo` in **Search providers** and select **Fortytwo**.
>
>    ![OpenCode Desktop: Fortytwo found in the Integrations search](https://mintcdn.com/fortytwo-f43ac997/5C0ZMS6iJTh4KOep/resources/illustrations/agents/opencode-desktop-3.png?fit=max\&auto=format\&n=5C0ZMS6iJTh4KOep\&q=85\&s=37bb994410d70ddb2d0915bfa9971d94)
>
> 3. Paste your API key into **Fortytwo API key** and select **Continue**.
>
>    ![OpenCode Desktop: Connect Fortytwo with the API key field and Continue](https://mintcdn.com/fortytwo-f43ac997/5C0ZMS6iJTh4KOep/resources/illustrations/agents/opencode-desktop-4.png?fit=max\&auto=format\&n=5C0ZMS6iJTh4KOep\&q=85\&s=38a5883b7734ad70228e42c430541a61)
>
> 4. OpenCode shows **Fortytwo connected** and the list of Fortytwo models. Choose **Qwen3.8 27B**.
>
> **3. Choose the reasoning level**
>
> In the reasoning picker next to the model under the message box, choose **Xhigh**, the recommended level, or keep **Default** (`medium` on Qwen3.8 27B), which uses fewer tokens. **Shift+Cmd+D** (**Shift+Ctrl+D** on Windows and Linux) switches to the next level.
>
> ![OpenCode Desktop: reasoning picker next to Fortytwo / Qwen3.8 27B, with Xhigh](https://mintcdn.com/fortytwo-f43ac997/5C0ZMS6iJTh4KOep/resources/illustrations/agents/opencode-desktop-5.png?fit=max\&auto=format\&n=5C0ZMS6iJTh4KOep\&q=85\&s=8f7692a38d306141faad71d4d9fe0eea)
>
> **4. 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).
>
> ![OpenCode Desktop: reply from Fortytwo / Qwen3.8 27B with reasoning Xhigh](https://mintcdn.com/fortytwo-f43ac997/5C0ZMS6iJTh4KOep/resources/illustrations/agents/opencode-desktop-6.png?fit=max\&auto=format\&n=5C0ZMS6iJTh4KOep\&q=85\&s=707bf425e9449b8f19d7135cdf3adaf5)

The model ID inside OpenCode is the provider ID, then the Fortytwo model ID, for example `fortytwo/qwen/qwen3.8-27b`. More options: [OpenCode providers ](https://opencode.ai/docs/providers/).

***

Something not working with your agent, or using one we have not listed? Tell us in the platform: [Feedback](https://docs.fortytwo.network/docs/support.md#ideas-feedback-and-small-bugs) for ideas and small bugs, [Contact support](https://docs.fortytwo.network/docs/support.md#support-account-api-billing-credits-errors) if it blocks your work, or [Report a security issue](https://docs.fortytwo.network/docs/support.md#security-issue).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.