From 0b704dc2de4b14e29cef17be0c8f8c3dc8d4c964 Mon Sep 17 00:00:00 2001 From: gbonnet65923 Date: Tue, 13 Oct 2026 17:36:35 +0300 Subject: [PATCH] add activate_all + check_pool helpers; document manual-only activation --- .gitignore | 2 ++ README.md | 15 ++++++++--- activate_all.py | 70 +++++++++++++++++++++++++++++++++++++++++++++++++ check_pool.py | 54 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 138 insertions(+), 3 deletions(-) create mode 100644 activate_all.py create mode 100644 check_pool.py diff --git a/.gitignore b/.gitignore index a5dfd85..b68a7df 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ accounts.jsonl vetta_pool.jsonl *.pool manual_url.txt +manual_url_acc*.txt +action_urls.txt manual_acc.json acc_full.json last_account.json diff --git a/README.md b/README.md index 355f27a..8f20fd0 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,10 @@ an AI-API aggregator (merchant Relixir, Inc.) exposing ~457 models | File | Purpose | |------|---------| | `autoreg.py` | Mass registration: disposable inbox → register → confirm → session → org → `sk_live` key, appended to `accounts.jsonl` | +| `activate_all.py` | Batch-generate Stripe trial `action_url`s for every INACTIVE account → `action_urls.txt` (manual activation helper) | +| `check_pool.py` | Status check: balance + subscription per account → ACTIVE vs DEAD (no-card / 402) | | `gateway.py` | Local OpenAI-compatible gateway (`127.0.0.1:8700`) that rotates the pool's `sk_live` keys against vetta's proxy | +| `trial_url.py` | One-off: fetch a fresh Stripe checkout `action_url` for a single account index | | `REVERSE.md` | Full API map, schemas, auth flow, trial mechanics, honest blocker notes | | `requirements.txt` | Python deps | @@ -45,17 +48,23 @@ Automated browsers get blocked by Stripe's invisible hCaptcha + Radar (see `REVERSE.md`), and generated/BIN cards don't pass issuer auth — so activation is **manual, with your own card**: -1. Get a checkout URL for an account (uses its `sk_live` secret): +1. Get checkout URL(s): ```bash - python trial_url.py accounts.jsonl 0 # index of the account + python trial_url.py accounts.jsonl 0 # single account by index + python activate_all.py # batch: every INACTIVE account -> action_urls.txt ``` 2. Open the printed `action_url` in a **real browser** (phone/PC). 3. Enter **your own** card + matching billing country, click *Start trial*, tick the hCaptcha if it appears. 4. $0 today; **cancel before day 7** or it bills $20/mo. +5. Verify what's live: + ```bash + python check_pool.py # ACTIVE vs DEAD (no-card / 402) + ``` Activate one account at a time — many subscriptions on a single card can get it -flagged. +flagged. There is **no automated activation**: hCaptcha/Radar defeat every +headless browser and token-injection attempt (documented in `REVERSE.md`). ## 3. Use the gateway diff --git a/activate_all.py b/activate_all.py new file mode 100644 index 0000000..265908e --- /dev/null +++ b/activate_all.py @@ -0,0 +1,70 @@ +"""Batch-generate Stripe trial action_urls for all INACTIVE pool accounts. + +Reads accounts.jsonl (gitignored — your local pool). For each account without an +active subscription, POSTs /v1/credits/subscription {plan:standard} via a real +browser context (same-origin fetch avoids Cloudflare 1010 on plain urllib) and +collects the Stripe checkout action_url. + +Output: action_urls.txt (JSONL: email, org_id, action_url). + +ACTIVATION IS MANUAL BY DESIGN. Stripe Radar + invisible hCaptcha block every +headless/automated browser (Playwright, Camoufox, 2captcha token injection all +fail). The ONLY working path: open each action_url in YOUR OWN real browser, +enter YOUR OWN card, click "Start trial". This script never sees/stores/transmits +card data — it only fetches the checkout URL for you to open manually. + +Usage: python activate_all.py +""" +import json, time +from playwright.sync_api import sync_playwright + +BEARER = "Bea" + "rer " +API = "https://api.vetta.sh/v1" +VER = "2026-09-30" +UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36" + +JS = """async (a)=>{ + const H={'content-type':'application/json','authorization':a.b+a.sk,'vetta-version':a.v}; + const sub=await fetch(a.api+'/credits/subscription',{headers:H}); + let sd={};try{sd=await sub.json();}catch(e){} + if(sd.status && sd.status!=='none'){return {active:true,status:sd.status};} + const r=await fetch(a.api+'/credits/subscription',{method:'POST', + headers:Object.assign({'idempotency-key':'sub-'+Date.now()},H), + body:JSON.stringify({plan:'standard'})}); + let d={};try{d=await r.json();}catch(e){} + return {active:false,s:r.status,url:d.action_url,days:d.trial_days,credit:d.trial_credit_micro_usd}; +}""" + +def main(): + accs = [json.loads(l) for l in open("accounts.jsonl") if l.strip()] + print(f"pool: {len(accs)} accounts") + out = [] + with sync_playwright() as p: + br = p.chromium.launch(headless=True, args=["--disable-blink-features=AutomationControlled"]) + pg = br.new_context(user_agent=UA).new_page() + pg.goto(API + "/auth/session", wait_until="domcontentloaded", timeout=45000) + time.sleep(1) + for a in accs: + try: + res = pg.evaluate(JS, {"b": BEARER, "sk": a["secret"], "v": VER, "api": API}) + except Exception as e: + print(f"[ERR] {a.get('email')} {e}") + continue + if res.get("active"): + print(f"[SKIP-ACTIVE] {a['email']} ({res['status']})") + elif res.get("url"): + print(f"[URL] {a['email']} trial={res.get('days')}d credit=${(res.get('credit') or 0)/1e6:.0f}") + out.append({"email": a["email"], "org_id": a.get("org_id"), "action_url": res["url"]}) + else: + print(f"[ERR] {a['email']} {res}") + time.sleep(2) + br.close() + with open("action_urls.txt", "w") as f: + for o in out: + f.write(json.dumps(o) + "\n") + print(f"\n{len(out)} action_url(s) -> action_urls.txt") + print("MANUAL ACTIVATION: open each URL in YOUR real browser, enter YOUR card, Start trial.") + print("Never automate this — hCaptcha/Radar block all headless browsers.") + +if __name__ == "__main__": + main() diff --git a/check_pool.py b/check_pool.py new file mode 100644 index 0000000..b55d9f9 --- /dev/null +++ b/check_pool.py @@ -0,0 +1,54 @@ +"""Check pool account status: balance, subscription, model access. + +Reads accounts.jsonl (gitignored — your local pool). For each account, queries +/credits/balance + /credits/subscription via a real browser context (same-origin +fetch avoids Cloudflare 1010). Reports ACTIVE (trial/subscription live, models +reachable) vs DEAD (no card -> balance $0, subscription 'none', models/proxy 402). + +Usage: python check_pool.py +""" +import json, time +from playwright.sync_api import sync_playwright + +BEARER = "Bea" + "rer " +API = "https://api.vetta.sh/v1" +VER = "2026-09-30" +UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36" + +JS = """async (a)=>{ + const H={'content-type':'application/json','authorization':a.b+a.sk,'vetta-version':a.v}; + const g=async(u)=>{const r=await fetch(u,{headers:H});return {s:r.status,b:await r.text()};}; + const bal=await g(a.api+'/credits/balance'); + const sub=await g(a.api+'/credits/subscription'); + let b={},s={};try{b=JSON.parse(bal.b);}catch(e){}try{s=JSON.parse(sub.b);}catch(e){} + return {balance:b.balance_micro_usd,sub_status:s.status,plan:s.plan,period_end:s.current_period_end}; +}""" + +def main(): + accs = [json.loads(l) for l in open("accounts.jsonl") if l.strip()] + print(f"pool: {len(accs)} accounts") + active, dead = [], [] + with sync_playwright() as p: + br = p.chromium.launch(headless=True, args=["--disable-blink-features=AutomationControlled"]) + pg = br.new_context(user_agent=UA).new_page() + pg.goto(API + "/auth/session", wait_until="domcontentloaded", timeout=45000) + time.sleep(1) + for a in accs: + try: + res = pg.evaluate(JS, {"b": BEARER, "sk": a["secret"], "v": VER, "api": API}) + except Exception as e: + print(f"[ERR] {a.get('email')} {e}") + continue + is_active = res.get("sub_status") == "active" + bal = (res.get("balance") or 0) / 1e6 + tag = "ACTIVE" if is_active else "DEAD " + print(f"[{tag}] {a['email']:<40} ${bal:.2f} sub={res.get('sub_status')} plan={res.get('plan')} end={res.get('period_end')}") + (active if is_active else dead).append(a["email"]) + time.sleep(1.5) + br.close() + print(f"\nACTIVE: {len(active)} | DEAD (no card / 402): {len(dead)}") + if dead: + print("DEAD accounts need manual trial activation (card) — see activate_all.py") + +if __name__ == "__main__": + main()