Skip to content

CodeGPT ​VSCode AI Programming Extension, supports code completion, explanation, refactoring, and more. Custom API endpoints are configurable. ​

Installation ​ ​

  • Open VSCode
  • Go to the Extensions Marketplace (Ctrl+Shift+X / Cmd+Shift+X)
  • Search for "CodeGPT"
  • Click Install

Configuration ​ ​

  • Open VSCode settings (Ctrl+, / Cmd+,)
  • Search for CodeGPT
  • Configure the following:
SettingValue
ProviderOpenAI
API Keysk-xxx
Base URLhttps://www.fast-api.org/v1

Or edit VSCode settings.json directly:

json
{
  "CodeGPT.apiKey": "sk-xxx",
  "CodeGPT.provider": "OpenAI",
  "CodeGPT.baseUrl": "https://www.fast-api.org/v1"
}

Usage Example ​ ​

After configuration:

  • Select code, right-click and choose the CodeGPT menu
  • Optional actions:
    • Explain — Explain selected code
    • Refactor — Refactor code
    • Find Problems — Detect issues
    • Document — Generate comments

You can also open the CodeGPT chat panel and chat directly:

Help me optimize the performance of this code

FAQ ​ ​

API Key Invalid Prompt ​ ​

Make sure the Provider is set to OpenAI and the API Key format is correct (starts with sk-).

No Code Completion ​ ​

Check whether CodeGPT's autocompletion feature is enabled. Search for CodeGPT autocomplete in settings.

Empty Response ​ ​

Make sure the Base URL is correct and includes the /v1 suffix.

Notes ​ ​

  • Base URL must include /v1: https://www.fast-api.org/v1
  • Provider must be set to OpenAI
  • You can select different models in the settings, such as gpt-4o, gpt-4o-mini