[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-94724":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":9,"pushedAt":9,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":15,"starSnapshotCount":15,"syncStatus":14,"lastSyncTime":27,"discoverSource":28},94724,"grok-register","xinxinshuhao-create\u002Fgrok-register","xinxinshuhao-create","Automated account registration toolkit for x.ai (Grok) with SSO extraction, OAuth Device Flow, and auto-replenish daemon",null,"Python",453,114,137,2,0,14,135,63.18,"MIT License",false,"master",true,[],"2026-08-24 04:01:22","# grok-register\n\nAutomated account registration toolkit for x.ai (Grok) with SSO token extraction, OAuth Device Flow minting, and auto-replenish daemon for API gateway integration.\n\n## Features\n\n- **Account registration** (`grok.py`) — curl_cffi-based engine, supports YesCaptcha for Turnstile solving\n- **SSO → CPA token minting** (`sso_to_cpa.py`) — OAuth Device Flow with corrected scope, converts SSO tokens to access\u002Frefresh tokens\n- **Auto-replenish daemon** (`auto_replenish.py`) — monitors account pool, registers new accounts on demand, pushes to API gateway\n- **Token refresh daemon** (`token_daemon.py`) — keeps tokens alive\n- **OAuth token re-minting** (`remint_oauth.py`) — re-mints revoked tokens via Device Flow when xAI invalidates refresh tokens\n- **Turnstile solver** (`turnstile_solver_local.py`) — local CAPTCHA solving service\n- **Email service** (`email_service.py`) — multi-provider support (LuckMail, MailNest)\n- **Clash proxy rotator** (`clash_rotator.py`) — proxy rotation for registration\n\n## Prerequisites\n\n- Python 3.12+\n- [uv](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002F) (recommended) or pip\n- [YesCaptcha](https:\u002F\u002Fyescaptcha.com\u002F) API key (for Turnstile solving)\n- Email provider account (LuckMail \u002F MailNest)\n- A running [grok2api](https:\u002F\u002Fgithub.com\u002Fchenyme\u002Fgrok2api) instance (for auto-replenish integration)\n\n## Quick Start\n\n```bash\n# Clone\ngit clone https:\u002F\u002Fgithub.com\u002Fxinxinshuhao-create\u002Fgrok-register.git\ncd grok-register\n\n# Install dependencies\nuv sync\n\n# Configure\ncp .env.example .env\n# Edit .env with your API keys\n\n# Create output directory\nmkdir -p keys\n\n# Run registration\nuv run python grok.py\n```\n\n## Configuration\n\nCopy `.env.example` to `.env` and fill in:\n\n| Variable | Required | Description |\n|---|---|---|\n| `YESCAPTCHA_KEY` | Yes | YesCaptcha API key for Turnstile solving |\n| `EMAIL_PROVIDER` | No | Email provider: `luckmail` \u002F `mailnest` \u002F `gptmail` \u002F `tmail` \u002F `fce` \u002F `gmail` (default: `luckmail`) |\n| `LUCKMAIL_API_KEY` | If luckmail | LuckMail API key |\n| `LUCKMAIL_PROJECT_CODE` | No | LuckMail project code (default: `grok`) |\n| `LUCKMAIL_EMAIL_TYPE` | No | Email type (default: `ms_imap`) |\n| `LUCKMAIL_DOMAIN` | No | Email domain (default: `outlook.com`) |\n| `THREADS` | No | Concurrent registration threads (default: 1) |\n| `GROK2API_BASE` | No | API gateway URL for auto-replenish (default: `http:\u002F\u002F127.0.0.1:8000`) |\n| `GROK2API_USER` | No | API gateway admin user (default: `admin`) |\n| `GROK2API_PASS` | No | API gateway admin password |\n| `GROK_PROXY` | No | HTTP proxy for registration (default: `http:\u002F\u002F127.0.0.1:7897`) |\n\n### Email providers (email domains matter for xAI)\n\n| Provider | Cost | Email domain | Headed Chrome | Notes |\n|---|---|---|---|---|\n| `luckmail` (default) | Paid (¥0.02\u002Finbox) | Outlook.com addresses | No | Verified for Grok codes (76-99s) |\n| `gmail` | Free | Your own Gmail (+alias) | No | Highest trust; set `GMAIL_BASE_EMAIL` + `GMAIL_APP_PASSWORD` |\n| `fce` | Free | Platform domains: `@ditapi.info`, `@fce.email` | No | Pure REST API; set `FCE_API_KEY`. **Gmail\u002FOutlook addresses are NOT accepted as inboxes; custom domains require paid plans ($29\u002Fmo+)**. Free tier has rate limits; OTP endpoint returns `__DETECTED__` on free tier — codes are parsed from messages instead |\n| `tmail` | Free | Shared eu.org domains | Yes | Anonymous, no key |\n| `gptmail` | Free | Shared disposable domains | Yes | xAI does not deliver codes to these domains (use for other platforms) |\n| `outlook` | Free | Your own Outlook\u002FHotmail (+tag alias) | No | High trust (personal domain). Set `OUTLOOK_ACCOUNTS` + `OUTLOOK_TOKENS_FILE`; requires one-time Microsoft OAuth authorization per account (see below) |\n| `mailnest` | Paid | Outlook-based | No | Set `MAILNEST_API_KEY` + `MAILNEST_PROJECT_CODE` |\n\n> ⚠️ xAI actively blocks shared disposable-mail domains (mail.tm, gptmail domains). For Grok\n> registration prefer `luckmail` (Outlook addresses) or `gmail`\u002F`outlook` (your own accounts).\n> **Maintainer's production setup uses `luckmail`.** The free providers above are provided as\n> options for other users; their availability may change without notice.\n\n### Outlook provider authorization (one-time per account)\n\nThe `outlook` provider reads codes via Microsoft OAuth (XOAUTH2 IMAP). Authorize each account once:\n\n```bash\n# uses the same authorization flow as unified-mail's graph_auth.py\nuv run python outlook_auth.py your@outlook.com\n```\n\nThe resulting refresh token is stored in `OUTLOOK_TOKENS_FILE` (default `.\u002Foutlook_tokens.json`),\nformat: `{\"your@outlook.com\": {\"refresh_token\": \"...\"}}`. Only accounts with a valid refresh\ntoken are used for registration.\n\n## Usage\n\n### Register accounts\n\n```bash\n# Basic\nuv run python grok.py\n\n# With luckmail provider and 8 threads\nuv run python grok.py --email-provider luckmail --threads 8\n```\n\nOutput:\n- `keys\u002Fgrok.txt` — SSO token list\n- `keys\u002Faccounts.txt` — `email:password:sso` format\n\n### Mint CPA tokens from SSO\n\n```bash\nuv run python sso_to_cpa.py --all\n```\n\nConverts SSO tokens to OAuth access\u002Frefresh tokens via Device Flow.\n\n### Run auto-replenish daemon\n\n```bash\nuv run python auto_replenish.py --daemon 600 --min 2\n```\n\nMonitors account pool every 600s, registers new accounts when pool drops below 2.\n\n### Run token refresh daemon\n\n```bash\nuv run python token_daemon.py\n```\n\n### Re-mint revoked OAuth tokens\n\nWhen xAI invalidates refresh tokens (happens on model releases or account policy changes), re-mint them:\n\n```bash\nuv run python remint_oauth.py\n```\n\nRe-runs Device Flow with existing SSO tokens to obtain fresh access\u002Frefresh tokens.\n\n### Start Turnstile solver\n\n```bash\nuv run python turnstile_solver_local.py\n```\n\nLocal HTTP service for CAPTCHA solving.\n\n## Supported Models\n\nRegistered accounts and minted tokens can be used with [grok2api](https:\u002F\u002Fgithub.com\u002Fchenyme\u002Fgrok2api) to access the following models.\n\n### Free (Basic-tier accounts, no payment required)\n\nThese are the models you get immediately after registration — no SuperGrok subscription needed:\n\n| Model | Capability | How to get |\n|---|---|---|\n| `grok-chat-fast` | Chat (fast mode) | SSO token → Web pool |\n| `grok-imagine-image` | Image generation | SSO token → Web pool |\n| `grok-4.5` | Chat + reasoning + search, 1M output tokens | SSO → Device Flow (`sso_to_cpa.py`) → OAuth direct |\n| `grok-4.6` | Chat + reasoning + search, 500K context, long-running agents, `xhigh` reasoning | SSO → Device Flow (`sso_to_cpa.py`) → Build pool |\n\n> ✅ All four models above have been tested and confirmed working end-to-end.\n>\n> **Note**: After Grok 4.6 release, xAI removed `grok-4.5` from the Build pool — it now works via OAuth direct connection. `grok-4.6` is the current Build pool model. Use `remint_oauth.py` to re-mint tokens if xAI revokes them.\n\n### Paid (requires SuperGrok \u002F Heavy subscription)\n\nThe following models are available in the codebase but require a paid account tier:\n\n| Model | Capability | Tier |\n|---|---|---|\n| `grok-chat-auto` | Chat (auto mode) | Super |\n| `grok-chat-expert` | Chat (expert mode) | Super |\n| `grok-chat-heavy` | Chat (heavy mode) | Heavy |\n| `grok-imagine-image-quality` | Image generation (HD) | Super |\n| `grok-imagine-image-edit` | Image editing | Super |\n| `grok-imagine-video` | Video generation | Super |\n\nOther Build\u002FConsole models available via Device Flow: `grok-4.3`, `grok-4.20-0309-reasoning`, `grok-4.20-0309-non-reasoning`, `grok-4.20-multi-agent-0309`, `grok-build-0.1` (code\u002Fcomposer, 256K output).\n\n## OAuth Device Flow\n\nThe `sso_to_cpa.py` script implements OAuth 2.0 Device Flow with the corrected scope:\n\n```\nopenid profile email offline_access grok-cli:access api:access\n```\n\nThis was validated against the upstream OAuth endpoint and successfully mints access\u002Frefresh tokens.\n\n## Acknowledgments\n\nThis project builds upon and references work from:\n- [AaronL725\u002Fgrok-register](https:\u002F\u002Fgithub.com\u002FAaronL725\u002Fgrok-register)\n- [kaibush\u002Fgrok-register](https:\u002F\u002Fgithub.com\u002Fkaibush\u002Fgrok-register)\n\n## License\n\nMIT\n\n## ⚠️ Disclaimer \u002F 免责声明\n\n**本工具仅用于教育和技术研究目的。使用者须自行承担全部责任。**\n\n- 本项目提供的账号注册与临时邮箱方案**可能违反相关平台的《服务条款》**（包括但不限于 xAI\u002FGrok、Google、Microsoft 等），平台有权随时封禁账号、撤销凭据或追究责任。\n- **在部分国家和地区，批量注册账号、使用临时邮箱、绕过验证机制等行为可能违反当地法律法规**。使用者有责任确认并遵守所在地法律，本项目作者不承担任何因使用本工具导致的直接或间接后果（包括但不限于账号损失、法律纠纷、经济损失）。\n- 项目内各邮箱服务（LuckMail、FreeCustom.Email、Tmail、GPTMail 等）为第三方服务，其可用性、价格与合规性以其官方为准；本仓库不对第三方服务的任何行为负责。\n- 示例中出现的账号、令牌均为占位或已撤销；请勿将任何真实凭据提交到本仓库或任何公开位置。\n- 使用本仓库代码即表示你已阅读并同意上述条款。\n\n**This project is for educational and research purposes only. Users assume all responsibility.**\n\n- Account registration and temporary-email tooling may **violate the Terms of Service of the target platforms** (xAI\u002FGrok, Google, Microsoft, etc.). Platforms may ban accounts, revoke credentials, or pursue other actions at any time.\n- **In some jurisdictions, bulk account registration, disposable-email usage, or bypassing verification mechanisms may be illegal.** You are solely responsible for ensuring compliance with your local laws and regulations. The authors accept no liability for any direct or indirect consequences (including account loss, legal disputes, or financial damages).\n- All third-party email services (LuckMail, FreeCustom.Email, Tmail, GPTMail, etc.) are provided by their respective operators. Availability, pricing, and compliance are subject to their official terms; this repository is not responsible for their actions.\n- Sample accounts and tokens shown in this repository are placeholders or revoked. Never commit real credentials here or anywhere public.\n- By using this code, you confirm that you have read and agree to the above.\n","这是一个面向 x.ai（Grok）平台的自动化账号注册与令牌管理工具包。核心功能包括：基于 curl_cffi 的批量账号注册（集成 YesCaptcha 解决 Turnstile 验证）、SSO 凭据到 CPA 访问令牌的 OAuth Device Flow 转换、令牌自动续期与失效后重签发、邮箱服务（支持 LuckMail\u002FMailNest\u002FGmail 等多提供商）、Clash 代理轮换及 API 网关对接的自动补货守护进程。适用于需规模化获取 Grok API 访问权限的开发测试、API 网关后端支撑或研究型调用场景，强调稳定性、隐蔽性与低维护成本。","2026-08-15 02:30:03","CREATED_QUERY"]