Skip to content

Allow empty API keys for custom OpenAI endpoints in the macOS app#262

Open
ainopara wants to merge 1 commit intotheJayTea:mainfrom
ainopara:feature/allow-empty-api-key
Open

Allow empty API keys for custom OpenAI endpoints in the macOS app#262
ainopara wants to merge 1 commit intotheJayTea:mainfrom
ainopara:feature/allow-empty-api-key

Conversation

@ainopara
Copy link
Copy Markdown

@ainopara ainopara commented Apr 21, 2026

Background

This PR is specific to the macOS app under macOS/WritingTools. Other platform implementations live in separate codebases and are not affected.

I use LM Studio as a local LLM backend for the macOS app. LM Studio exposes an OpenAI-compatible API, so the macOS app's OpenAI-compatible provider can call it by setting a custom base URL such as a local localhost endpoint.

In this local-provider scenario, an API key is not required. Requiring the API key field to be non-empty prevents otherwise valid OpenAI-compatible local endpoints from working in the macOS app.

Summary

  • Allow the macOS app's OpenAI-compatible provider to use custom base URLs without requiring an API key.
  • Omit the Authorization header for custom OpenAI-compatible requests when the API key field is empty.
  • Continue requiring an API key when the default OpenAI endpoint is used.

Testing

  • Verified in a local signed macOS build with an LM Studio-compatible local endpoint and an empty API key field.
  • Confirmed the combined local branch still builds successfully with xcodebuild -project macOS/WritingTools.xcodeproj -scheme WritingTools -configuration Release -destination 'platform=macOS'.

@ainopara ainopara changed the title Allow empty API keys for custom OpenAI endpoints Allow empty API keys for macOS custom OpenAI endpoints Apr 21, 2026
@ainopara ainopara changed the title Allow empty API keys for macOS custom OpenAI endpoints Allow empty API keys for custom OpenAI endpoints in the macOS app Apr 21, 2026
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