Using OpenCode with T3 Code

Set up OpenCode as a T3 Code provider — the open-source agent with the widest model choice, and the route to models the other providers don't offer.

Last reviewed · verified against the pingdotgg/t3code repo

OpenCode is the fully open-source option, and the most flexible about which model sits behind it. Pairing it with T3 Code gives you an open GUI on an open agent.

Setup#

bash
opencode auth login

Then:

bash
npx t3@latest

Select OpenCode as your provider. As with every provider, T3 Code launches the CLI as a subprocess — it doesn't hold your credentials.

Why choose OpenCode#

Model choice. OpenCode is designed to work with many model backends rather than one vendor's. If your requirement is a specific model — or a locally-hosted one — OpenCode is the provider most likely to get you there. Configure the model in OpenCode; T3 Code drives whatever you've set up.

This is the practical answer to most "does T3 Code support X model?" questions. T3 Code doesn't integrate models directly, so the question is really whether one of its four providers supports the model. OpenCode has the widest surface. More on Gemini, Ollama and others →

Open source end to end. T3 Code is MIT licensed and OpenCode is open. If you're avoiding proprietary dependencies in your toolchain, this combination is the one that qualifies.

No vendor subscription required. Depending on how you configure it, you may only be paying for model usage on your own key.

Configure the model in OpenCode, not T3 Code#

The most common point of confusion. T3 Code's model picker reflects what the provider exposes; it doesn't add backends of its own. If you want OpenCode running against a particular model or endpoint, set that up in OpenCode's own configuration first, then restart T3 Code so it picks up the change.

The layering is worth keeping straight:

text
T3 Code  →  OpenCode CLI  →  model backend of your choosing
(UI/git)     (agent logic)    (OpenAI, Anthropic, local, …)

Architecture in detail →

What you keep#

Everything T3 Code adds is provider-agnostic, so OpenCode threads get the full workflow:

Troubleshooting#

  • opencode not found — PATH inheritance, same mechanism as every other provider. Fixes →
  • Sessions won't start — update the OpenCode CLI; version skew is the usual cause
  • Model errors — those come from your configured backend, not from T3 Code. Test the model directly in OpenCode first

FAQ#

Does T3 Code work with OpenCode?#

Yes. Authenticate with opencode auth login and select OpenCode as your provider in T3 Code.

Can I use local models with T3 Code?#

Not directly — T3 Code has no model integration of its own. It works if the underlying provider supports it, and OpenCode is the most flexible provider for local and alternative model backends.

Is T3 Code open source?#

Yes, MIT licensed. Combined with OpenCode you get an open-source GUI running an open-source agent.

Where do I configure which model OpenCode uses?#

In OpenCode's own configuration, not in T3 Code. T3 Code surfaces what the provider exposes; it doesn't add model backends.