Skip to content

feat: add GPT-5/Responses API support and secure API key storage#41

Open
bramburn wants to merge 3 commits intoSitoi:mainfrom
bramburn:fix/gpt-5-endpoint
Open

feat: add GPT-5/Responses API support and secure API key storage#41
bramburn wants to merge 3 commits intoSitoi:mainfrom
bramburn:fix/gpt-5-endpoint

Conversation

@bramburn
Copy link
Copy Markdown
Contributor

@bramburn bramburn commented May 2, 2026

Summary

This PR adds support for GPT-5 and o-series reasoning models using OpenAI's new Responses API, along with secure API key storage using VS Code SecretStorage.


Changes

1. Responses API Support (GPT-5, o-series models)

OpenAI's new Responses API is recommended for GPT-5 and o-series reasoning models. This PR adds three new configuration options:

Setting Default Description
OPENAI_API_TYPE completion Choose API: completion (Chat Completions) or response (Responses API)
OPENAI_REASONING_EFFORT medium Reasoning effort: minimal, low, medium, high
OPENAI_TEXT_VERBOSITY medium Output verbosity: low, medium, high

When to use which API:

API Type Use Case Models
completion (Chat Completions) Fast, simple tasks GPT-4, GPT-4o, GPT-4o-mini
response (Responses API) Complex reasoning, tools, structured outputs GPT-5, o1, o3 series

Reasoning Effort Guide:

  • minimal - Fastest, for simple classification/formatting
  • low - Quick responses for extraction, short rewrites
  • medium - Balanced quality/latency/cost (recommended)
  • high - Best accuracy for complex planning/agents

Text Verbosity Guide:

  • low - Compact, concise for UI/chat widgets
  • medium - Standard output with reasonable detail (default)
  • high - Verbose for documentation, reports, audits

2. Secure API Key Storage

API keys are now stored securely using VS Code's SecretStorage API (backed by OS keychain: Keychain on macOS, Credential Manager on Windows, etc.).

Why SecretStorage?

  • Keys never appear in settings.json, logs, or synced settings
  • Uses OS-level encryption
  • Independent of workspace configuration

New Commands:

Command Description
Set OpenAI API Key (Secure) Securely store OpenAI API key
Set Gemini API Key (Secure) Securely store Gemini API key
Clear OpenAI API Key Remove stored OpenAI API key
Clear Gemini API Key Remove stored Gemini API key

Migration Guide

For existing users:

  1. API Keys: Run Set OpenAI API Key (Secure) / Set Gemini API Key (Secure) from Command Palette to migrate your API keys to SecretStorage.

  2. Model Selection: If using GPT-5 or o-series models, set OPENAI_API_TYPE to response in settings.

Breaking Changes:

  • OPENAI_API_KEY and GEMINI_API_KEY settings removed from package.json
  • API keys must now be set via the new secure commands

Testing

To test the extension locally:

npm install
npm run compile
# Press F5 to run in Extension Development Host

References

bramburn added 3 commits May 2, 2026 14:49
- Add OPENAI_API_TYPE setting (completion/response) with 'completion' as default
- Add OPENAI_REASONING_EFFORT setting (minimal/low/medium/high) for Responses API
- Add OPENAI_TEXT_VERBOSITY setting (low/medium/high) for Responses API
- Add requiresResponsesAPI() function to detect GPT-5 and o-series models
- Add chatWithResponsesAPI() function for the new Responses API
- Auto-select API based on user setting and model type
- Upgrade openai package from v4 to v6 for Responses API support
- add OPENAI_API_TYPE, OPENAI_REASONING_EFFORT, OPENAI_TEXT_VERBOSITY columns
- expand notes for each new configuration option
- include detailed API type guide for completion vs response
- update package.json descriptions and enum values to match new docs
- adjust table formatting for better readability in Markdown
- Move OPENAI_API_KEY and GEMINI_API_KEY from settings to SecretStorage
- API keys now stored securely using VS Code's SecretStorage API
- Keys backed by OS keychain (Keychain/Credential Manager)
- Added commands: setOpenAIApiKey, setGeminiApiKey, clearOpenAIApiKey, clearGeminiApiKey
- Removed OPENAI_API_KEY and GEMINI_API_KEY from package.json settings
- Update README with secure storage documentation

Benefits:
- Keys never appear in settings.json, logs, or synced settings
- Uses OS-level encryption
- Independent of workspace configuration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant