5.1 KiB
OpenAI phone verification with 5sim SMS: proxy switch + resend-on-accepted-number notes (2026-05-10)
Context
During a Codex2API OAuth onboarding run, OpenAI registration/login reached https://auth.openai.com/add-phone. BOSS suspected the previous proxy node influenced SMS delivery and asked to switch the visible Chrome browser proxy from socks5://192.168.2.8:1085 to socks5://192.168.2.8:1083.
Important operating constraints from the run:
- Use visible Google Chrome stable with CDP on
127.0.0.1:9223. - Phone verification must use 5sim SMS activation for product
openai, not WhatsApp. - Follow configured
FIVE_SIM_COUNTRY_ID; if empty, use the original extension defaultvietnam. - For non-USA numbers, verify the visible OpenAI country selector before buying/submitting the number.
- Do not leak phone numbers, API keys, OAuth URLs with codes, callback URLs, or admin keys.
Proxy switch behavior
1083 probe result in this session:
nc 192.168.2.8 1083 -> TCP succeeded
curl --proxy socks5h://192.168.2.8:1083 https://api.ipify.org -> 43.207.194.18
curl --proxy socks5h://192.168.2.8:1083 -I https://chatgpt.com -> HTTP/2 403, cf-mitigated: challenge
Visible Chrome did not show a Cloudflare challenge, but switching proxy caused the OpenAI auth session to become invalid:
https://auth.openai.com/add-phone -> title: 你的会话已结束 - OpenAI
Recovery pattern:
- Cancel any active 5sim order before changing proxy.
- Update
BROWSER_PROXY_SERVERin~/.hermes/env/codex_oauth_onboarding.env. - Kill/relaunch only the isolated Chrome process using
--remote-debugging-port=9223 --proxy-server=<new proxy>. - Regenerate a Codex2API OAuth URL from the origin, not from an admin page path:
- If
CODEX2API_URL=http://host:port/admin/accounts, strip tohttp://host:port. - Correct endpoint observed:
POST /api/admin/oauth/generate-auth-urlwithX-Admin-Key.
- If
- Re-open the auth URL in the visible Chrome profile.
- Re-login via email and poll ClawEmail for the latest OpenAI code.
- Continue to
add-phone.
Pitfall: using CODEX2API_URL directly when it contains /admin/accounts leads to wrong paths like /admin/accounts/api/... and 404. Always parse origin first.
Country selector pitfall
OpenAI's country selector is React-controlled. CDP-only mutation of input[type=tel] can desync country state or let the selector revert to 美国 (+1). Future runs should prefer visible UI selection and paste:
- Clear phone field.
- Open country dropdown.
- PageDown/scroll to the configured country.
- Click the visible country row (Vietnam observed around screen coordinate
(620,1173)on a 2560x1600 screenshot, but re-check with screenshot/OCR). - Verify DOM/body text includes the expected visible selector, e.g.
越南 (+84). - Buy 5sim activation only after the selector is stable.
- Paste the local part of the phone via clipboard/UI, not CDP-only assignment.
- Click the actual visible
继续button; button center may differ by layout, verify screenshot if needed.
Resend strategy correction from BOSS
BOSS corrected the workflow: when OpenAI does not immediately reject a phone number, do not cancel it after the first 5sim polling timeout. Treat it as an accepted/pending number:
- Poll
/v1/user/check/{activationId}for SMS. - If no SMS arrives, click OpenAI's visible/DOM
重新发送control. - Poll again.
- Repeat at least one more resend/poll cycle before canceling.
- Only cancel and rotate when:
- OpenAI explicitly says
无法向此电话号码发送验证码; or - the number remains pending after resend attempts and no SMS arrives.
- OpenAI explicitly says
This matters because in this session some Vietnam numbers were not rejected immediately but never delivered SMS on 5sim. Those should be given resend attempts before cancellation.
Observed results on 1083 + Vietnam
After switching to socks5://192.168.2.8:1083, multiple vietnam/any/openai SMS activation attempts were made. Outcomes:
- Several numbers were directly rejected by OpenAI with:
无法向此电话号码发送验证码。请稍后重试或使用其他号码。 - Some numbers were not immediately rejected, but repeated 5sim checks returned
RECEIVEDwithsms=[]. - Applying the resend strategy still produced no SMS for the accepted/pending numbers in this run.
- Therefore, the current evidence points to poor availability/deliverability of the 5sim Vietnam OpenAI pool under both
1085and1083, not a WhatsApp-vs-SMS mistake.
Minimal reusable script pattern
For future automation, encapsulate this loop:
cancel active order
ensure OpenAI add-phone page
ensure visible country selector == configured country
buy /v1/user/buy/activation/{country}/{operator}/openai
paste local phone via UI
click continue
if explicit reject: cancel + rotate
else: poll 5sim; click resend; poll; click resend; poll; then cancel + rotate if still no SMS
Do not hard-code vietnam unless FIVE_SIM_COUNTRY_ID is empty or BOSS explicitly requests it. If BOSS changes config to england, japan, etc., use that value and update the visible-country selection accordingly.