Use OpenCode with free, local, or your own models

OpenCode is an open-source coding agent. Instead of one company’s plan, it uses the models from the providers set up in it, which can include free models, models on your own computer, and providers you pay with an API key.

Before you start

  • Use the Enjoy app on your computer to install and set up OpenCode. After that, you can also use it from the web app.

Steps

  1. Install OpenCode

    Select the agent button at the bottom of the message box, select OpenCode in the Agent column, then select Install OpenCode. Version is set to OpenCode 2, OpenCode’s newest. To install OpenCode 1 instead, choose it there first. See Install an agent.

    The Add OpenCode? window, explaining that Enjoy will install OpenCode and use its available models, with Version set to OpenCode 2 (Recommended). Highlighted: Install OpenCode.The Add OpenCode? window, explaining that Enjoy will install OpenCode and use its available models, with Version set to OpenCode 2 (Recommended). Highlighted: Install OpenCode.
  2. Select Use OpenCode

    OpenCode doesn’t need a sign-in. If it has no models ready, Enjoy shows Set up OpenCode. Add a provider as described below, then select Check connection.

  3. Choose a model

    The Model column lists the models OpenCode offers from your providers. Models running on your computer can take a moment to appear. See Models on your computer below.

  4. Choose Build or Plan

    In the Permissions column, Build makes changes using your OpenCode permission settings, and Plan explores and plans using OpenCode’s Plan mode.

    The agent settings open with OpenCode selected, showing Build and Plan in the Permissions column. Highlighted: Plan.The agent settings open with OpenCode selected, showing Build and Plan in the Permissions column. Highlighted: Plan.
  5. Send your message

    OpenCode works with the model and mode you chose.

Good to know

  • Adding a provider: open Terminal on a Mac, PowerShell on Windows, or a terminal on Linux. Type opencode auth login, press Return or Enter, and follow OpenCode’s prompts to choose a provider and add its key. Then open the agent settings in Enjoy again, and the new models appear. For local models and other setups, see OpenCode’s provider guide.
  • Models on your computer: OpenCode 2 finds models that a program such as Ollama, LM Studio, or vLLM runs on your computer by itself, a moment after it starts. In the computer app, they appear in the Model column while the agent settings are open. If you start a conversation on one of them, OpenCode can take a few seconds to find it before it begins.
  • If the terminal says it can’t find opencode, Enjoy installed it in a folder your terminal doesn’t search. Type ~/.opencode/bin/opencode auth login on a Mac or Linux, or & "$HOME\.opencode\bin\opencode.exe" auth login in PowerShell on Windows.
  • Each model uses the reasoning level set up for it in OpenCode, so the only effort choice is Model default.
  • OpenCode doesn’t have Fast mode.
  • The agent settings show Usage unavailable for OpenCode, because usage depends on each provider. Check your usage with the provider.
  • When OpenCode’s permission settings say to ask first, Enjoy shows an approval card in the conversation. Questions from OpenCode arrive as Enjoy questions.
  • There’s no account to switch for OpenCode in Enjoy. Change providers in OpenCode instead.
  • If you send a message while OpenCode is working, it waits until the current work ends.
  • Enjoy runs OpenCode with its automatic updates and its conversation sharing turned off. Enjoy tells you about new versions instead. See Update an agent.
  • Enjoy works with OpenCode 1 and OpenCode 2. If you already have either, Enjoy uses it and offers its new versions, and never moves OpenCode 1 to OpenCode 2.

If something goes wrong

OpenCode has no available models

OpenCode doesn’t have a provider it can use yet. Add one with opencode auth login as described above, then reopen the agent settings.

Models on your computer don’t appear

Check that the program running them, such as Ollama, is open and has the models, then open the agent settings again and wait a moment. OpenCode 1 doesn’t find them by itself; add them to OpenCode’s settings as its provider guide describes.

model not found

OpenCode didn’t find the model you chose. If it runs on your computer, check that its program is open and still has the model, then try again.

OpenCode is not ready yet

The Set up OpenCode window shows this, or No models are ready yet, when Enjoy checked OpenCode and found no models. Add or fix a provider, then select Check connection again.

This OpenCode version does not support image attachments

Update OpenCode to attach images. The same applies to This OpenCode version cannot resume sessions.

OpenCode stopped before finishing

The message ends with Retry this conversation. Select Retry on the failed message.

See also

  1. 01Install an agentAI agents · 4 min
  2. 02Choose a modelAI agents · 7 min
  3. 03Choose what your agent can do without askingAI agents · 5 min
  4. 04Which AI agents work with Enjoy?AI agents · 4 min
  5. 05Sign in to an agentAI agents · 4 min

Did this help?

Service

If Enjoy doesn’t work as this manual describes, a person will help.