add wavespeed autoreg pipeline + keycheck + measured stats; env-driven config, no secrets
This commit is contained in:
@@ -1,24 +1,101 @@
|
||||
# wavespeed-autoreg
|
||||
# WaveSpeed.ai autoreg
|
||||
|
||||
Autoreg for [WaveSpeed AI](https://wavespeed.ai). Signup is **GitHub OAuth only**, so this worker logs into a
|
||||
GitHub pool account over plain HTTP (with TOTP), walks the OAuth consent, then solves the Turnstile on `/sign-in`.
|
||||
Automated account registration on [wavespeed.ai](https://wavespeed.ai) via GitHub OAuth,
|
||||
with API-key extraction and trial-credit harvesting.
|
||||
|
||||
## Economics (checked 2026-11-01)
|
||||
* Trial credit **$1 per account**, but it is **not granted to every account**: 1 of 60 got `balance=1`,
|
||||
59 got `$0`. Rule not confirmed yet (suspect: 1 grant per egress subnets / device).
|
||||
* Key format `wsk_live_...`. Two different surfaces:
|
||||
* `https://llm.wavespeed.ai/v1` - OpenAI-compatible LLM gateway (qwen3-coder, qwen3-vl-235b, aion-2.0).
|
||||
A funded key returns 200 here; an empty key returns `403 group_balance_not_enough`.
|
||||
* media API - keys only activate after the first top-up, so the trial is useless for images/video.
|
||||
## What it does
|
||||
|
||||
One account = one pass of the pipeline:
|
||||
|
||||
1. **GitHub login** — direct egress (datacenter IP triggers `sessions/verified-device`,
|
||||
residential/hosted-but-trusted IPs do not).
|
||||
2. **WaveSpeed sign-in hop** — `GET /center/default/github/login?cf-turnstile-response=<token>`.
|
||||
The page is protected by Cloudflare Turnstile (sitekey `0x4AAAAAADkE2yCxK2sRF0Q4`,
|
||||
action `login`), solved through 2captcha `TurnstileTaskProxyless` (~$0.003 per account,
|
||||
~15-25 s).
|
||||
3. **OAuth authorize + callback** → dashboard session cookies.
|
||||
4. **Balance read** from `/dashboard` (`Current credit balance`) and **API key creation**
|
||||
via `POST /center/default/api/v1/accesskey/create` with `{"name": "..."}`.
|
||||
5. Result appended to `bank.jsonl`: `{gh_login, balance, key, cookies, egress, secs}`.
|
||||
|
||||
## Measured behaviour (2026-11-01)
|
||||
|
||||
| metric | value |
|
||||
|---|---|
|
||||
| accounts processed | 170 |
|
||||
| API keys created | 120 |
|
||||
| keys with `$1` trial balance | 7 (4 unique accounts) |
|
||||
| `$0` balance | 113 |
|
||||
| no-callback (GitHub side blocked) | 50 |
|
||||
| time per account | 20-80 s |
|
||||
| cost per account | ~$0.003 (captcha) |
|
||||
|
||||
Key findings:
|
||||
|
||||
- **The `$1` trial is granted probabilistically** (~3-8%), not by IP, subnet, geo or
|
||||
timing. Same egress IP produced both `$1` and `$0` accounts minutes apart, and a
|
||||
second signup from an already-used IP sometimes still got `$1`. Volume is the only lever.
|
||||
- **Turnstile is mandatory** — without a valid token the hop endpoint returns non-302.
|
||||
2captcha `TurnstileTaskProxyless` is accepted; solving inside headless Camoufox is not.
|
||||
- **Key creation has no gate** — a key is issued even with `$0` balance, but every call
|
||||
then fails with `403 Insufficient balance` (LLM) or `400 Insufficient credits` (media).
|
||||
|
||||
## API surface of an issued key
|
||||
|
||||
```
|
||||
LLM : https://llm.wavespeed.ai/v1/models
|
||||
https://llm.wavespeed.ai/v1/chat/completions (130 models)
|
||||
Media : https://api.wavespeed.ai/api/v3/<model> e.g. wavespeed-ai/flux-schnell
|
||||
```
|
||||
|
||||
Cheapest models (price per 1M tokens, input/output):
|
||||
|
||||
| model | input | output |
|
||||
|---|---|---|
|
||||
| qwen/qwen3.7-flash | $0.03 | $0.13 |
|
||||
| openai/gpt-5-nano | $0.05 | $0.40 |
|
||||
| anthropic/claude-haiku-5.5 | $0.10 | $0.50 |
|
||||
| openai/gpt-6-luna | $0.10 | $0.50 |
|
||||
|
||||
$1 of trial credit ≈ 33M input tokens on qwen3.7-flash.
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
pip install -r requirements.txt
|
||||
|
||||
export WS_TWOCAP_KEY=<2captcha key>
|
||||
export WS_PROXY=http://user:pass@host:8888 # egress for the WaveSpeed leg
|
||||
export WS_GH_POOL=/path/to/gh_pool.json # [{"login","password","totp"}, ...]
|
||||
export WS_BANK=bank.jsonl
|
||||
export WS_USED=used_gh.txt
|
||||
|
||||
python wavespeed/ws_autoreg.py 25 # process 25 fresh accounts
|
||||
WS_KEYS=keys.txt python wavespeed/ws_keycheck.py
|
||||
```
|
||||
|
||||
`gh_pool.json` is a list of GitHub accounts with `login`, `password` and `totp` secret.
|
||||
The script skips logins already listed in `WS_USED`.
|
||||
|
||||
## Files
|
||||
* `ws_farm.py` - `python ws_farm.py 25` -> N accounts, resumable via `used_gh.txt`, results appended to `bank.jsonl`.
|
||||
|
||||
## Env
|
||||
```
|
||||
TWOCAPTCHA_KEY=... # Turnstile solver (sitekey is public: 0x4AAAAAADkE2yCxK2sRF0Q4)
|
||||
PROXY_AUTH=user:pass # auth for the HTTP CONNECT proxy pool
|
||||
WS_BOXES=1.2.3.4,5.6.7.8 # egress hosts, port 8888 assumed
|
||||
WS_HOME=/path/to/workdir
|
||||
wavespeed/ws_autoreg.py registration pipeline (GitHub OAuth + Turnstile + key creation)
|
||||
wavespeed/ws_keycheck.py key validation: catalogue, chat completion, media generation
|
||||
```
|
||||
Requires `pyotp` for GitHub 2FA.
|
||||
|
||||
## Notes / pitfalls
|
||||
|
||||
- `verified-device` on the GitHub login means the account needs an e-mail code — use
|
||||
another egress for the GitHub leg or a verified account, retrying does not help.
|
||||
- GitHub returns `422` on `/login/oauth/authorize` when the login session is not actually
|
||||
established (the earlier redirect chain was cut short) — always verify the login URL
|
||||
before the OAuth hop.
|
||||
- Console output must stay ASCII: Windows `cp1252` raises `UnicodeEncodeError` and kills
|
||||
the worker mid-wave.
|
||||
- Relative steps of the pipeline are independent: a failure at the callback stage still
|
||||
burns the GitHub login, so log every attempt to `WS_USED`.
|
||||
|
||||
## License
|
||||
|
||||
MIT — see `LICENSE`.
|
||||
Reference in New Issue
Block a user