Files
camb-autoreg/README.md
T

7.2 KiB

camb-autoreg

Autoreg for studio.camb.ai — dubbing / TTS service with a refillable free plan.

Economics (verified on live accounts, 2026-11-04)

  • Free product: 5000 credits, is_refill_based: true (monthly refill).
  • Balance: GET https://client.camb.ai/payments/credits/team/<team_id> -> {"credits_left":5000.0,"is_free_plan":true}.
  • Dub job (job_type 1) = 550 credits -> ~9 dubs per account. TTS phrase ~3 credits.
  • 100k credits pack = $50 -> 1 credit ~= $0.0005 -> free account ~= $2.5 of API value.
  • Autoreg re-verified 2026-11-04: two consecutive accounts in ~2 min, each credits: 5000 + working key (team 499879 key fcc9b60a-…, team 499881 key 8bdd6bd8-…); TTS 200, 12 270 bytes audio/mpeg (cold call ~116 s, warm 2-3 s). Pool sample 6/6 keys alive.

Flow

  1. https://studio.camb.ai/public/onboarding is the only signup entry (/signup, /register return 404 shells).
  2. Form: input[name=name], input[type=email], input[type=password] (10+ chars, upper+lower+digit+symbol), consent checkbox (Radix button[role=checkbox] — click by bbox).
  3. Turnstile sitekey 0x4AAAAAAB7HkZD89uSr-6VZ, token lands in input[name=cf-turnstile-response] (~752 chars). Wait for it before submit.
  4. POST https://client.camb.ai/uservault/auth/signup -> 200 {"payload":{"access_token":"..."}}; token works before email verification.
  5. Mail from help@camb.ai, subject Email Verification. Code is 6 alphanumeric chars (LSQX01), not digits.
  6. PATCH /uservault/users/verification/mail/verify?verification_code=<CODE> -> {"verified": true}.
  7. Onboarding "Who are you?" -> Skip -> /workspace/<team_id>/home.
  8. team_id: POST /uservault/auth/refresh-token (credentials include) -> payload.access_token -> GET /v1/teams/ with bearer -> payload.teams[0].id.
  9. Key: /workspace/<team_id>/api-keys -> Create New API Key -> input[name=api-key-name] -> Create Secret Key -> read 30+ char value.
  10. Working call: POST https://client.camb.ai/apis/tts-stream with header x-api-key and body {"text","language":"en-us","voice_id":147320,"speech_model":"mars-flash","output_configuration":{"format":"wav"}}. Credits spent come back in x-credits-required.

Pitfalls

  • No Turnstile token -> 400 "Turnstile token not found" on both signup and login. Browser farm only.
  • Verification mail quota: GET /uservault/users/verification/mail/quota-status -> can_send:false, block_type:"soft_block", ~2 min window. Do not hammer Resend.
  • Match the submit button by exact text create account; a loose "sign up" match hits the Google button.
  • Clear cookies AND localStorage before signup, otherwise the onboarding form may not render.
  • pg.close() on the last tab kills CDP Chrome; reattach with ensure_chrome(port, prof).
  • Vercel Security Checkpoint: curl/curl_cffi get 429 + HTML stub; only real Chrome over CDP passes. The API host client.camb.ai is reachable directly — do recon there.

Files

  • farm.py — worker: signup -> code via VPS mailbox -> verify -> team_id -> api key -> TTS check -> bank row.
  • chr.py — ensure_chrome(port=9242) CDP helper.
  • camb_shim.py — OpenAI-compatible /v1/audio/speech shim over the key pool (round-robin, dead-key blacklist, 429 cooldown).

Env

CAMB_VPS=root@your-vps            # ssh host able to read the mailbox
CAMB_MAIL_READER=/root/camb_code.py
CAMB_KEYS=/opt/camb-shim/camb_keys.json
CAMB_SHIM_PORT=8822

Dashboard

dashboard.py — stdlib-only web panel (no CDN, no deps), dark UI, auto-refresh 30s.

python3 dashboard.py --port 8823 --bank /opt/camb-dash/camb_bank.jsonl \
        --stats /opt/camb-dash/camb_stats.json --shim http://127.0.0.1:8822 --refresh 900
route meaning
GET / page: totals + per-account table
GET /api/stats JSON snapshot (cached)
GET /api/refresh force re-check of the pool
GET /health liveness

What it shows: records / unique accounts / keys / alive / dead, credits left and capacity, spent, TTS phrases, dubs, USD value, shim health, and a table of accounts with the last 6 chars of each key and its liveness.

Liveness is checked with GET https://client.camb.ai/apis/list-voices + x-api-key (200 = alive, 401/403 = dead). It costs zero credits — do not use tts-stream for health.

Credits cannot be read per API key: GET /payments/credits/team/<id> answers 401 Unauthorized for an x-api-key/Bearer API key (it wants a user JWT). So the panel derives capacity as keys * 5000 and subtracts real TTS spends (tts_credits in the bank).

Unit file used in production:

[Unit]
Description=CAMB pool dashboard
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/python3 /opt/camb-dash/dashboard.py --port 8823 \
  --bank /opt/camb-dash/camb_bank.jsonl --stats /opt/camb-dash/camb_stats.json \
  --shim http://127.0.0.1:8822 --refresh 900
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

Caddy (behind an existing host, prefix mode — the page uses relative URLs on purpose):

redir /camb /camb/ 308
handle_path /camb/* {
    reverse_proxy 127.0.0.1:8823
}

Pitfalls

  • --port overrides env. In the Windows/MSYS shell VAR=val cmd & silently loses the variable, so the panel kept binding its default port; argv is the only reliable path.
  • Port 8899 is taken by the ZTE proxy on the workstation — two processes ended up LISTEN on it (SO_REUSEADDR) and every request died as "remote end closed connection". Pick a port that is really free (ss -lnt), not just "looks free".
  • team_id in the bank can be an int — str() it before .strip() or the refresh thread dies.

MARS 8 family — gateway aliases

All five models were probed live (POST /apis/tts-stream, key from the pool) before wiring:

gateway model CAMB speech_model rate first-call latency
camb-tts mars-flash 22.05/48 kHz, ultra-low latency 1.5-2.2 s
camb-tts-pro mars-pro 48 kHz, dubbing/audiobooks 20-41 s cold, 2.9 s warm
camb-tts-instruct mars-instruct 22.05 kHz, emotion tags in text 4.9 s
camb-tts-81-flash mars-8.1-flash-beta 48 kHz, beta 8.1 2.1 s
camb-tts-81-pro mars-8.1-pro-beta 48 kHz, beta 8.1 pro 2.6 s

Credits per phrase (x-credits-required): flash 2.53, pro 3.375, instruct 5.06. mars is not a valid model id — the pro tier is mars-pro; using mars returns 4xx from CAMB.

Adding a model to the gateway needs five gates, otherwise it answers 503/403 while the shim is healthy:

  1. MODELS map in camb_shim.py (alias -> real speech_model).
  2. channels.models of the PG channel + abilities rows for every group (enabled=true, boolean!).
  3. /root/sso_limits.py MODELS + --apply (else 403 no access to model).
  4. rank_models() in /opt/grok-bot/iishko/legacy.py — the bot rewrites tokens.model_limits on every user message, so any TTS model missing there disappears right after the next message.
  5. /root/toolgate.py ALLOW — otherwise toolgate.timer disables it within minutes.

Also check the unit: camb-shim.service was running CAMB_SHIM_PORT=8817 while the channel and the dashboard both point at 8822 — a silent mismatch, channel parked (status=2), zero requests.