← Back
0xgetz

0xgetz/xai-account-setup

A focused Playwright helper for setting up one xAI account and creating one API key.

View on GitHub ↗https://console.x.ai/ ↗
account-setupapi-keybrowser-automationgrokopen-sourceplaywrightpythonxai
Stars
5
Forks
0
Watchers
5
Open issues
0
Contributors
1
Language
Python
License
MIT License
Default branch
main
Created Oct 1, 2026Updated Oct 1, 2026

Star growth

Today—
This week—
This month—

Star history will appear here once this repo has been tracked for a couple of days.

README

xAI Account Setup logo

xAI Account Setup

A focused Playwright helper for setting up one xAI account and creating one API key.

Python 3.10+ Playwright MIT license Manual verification

Languages: English · Bahasa Indonesia · Español · 简体中文 · 日本語

What it does

  • Opens the official xAI console in a visible browser.
  • Fills the account and team forms.
  • Pauses for the verification code delivered to your email.
  • Creates an API key from the xAI API Keys page.
  • Writes the result to a local JSON file with restrictive permissions.

The project intentionally does not automate disposable inboxes, bypass CAPTCHA or anti-abuse controls, accept terms on your behalf, or purchase credits. Use an email address you control.

Quick start

python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
playwright install chromium
python xai_account_setup.py

The script asks for your email, name, team name, API-key name, and password. When xAI sends the six-digit code, enter it in the terminal. If xAI presents a CAPTCHA or payment choice, complete or review it yourself.

Output

The default output is xai_credentials.json. It contains the API key, so it is excluded by .gitignore and should be treated like a password. Override the path with XAI_OUTPUT when needed.

Configuration

Interactive prompts can be replaced with environment variables:

export XAI_EMAIL="you@example.com"
export XAI_FIRST_NAME="Ada"
export XAI_LAST_NAME="Lovelace"
export XAI_TEAM_NAME="Personal API"
export XAI_KEY_NAME="Primary API Key"
export XAI_PASSWORD="use-a-private-password"
export XAI_OUTPUT="./private/xai_credentials.json"
python xai_account_setup.py

XAI_BROWSER_PROFILE controls the persistent Playwright profile directory. Never commit that directory or an output file containing a key.

Responsible use

Run this for an account you are authorized to create. Respect xAI's terms, rate limits, billing rules, and verification requirements. This repository is intentionally a one-account setup helper, not a bulk account generator.

License

MIT. See LICENSE.