Skip to content

How to Use Your ChatGPT Login for Web Search in OpenCode

You want OpenCode’s web search to use the ChatGPT login you already have. Short answer: not out of the box. Authenticating to OpenAI with ChatGPT OAuth signs you into the model provider, but OpenCode’s built-in web search is a separate search-provider system (Exa / Parallel). To route web search through your existing ChatGPT OAuth connection, you need a community plugin — opencode-chatgpt-websearch. Note up front: this plugin is experimental and currently targets OpenCode V2 / OpenCode2. It does not replace or modify OpenCode’s official Exa/Parallel backend; it registers ChatGPT as an additional web-search provider. If your search brought you here via “OpenCode websearch ChatGPT” or “use ChatGPT subscription with OpenCode”, the short version is: you can — with a community plugin, on OpenCode V2.

Version requirement — read first: opencode-chatgpt-websearch currently requires the OpenCode V2 / OpenCode2 plugin system. If your OpenCode build predates V2 plugin support, the configuration below will not work. See the “Version note” in the solution section, and check opencode --version against the plugin’s README before installing.

Problem

Diagram showing that ChatGPT OAuth authentication and OpenCode web search providers are separate systems, with the opencode-chatgpt-websearch plugin adding ChatGPT as a search provider.

I was already authenticated to OpenAI inside OpenCode through ChatGPT OAuth, so I expected web search to reuse that login. It doesn’t — and that’s not a billing problem, it’s a design separation. OpenCode’s model connection and its web-search provider are two independent systems:

Authentication vs search provider
ChatGPT / Codex OAuth → authenticates the model provider (OpenAI)
Built-in websearch → a separate search-provider system (Exa / Parallel)

So signing in with ChatGPT never switches the built-in websearch tool to ChatGPT search by itself. If you specifically want web search to reuse that ChatGPT OAuth connection, you need a plugin that registers ChatGPT as a web-search provider. That is exactly what opencode-chatgpt-websearch does.

Environment

  • OpenCode V2 / OpenCode2 (V2 plugin support required)
  • ChatGPT / Codex OAuth login, already authenticated inside OpenCode as an openai connection
  • Bun available (OpenCode installs npm plugins with Bun at startup)

OpenCode’s built-in websearch tool is part of its own search-provider system, separate from your model connection. The built-in providers are Exa and Parallel. Per the current official docs, Exa/Parallel websearch can be used through OpenCode’s hosted MCP backend, and OpenCode explicitly notes that you may not need to bring your own API key. The details vary by OpenCode version, so check the official docs for your version instead of assuming you must buy a separate search API key.

One concept worth stating clearly, once: your ChatGPT subscription/OAuth, an OpenAI API key, and a web-search provider are three different things.

  • A ChatGPT Plus/Pro plan is a subscription to the chat product; it does not grant OpenAI API credits.
  • ChatGPT/Codex OAuth is how OpenCode authenticates the model provider (OpenAI).
  • A web-search provider is a separate service the websearch tool calls — built-in options are Exa/Parallel; with the plugin, ChatGPT becomes another option.

Because these systems are separate, “reuse the ChatGPT login for web search” is not something the built-in tool does on its own. It is exactly the gap a community plugin fills.

The solution: opencode-chatgpt-websearch plugin

opencode-chatgpt-websearch is a community plugin, not an official OpenCode built-in. It registers ChatGPT as an additional web-search provider that runs on the openai connection you already created in OpenCode via ChatGPT OAuth. It does not replace or modify the official Exa/Parallel backend — it adds another provider option for the websearch tool.

Version note: opencode-chatgpt-websearch is an experimental community plugin targeting OpenCode V2 / OpenCode2. Both the OpenCode plugin API and the plugin configuration may change — this tutorial uses the V2 "plugins" array, not the "plugin" array from stable/current OpenCode docs. Verify the current README before copying the configuration below.

  • OpenCode generation covered here: V2 / OpenCode2 (V2 plugin system)
  • Plugin: opencode-chatgpt-websearch (experimental, community-maintained)
  • Last verified: 2026-08-30, against the plugin README and OpenCode V2 docs available at the time of writing. Plugin versions and config keys change often — re-check both before use.

Is your OpenCode compatible?

  • Run opencode --version and compare it with the generation required by the plugin’s README.
  • On V2, opencode.json accepts the "plugins" array. If your build only recognizes the singular "plugin" key (the stable/current syntax), it predates the V2 plugin system this plugin targets.
  • If the plugin fails to load at startup, a generation mismatch is the first thing to check.

Prerequisites

  • OpenCode V2 / OpenCode2 with V2 plugin support
  • An existing openai connection in OpenCode, created by signing in with ChatGPT / Codex OAuth (the plugin reuses this connection; it does not create a new one)
  • Bun available (OpenCode uses it to install npm plugins automatically)

Install the plugin

OpenCode V2 configuration example showing the plugins array with opencode-chatgpt-websearch installed.

Third-party npm plugins go into the "plugins" array of your opencode.json or opencode.jsonc (V2 syntax):

opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugins": [
"opencode-chatgpt-websearch"
]
}

OpenCode installs npm plugins with Bun at startup and caches them under ~/.cache/opencode/node_modules/. The plugin is evolving quickly, so always confirm the exact package name and current config syntax from the plugin’s README before publishing or writing code around it.

If you cloned the plugin source locally instead, you can load it from the plugin directories that OpenCode scans automatically at startup:

Plugin directories
# project-level plugins:
.opencode/plugins/
# global plugins:
~/.config/opencode/plugins/

Files in those directories are loaded automatically, so no "plugins" array entry is needed for local plugins.

Flowchart showing OpenCode using an existing ChatGPT OAuth connection through the opencode-chatgpt-websearch plugin to perform ChatGPT-backed web searches.

  1. Save the config and restart OpenCode.
  2. Confirm the openai connection created via ChatGPT OAuth is still listed.
  3. Trigger your first web search. The plugin registers “ChatGPT (experimental)” as a provider, so choose that option the first time you search — or force it explicitly in config:
Optionally force the ChatGPT provider
{
"websearch": {
"provider": "chatgpt"
}
}

Verify the exact websearch key names in the plugin’s README; this is experimental and may change.

  1. Ask something that requires fresh data:
Test prompt
Search the web for the latest stable PostgreSQL release and cite the sources.

How to tell the model actually searched

The plugin only helps if the model really calls the search tool and uses the ChatGPT provider. I check three things:

  1. Tool-call output in the TUI. The web-search call’s $tool output should show citations, URLs, and dates, and identify the provider as “ChatGPT (experimental)”. If it names the built-in Exa/Parallel provider instead, the plugin isn’t routing the call.
  2. Provider switch test. Temporarily remove the plugin from "plugins", restart, and run the same fresh-data prompt. If the tool output’s provider changes back to the built-in path, the plugin is what routed search to ChatGPT.
  3. A follow-up that needs current data. Ask “what changed in the latest stable release?” If the answer stays vague and undated, the model probably never called the tool.
ApproachSearch providerAuthenticationOfficial?Stability
Built-in websearchExa / ParallelOpenCode-managed / current official mechanism (may run via OpenCode’s hosted MCP backend)YesHigher
opencode-chatgpt-websearchChatGPT / OpenAI via OAuthExisting ChatGPT OAuth openai connectionNo (community)Experimental / changes often

The main difference is not “free vs paid”: the built-in path is the official, maintained mechanism, while the plugin is the way to route web search through the ChatGPT login you already have. Some details depend on OpenCode version — check the official docs and the plugin README for your exact version rather than guessing.

Common mistakes

  • Confusing the ChatGPT OAuth connection with a web-search provider. Signing in with ChatGPT authenticates the model; it does not reconfigure the search backend. The plugin is what bridges the two.
  • Mixing up OpenCode generations. The "plugin" (stable/current docs) and "plugins" (V2) arrays are not interchangeable, and this plugin targets V2.
  • Assuming the plugin replaces the official Exa/Parallel backend. It doesn’t; it registers ChatGPT as another provider option.
  • Assuming ChatGPT Plus grants OpenAI API credits. The chat subscription and the API are separate products.
  • Skipping provider verification. A fuzzy, undated answer — or a tool call that names the built-in provider — means search didn’t run through ChatGPT.

Summary

OpenCode separates model authentication from web search: ChatGPT/Codex OAuth signs you in as a model provider, while the built-in websearch tool is a separate search-provider system (Exa/Parallel — usable, per current docs, through OpenCode’s hosted MCP backend). If you specifically want to use your ChatGPT subscription with OpenCode for web search, the community opencode-chatgpt-websearch plugin registers ChatGPT as an additional web-search provider. Use it on OpenCode V2 / OpenCode2, treat it as experimental, and verify the current README and the tool output before relying on it — the plugin doesn’t replace the official search path, it adds a ChatGPT-backed option.

For the built-in path and how to enable Exa/Parallel search in OpenCode, see my related post “How to Enable Web Search in OpenCode CLI” on docs.bswen.com. Subscribe to docs.bswen.com for more OpenCode and AI-coding-agent hands-on guides.

Final Words + More Resources

My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me

Here are also the most important links from this article along with some further resources that will help you in this scope:

Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!

Comments