ChatGPT for VS Code: Set Up AI Coding Help in Your Editor

There is no official ChatGPT extension for VS Code. Here is what OpenAI actually offers for the editor, how third-party extensions compare, and how to keep project context across sessions.

Updated 5 min read

OpenAI does not publish an official ChatGPT extension for Visual Studio Code. What OpenAI offers for developer workflows is Codex CLI, a command-line tool that runs in VS Code's integrated terminal. For in-editor AI coding assistance, most developers use GitHub Copilot, which is built on OpenAI models but is a separate product published by GitHub.

Third-party extensions that wrap the ChatGPT API do exist in the VS Code Marketplace, but they are not from OpenAI and vary widely in quality, maintenance, and how they handle your API key. Understanding the difference between these options helps you choose the right setup for your workflow. Tools like fenbs keep your coding decisions and task plan outside any specific editor session, so the context survives when you switch tools or start a fresh chat.

What OpenAI actually offers for VS Code

OpenAI's Codex CLI is a terminal-based coding agent that reads your project files, executes commands, and edits code based on instructions you give in plain language. It runs in any terminal, including VS Code's integrated terminal. The ChatGPT Codex guide covers what Codex can do and how to set it up. Once it is running in the VS Code terminal, you interact with your codebase through it without leaving the editor.

Codex CLI connects to your project directory and can read files, run tests, and make changes. It does not integrate with VS Code's IntelliSense, UI panels, or extension APIs directly, because it is a CLI tool rather than a VS Code extension. That distinction matters for the kind of assistance you get: it is closer to a coding agent you converse with than an inline completion provider.

How GitHub Copilot compares in VS Code

GitHub Copilot is the AI coding assistant with native VS Code integration. It provides inline completions as you type, a chat panel for asking questions about your code, and an agent mode that can make multi-file edits. Copilot is published by GitHub (not directly by OpenAI), uses OpenAI models under the hood, and requires a separate Copilot subscription.

For developers who want AI assistance inside the editor rather than in a terminal, Copilot is the primary option with first-party VS Code support. The Copilot vs ChatGPT comparison covers the differences in capability and access model.

Third-party ChatGPT extensions for VS Code

Several third-party extensions in the VS Code Marketplace connect directly to the OpenAI API and surface a chat interface inside VS Code. Before installing one, check a few things.

  • Publisher identity: is the extension published by a named organization with a track record, or by an anonymous account? OpenAI has not published a ChatGPT extension; any extension claiming to be official is not.
  • API key handling: does the extension store your OpenAI API key locally in VS Code settings, or does it send it to an outside server? Check the extension's privacy policy and source code if possible.
  • Maintenance: when was the last update? ChatGPT API changes can break extensions quickly. A stale extension may stop working without warning.
  • Permissions: what does the extension request access to? Some need only workspace files; others request broader access.

A third-party extension can be a useful lightweight option for quick questions about code. For a full agent loop that can plan, edit, and test, Codex CLI or Copilot agent mode are more capable.

Set up Codex CLI in the VS Code terminal

To use Codex CLI inside VS Code, open the integrated terminal and follow the setup steps from the Codex guide. Once installed and authenticated with your OpenAI API key, you run it from the project directory and give it instructions in plain language.

Because Codex CLI reads your project files, it benefits from a clear project structure and a short description of what each part of the codebase does. Before asking it to make changes, it helps to describe what the current task is, what constraints apply, and which files are in scope.

Review every change Codex CLI suggests before accepting it. Read the diff carefully, run the tests, and check that the change does not introduce a dependency or modify a file you intended to keep stable. An AI coding tool is most useful when the review step is treated as a real check, not a formality.

How fenbs helps

Keep the task plan and coding decisions across editor sessions

Before starting a Codex CLI session in VS Code, connect fenbs from Integrations and ask it to read the project context: the current tasks, the decisions your team has made, and Where we left off. At the end of the session, save progress so the next session, whether in VS Code or another tool, starts from the current state rather than from zero.

Create a free account

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

Managing context across sessions and tools

One of the practical problems with using ChatGPT or Codex CLI for coding help is that each new session starts without the history of the previous one. If you told the AI which design patterns the team uses, what the naming conventions are, or which modules are stable, that information is gone when the session ends.

The two common approaches are: keep a short context file in your repository that you paste at the start of each session, or connect a tool like fenbs that an AI agent can read at startup. A context file works well for stable project conventions. For current task status, recent decisions, and Where we left off, a connected tool that can be updated by the agent is more maintainable.

How to do this with fenbs

  1. Create a free account and add a project for the codebase you are working on.
  2. Add the current tasks and write the key coding decisions as Decisions and rules: architecture choices, naming conventions, which files are sensitive, any patterns the team has agreed on.
  3. Connect Codex CLI or another supported AI app to fenbs via MCP from Integrations. At the start of each session, ask the agent to read the project context before writing any code.
  4. When a session produces a decision, such as choosing a library or agreeing on a refactoring approach, add it to Decisions and rules in fenbs so the next session inherits it.
  5. Save progress before ending a session: which tasks were completed, what was changed, what still needs review.

Questions people ask.

Is there an official ChatGPT extension for VS Code from OpenAI?

No. OpenAI does not publish a ChatGPT VS Code extension. What OpenAI offers for developer workflows is Codex CLI, which runs in VS Code's integrated terminal. Third-party extensions that connect to the ChatGPT API exist in the Marketplace, but they are not from OpenAI.

What is the difference between Codex CLI and GitHub Copilot in VS Code?

Codex CLI is a terminal-based coding agent published by OpenAI that you run in any command-line environment, including VS Code's integrated terminal. GitHub Copilot is a first-party VS Code extension with inline completions, a chat panel, and agent mode built into the editor UI. They target different workflows: Codex CLI for conversational coding tasks in the terminal, Copilot for inline assistance and in-editor chat.

How do I keep my OpenAI API key safe when using a third-party VS Code extension?

Check whether the extension stores your key only in VS Code settings on your machine or sends it to a server. Read the extension's privacy policy and, if available, its source code. As a precaution, use a dedicated API key for extensions with limited spend caps, separate from the key you use for other purposes.

How do I give Codex CLI context about my project?

Run it from the project directory so it can read your files. Before starting a task, describe what the project does, which files are in scope, and any constraints on what it may change. If you use fenbs, connect it via MCP so the agent reads your current tasks and decisions at startup rather than relying on you to summarize them each time.

Do I need a ChatGPT Plus subscription to use Codex CLI?

Codex CLI uses the OpenAI API directly, which requires an API key and incurs usage-based costs based on the models you call. It is separate from a ChatGPT Plus subscription. Check OpenAI's pricing page for current model costs and usage limits.

More in Agent harness (for developers)

All Agent harness (for developers) articles

Start with one thing.

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

There is nothing to set up first. Write one line and you’ve started.