ChatGPT plan usage in Pretype

Problem and scope

People who already subscribe to ChatGPT should be able to use their plan for Pretype’s text features without creating an API key. Add direct browser sign-in, with no CLI, proxy service, or new package dependency. Existing API keys and local models remain available. The feature is opt-in and uses the same text/context boundaries and output gates as the hosted text engine.

The first contribution covers suggestions, fixes, replies, rewrites, and dictation cleanup. Transcription keeps its independent configuration: ChatGPT plan usage does not support the transcription endpoint. Claude remains an API-key provider. Direct Claude subscription authentication is deferred: Anthropic restricts third-party apps from handling subscription credentials; the supported unmodified Claude Code route would introduce a CLI dependency outside this scope.

Experience

Choose ChatGPT subscription under Settings → API → Text, then Continue with ChatGPT. The system browser handles authentication and consent. Signing in does not enable text generation. Choose a model from the signed-in account’s catalog and explicitly enable the text provider. Show saved registrations separately, including registrations with identical emails. Allow switching, reconnecting, signing out, refreshing models, and testing the connection. Link to ChatGPT Settings → Usage, where the user controls plan allowance and credits.

An expired or revoked session asks for reconnection. Missing plan permission or ineligibility explains why inference is unavailable. Usage exhaustion pauses requests until the user explicitly retries. No failure switches accounts, providers, or billing paths automatically. Existing local and API-key choices are retained by their current settings semantics.

Design

Acceptance and validation

Automated tests cover hostile OAuth callbacks and ID tokens, declined scopes, account isolation, token rotation, credential-storage failure, SSE terminal states, quota failures, and stale/cancelled results. Regression coverage includes existing API transports, configuration compatibility, all text actions, and privacy gates.

Run Swift build/tests with --build-system swiftbuild, SwiftLint, string synchronization/checks, and app packaging. Manually sign in, switch accounts, reconnect, sign out, and exercise TextEdit/Notes. A maintainer must run the private quality harness and report before/after coverage, first-word accuracy, saved characters, and p50 latency. Inference latency and actual account eligibility must be measured, not inferred from OAuth success.

Keep the contribution draft until independent review, CI, localization, live-account validation, and maintainer evaluation are complete. This contribution does not merge or release the app.

Provider references

Verified November 5, 2026; these preview interfaces can change: