API Reference
ChatGPT Plan
Sign in with ChatGPT, read the sign-in status, sign out, and open the usage page.
On this page7 commands
Called through tauri-bridge.ts. Each returns Promise<T> and throws a string on Rust Err(_).
| Function | Returns | Description |
|---|---|---|
chatgptStatus() | ChatGptStatus | Where Sign in with ChatGPT (preview) stands: state is signed_out, signing_in, signed_in, plan_disabled, session_ended (reason.code says why), unread (a saved sign-in the keychain was not asked for) or unavailable; plus the account's email when there is one, where the refresh token is kept (tokenStorage: the keychain, the Linux kernel keyring until reboot, or memory until quit), and whether a message is kept to send again. Holds no token. Reads nothing from the keychain and makes no request. |
chatgptSignIn(intent) | ChatGptStatus | Sign in through the system browser, which the backend opens: the window never sees the URL. intent is sign_in, enable_plan_usage (ask for consent again after declining it) or another_account. Resolves when the sign-in is over, which can be minutes; a cancel resolves with the status as it then stands, and a failure rejects with a sentence. Requests go to auth.openai.com, and later to api.openai.com. No token is returned. |
chatgptCancelSignIn() | void | End the sign-in in progress, if any. chatgptSignIn then resolves with the status as it stands. |
chatgptSignOut() | ChatGptEnd | Sign out: the refresh token is revoked at OpenAI and removed from the keychain. The registered client is kept, so signing in again adds no new entry in ChatGPT's settings. notice says what could not be confirmed, if anything. An agent running on the plan is dropped. |
chatgptForgetRegistration() | ChatGptEnd | Start over: sign out, then forget the registered client and its account, so the next sign-in registers edytlab again. For a registration OpenAI no longer accepts. The old entry may remain in ChatGPT's settings, which notice says. Rejects while a sign-in is in progress. |
chatgptTakePendingMessage() | PendingChatGptMessage | null | The message a turn could not send because the ChatGPT session ended, taken and forgotten. After signing in, send resumeText with disabledTools. Kept only when the session ended (not on a sign-out) and the account has not changed since the turn began. In memory only: it is gone at quit, at the next message, at a sign-out or start over and at this call. null when none is kept. |
openChatgptUsage() | void | Open ChatGPT's usage page (chatgpt.com/settings/usage) in the system browser, for the Manage usage buttons. The window has no opener, so the backend opens it, and it takes no argument: the address is fixed and the webview cannot ask for another page. Rejects if no browser could be opened. |