You can use a ChatGPT Plus or Pro subscription in OpenCode through OpenCode's official OpenAI connection flow. Run /connect, choose OpenAI, select the ChatGPT Plus/Pro browser-login option, finish authorization, and then use /models to see what your account can actually use.
That last check matters. A ChatGPT subscription login is not the same thing as adding an OpenAI API key, and neither path guarantees a permanent list of models or a fixed usage allowance. The OpenCode provider documentation is the source of truth for the current connection flow; /models is the source of truth inside your current session.
Can you use a ChatGPT subscription in OpenCode?
Yes—if your OpenCode version presents the ChatGPT Plus/Pro login option and your OpenAI account is eligible for it.
OpenCode currently exposes two different OpenAI connection choices:
- ChatGPT Plus/Pro login: opens a browser authorization flow and connects OpenCode to the eligible ChatGPT account you sign in with.
- OpenAI API key: authenticates against an OpenAI API account and uses that account's API billing and limits.
Those are separate access routes. OpenAI's official billing guidance confirms that ChatGPT subscriptions and API usage are billed separately. Paying for ChatGPT does not create a pool of OpenAI API credits, and entering an API key does not make OpenCode consume a ChatGPT subscription. Keep the distinction visible when you diagnose limits or compare costs.
If you first need a wider map of how OpenCode separates models from providers, read the OpenCode models and providers guide. It explains the layer that /connect configures and the layer that /models selects.
Connect ChatGPT Plus or Pro step by step
Use the shortest official path first:
- Open OpenCode in the terminal or workspace where you plan to use it.
- Enter
/connect. - Choose OpenAI from the provider list.
- Select the ChatGPT Plus/Pro browser-login option rather than the API-key option.
- Complete the OpenAI authorization in the browser. Confirm that you are signing in to the intended account, especially if the browser has more than one OpenAI session.
- Return to OpenCode after the authorization completes.
- Enter
/modelsand select an available model.
Do not skip step 7. A successful browser page indicates that the browser-side authorization finished; the model list confirms whether the end-to-end OpenCode connection can use the account in the current session.
For a first check, start with a small, reversible request: ask the agent to inspect one file, explain a short function, or propose a change without applying it. This confirms the model can return a response without putting a large task or important repository at risk.
Subscription login versus an OpenAI API key
Choose the path based on how you want authentication, billing, and operational control to work—not on the assumption that one label is always cheaper.
The subscription path is a sensible first choice when you already have an eligible Plus or Pro account and want the supported browser-login experience. An API key is easier to reason about when you need metered API billing, separate credentials, or provider-level cost controls.
OpenCode's handling can change with releases. For example, the official OpenCode v1.18.19 release notes include Codex subscription-limit handling and workspace compute-residency forwarding changes. That is a reason to keep OpenCode current and verify behavior, not a promise that every account will see the same limit or residency option.
How to verify the connection before real work
Use a four-part preflight check:
- Identity: verify that the browser authorized the intended OpenAI account.
- Model availability: run
/modelsand choose from the list that OpenCode shows now. Do not rely on an old screenshot or a third-party model list. - Basic response: run a small read-only task and confirm that the model returns a complete answer.
- Limit behavior: note any access, rate-limit, or quota message exactly as shown. Do not assume every limit message means the OAuth connection failed.
Save the exact OpenCode version and the text of any error before changing configuration. That evidence is more useful than repeatedly reconnecting, because an authorization problem, a missing model entitlement, and a temporary limit require different fixes.
Troubleshoot the common failure modes
Work through these checks in order. Changing several variables at once makes it harder to find the real cause.
The browser opens the wrong OpenAI account
Sign out of the unintended account or use a browser profile where only the intended account is active, then run /connect again. The subscription belongs to the account, so authorizing a different account changes the access OpenCode can see.
Authorization finishes, but OpenCode does not continue
Return to the terminal and check whether OpenCode is still waiting for the browser flow. If it is, preserve any visible message, cancel only that attempt, and retry once. Also confirm that the terminal session and browser are on the same device or environment expected by the flow.
The desired model is missing from /models
Treat the current model list as the result, not as proof that authentication is broken. Check the account you authorized, update OpenCode if you are on an older release, and compare the present provider documentation. Model availability and account entitlements can change, so do not force an old model identifier into configuration just because a tutorial lists it.
A task is rate-limited or access is denied
Record the exact message and determine whether it refers to the subscription route or an API route. If you previously connected an API key, confirm which OpenAI connection is active. Reconnecting repeatedly will not create additional entitlement or API balance.
You need to undo the connection
Use OpenCode's current provider-management flow to disconnect or select a different credential. Then run /models again. The verification step matters after removal as much as it does after setup.
Choose the right access route
The best route depends on the job you are trying to fund and operate:
- Use ChatGPT Plus/Pro login when you already have an eligible subscription and want OpenCode's supported browser-auth path.
- Use a provider API key when you need explicit API metering, separate operational credentials, or a provider model that is not part of the subscription route.
- Evaluate an OpenCode-managed plan when you want to compare OpenCode's own paid access choices; the OpenCode Go versus Zen guide keeps that decision separate from ChatGPT login.
- Use a cloud workspace when persistence, handoff, and access from another device matter more than where the local OAuth session lives; see how to run OpenCode in a cloud workspace.
This is also why “Can I use OpenCode with ChatGPT?” and “What should power my coding agent?” are not quite the same question. The first is an authentication task. The second includes model choice, cost controls, workspace continuity, and how credentials are managed.
Conclusion
To use a ChatGPT Plus or Pro subscription in OpenCode, connect through /connect, finish the official browser authorization, and verify the result with /models and a small read-only task. Keep subscription access separate from API-key billing, and treat the current model list and account messages as more reliable than an old tutorial.
If you decide that an independently funded API route fits the workflow better, review the Agent.Space Developer API and confirm its live model catalog, configuration, and pricing before you commit a production workload.
