Sync the contributor guide onto the active release, remove inherited dependency drift, and align the Cookie Editor workflow with the current extension and source-backed OmniRoute contract. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
6.7 KiB
title, version, lastUpdated
| title | version | lastUpdated |
|---|---|---|
| Providers — ChatGPT Web (session credentials via Cookie Editor) | 3.8.50 | 2026-08-08 |
Providers — ChatGPT Web (Plus/Pro session credentials)
chatgpt-web (alias cgpt-web, display name ChatGPT Web (Plus/Pro)) sends OpenAI-format chat requests through an authenticated chatgpt.com browser session. It authenticates with the __Secure-next-auth.session-token cookie — no API key required.
New to Web Cookie providers?
Read
docs/getting-started/WEB-COOKIE-GUIDE.mdfor the general setup process, limitations, and troubleshooting before following this provider-specific guide.
1. What credential does OmniRoute need?
Defined in src/shared/constants/providers/web-cookie.ts + src/shared/providers/webSessionCredentials.ts:
| Field | Value |
|---|---|
| Provider id | chatgpt-web |
| Credential name | __Secure-next-auth.session-token |
| Accepts full Cookie header | ✅ yes |
| Accepted storage keys | cookie, sessionToken, session-token, __Secure-next-auth.session-token |
Two paste formats both work:
- Bare value — just the token contents:
eyJhbGciOi... - Full Cookie header —
__Secure-next-auth.session-token=eyJhbGciOi...; cf_clearance=...(preferred — carries rotation/anti-bot cookies the executor needs)
2. Copy the cookie header with Cookie Editor
Cookie Editor can copy the cookies for the active chatgpt.com tab as an HTTP header string.
Always compare the exported value with a live authenticated request as described in section 3.
2.1 Install and pin
- Install Cookie-Editor (Moustachauve) in Chrome/Edge, or the Firefox equivalent.
- Pin it to the toolbar if you use it regularly.
2.2 Copy the credential
- Go to https://chatgpt.com and make sure you're signed in with the Plus/Pro account you want OmniRoute to use.
- Open a conversation and send at least one message (forces the session token to be live/refreshed).
- Click the Cookie Editor icon to open its side panel for the active tab.
- Find
__Secure-next-auth.session-token. If it's split into chunks (__Secure-next-auth.session-token.0,.1, …), select all of them — OmniRoute'snextAuthCookie.tsmerges rotated chunk families. - Click Copy, choose Header string, and copy the resulting
name=value; name=valuetext.
If the token is missing: confirm that you are signed in, send a message to refresh the session, and inspect the live request in section 3.
3. Verify the required data (before pasting)
The repo's WEB-COOKIE-GUIDE.md mandates a live-request check. Do it once per session:
- With chatgpt.com open, press F12 → Network tab.
- Refresh the page, then send a chat message.
- Click the conversation request (e.g.
/backend-api/conversationor the SSE stream) → Headers → Request Headers → Cookie. - Confirm it contains
__Secure-next-auth.session-token=...— not justcf_clearanceor__cf_bm.
The value you copied in step 2.3 must match what the live request sends. If they differ, re-copy from Cookie Editor.
4. Add / update the credential in OmniRoute
Dashboard (typical user path)
- Open the OmniRoute dashboard → Providers → Add Provider.
- Search ChatGPT Web (Plus/Pro) (id
chatgpt-web). - Paste the copied cookie header into the credential field.
- Click Test Connection.
- Save.
If requests later return 401 or 403, re-copy the header from a fresh live session. The executor merges Set-Cookie rotations while the connection is active, but it cannot recover a credential that is no longer accepted upstream.
Bulk / session pools (many accounts)
For multiple ChatGPT sessions, use the bulk web-session import or session-pool endpoints:
POST /api/providers/bulk-web-session— import many cookie credentials at onceGET /api/session-pools+/api/session-pools/[provider]— pool rotation across accounts
Each credential blob must carry the __Secure-next-auth.session-token value under one of the accepted storage keys (cookie, sessionToken, session-token, or the cookie's exact name).
Renewing when the session expires
Web sessions can stop working after sign-out or server-side rotation. Re-run steps 2.2 through 4 whenever requests start failing with 401/403.
5. Contributing updates
If you changed the credential contract (new storage key, new cookie name, changed hint) or are filling the docs gap, contribute it:
- Update
src/shared/providers/webSessionCredentials.ts(credential name / placeholder / storage keys) orsrc/shared/constants/providers/web-cookie.ts(authHint). - Update this guide (
docs/providers/CHATGPT_WEB.md) and the provider table indocs/getting-started/WEB-COOKIE-GUIDE.md. - Update
.env.example+docs/reference/ENVIRONMENT.mdif you touched env vars, then run:node scripts/check/check-env-doc-sync.mjs # must pass - Run the provider/unit tests:
npm run test:unit # targeted: tests/unit/chatgpt-web.test.ts (stealth path) - Follow
CONTRIBUTING.md, branch from the current active release tip, use a Conventional Commit message, and open the PR against that active release branch.
⚠️ Never commit a real cookie value. All examples above are placeholders. If a test fixture needs a token, use a fake
eyJhbGciOi...string.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Cookie not in Cookie Editor | Signed out / not HttpOnly-visible | Sign in; enable HttpOnly display in options |
| Token missing from live request | Request is not authenticated | Sign in and send a chat message first |
| 401 after Test Connection passed | Expired or rotated session | Re-copy from a fresh live request |
| Chunked token fails | Only one chunk pasted | Select all __Secure-next-auth.session-token.* chunks |