GPT
Use OpenAI, Anthropic, or Gemini models inside Visual Studio Code

🚀 Quick Start (30 seconds)
Prerequisite: an API key from your provider (OpenAI / Anthropic / Gemini).
- Run GPT: Setup
- Select any text in the editor
- Press Alt + Shift + I (Ask GPT)
No key set? Ask GPT will prompt you to set one and automatically retry once.
Contents
How it works
- You select text (or a full file) → GPT sends that content to the currently selected model/provider and returns a response.
- Responses are shown either in a new file or by replacing the selection (configurable).
- API keys are stored securely in VS Code SecretStorage when available.
Privacy & security
- API keys: stored in VS Code SecretStorage when available; otherwise stored for the current session only.
- Logging: debug logs intentionally avoid secrets and prompt contents.
- Chat history: kept in-memory during the session; you can export it manually.
How to use
Ask GPT (selection) — recommended default
- Select text
- Run Ask GPT (Alt + Shift + I)
Ask GPT with File (whole file)
Use Ask GPT with File when you need full-file context (refactors, audits, “explain this file”).
🔑 Setup & API keys
GPT: Setup
One onboarding flow:
- Choose a provider (OpenAI / Anthropic / Gemini)
- Set an API key if missing
- Optionally pick a model
GPT: Set API Key (fast path)
Sets/updates the API key for the currently selected provider.
GPT: Manage API Keys
Manage keys across providers (view status, set/update, remove).
Legacy OpenAI keys previously stored in globalState are migrated automatically when SecretStorage is available.
🧠 Providers & models
- Default provider: OpenAI
- Switch provider: GPT: Change Provider
- Change model: GPT: Change Model
Model list behavior
- Pick from a built-in list or use Custom model id…
- Refresh model list (online) appears only after an API key is configured for the active provider
🧩 Project instructions (.gpt-instruction)
Place a .gpt-instruction file in your workspace to automatically prefix each query with project-specific guidance.
🧰 Commands
Core
- GPT: Setup — onboarding
- Ask GPT — run on selection (Alt + Shift + I)
- Ask GPT with File — run on entire file
- GPT: Set API Key — set key for active provider
- GPT: Manage API Keys — manage keys across providers
Provider & model
- GPT: Change Provider
- GPT: Change Model
- GPT: Change Token Limit
Conversation & output
- GPT: Change Output Mode — Replace Selection vs New File
- GPT: Change Context Mode — No Context / Last N / Full
- GPT: Set Context Length
- GPT: Export Chat History
- GPT: Show Chat History
- GPT: Clear Chat History
Debug
- GPT: Change Debug Mode — show/hide the GPT Debug output channel
🛠️ Troubleshooting
Invalid or missing API key
- Run GPT: Setup (recommended) or GPT: Set API Key
- Confirm provider via GPT: Change Provider
“Model not available”
- Run GPT: Change Model
- If a key is configured, use Refresh model list (online) or choose Custom model id…
Rate limits / quota
Debugging
- Toggle GPT: Change Debug Mode
- Check the GPT Debug output channel (no secrets or prompts are logged)
Support
If this extension saves you time, you can support ongoing maintenance:
License
MIT License — see LICENSE