feat: add Grok Web (Subscription) provider

Adds a new provider that routes through Grok's internal NDJSON API using
an X/Grok subscription SSO cookie, enabling access to Grok 3, 4, 4.1,
4.2/4.20, and 4 Heavy via grok.com without xAI API costs.

- GrokWebExecutor with full NDJSON→OpenAI translation
- 12 models incl. grok-4.2 (4.20 beta), grok-4-heavy (SuperGrok)
- Dynamic x-statsig-id generation (base64 fake TypeError)
- W3C traceparent headers for Cloudflare compatibility
- Thinking/reasoning mode for mini/thinking/expert/heavy variants
- SSO cookie auth with auto-strip of 'sso=' prefix
- Fetch timeout + upstreamExtraHeaders (BaseExecutor parity)
- 16 unit tests, all passing

Derived from: GrokProxy, GrokBridge, grok-web-api, grok2api-merged,
Grok API Research Report
This commit is contained in:
Ravi Tharuma
2026-04-15 23:01:25 +02:00
parent eaec3279ab
commit 97dca71c2c
5 changed files with 971 additions and 0 deletions

View File

@@ -214,6 +214,16 @@ export const APIKEY_PROVIDERS = {
textIcon: "XA",
website: "https://x.ai",
},
"grok-web": {
id: "grok-web",
alias: "grok-web",
name: "Grok Web (Subscription)",
icon: "auto_awesome",
color: "#1DA1F2",
textIcon: "GW",
website: "https://grok.com",
authHint: "Paste your sso cookie value from grok.com (found in browser DevTools → Cookies → sso)",
},
mistral: {
id: "mistral",
alias: "mistral",