MCPcopy Create free account

hub / github.com/akihitohyh/chatgpt-register-sub2api / functions

Functions126 in github.com/akihitohyh/chatgpt-register-sub2api

↓ 12 callersFunctionrequest_with_retry
Make an HTTP request with simple retry on network errors. Returns (response, error_string). error_string is empty on success.
chatgpt_register_sub2api/register/session.py:113
↓ 6 callersFunction_response_json
(resp)
chatgpt_register_sub2api/register/registrar.py:91
↓ 6 callersFunctionnormalize_proxy_url
Normalize a proxy URL for curl_cffi. - Strips whitespace - Converts socks:// to socks5h:// (remote DNS resolution) - Returns empty string
chatgpt_register_sub2api/utils/proxy.py:25
↓ 5 callersFunction_response_debug
(resp, limit: int = 500)
chatgpt_register_sub2api/register/registrar.py:99
↓ 5 callersFunctionbuild_sentinel_token
Request a sentinel token from OpenAI's PoW service. Args: session: curl_cffi Session instance device_id: Device UUID flow
chatgpt_register_sub2api/utils/sentinel.py:130
↓ 5 callersMethodclose
(self)
chatgpt_register_sub2api/register/registrar.py:171
↓ 5 callersFunctionload_accounts
Load registered accounts from JSON file.
chatgpt_register_sub2api/pipeline.py:40
↓ 5 callersFunctionload_config
Load and validate config from a YAML file. Merges with defaults so missing keys get sensible values.
chatgpt_register_sub2api/config.py:58
↓ 5 callersFunctionnavigate_headers
Browser navigation headers (text/html accept, no content-type).
chatgpt_register_sub2api/register/headers.py:70
↓ 5 callersFunctionsave_accounts
Save accounts to JSON file (atomic write).
chatgpt_register_sub2api/pipeline.py:51
↓ 5 callersFunctionsetup_logging
Configure Python logging based on config + CLI verbosity.
chatgpt_register_sub2api/cli.py:36
↓ 4 callersMethod_cf_retry
Standard Cloudflare retry pattern. Tries the request; if Cloudflare-challenged, refreshes clearance and retries once. Raises Registra
chatgpt_register_sub2api/register/registrar.py:176
↓ 4 callersFunction_response_json
(resp)
chatgpt_register_sub2api/login/login_flow.py:64
↓ 4 callersFunctionis_cloudflare_challenge
Detect if a response is a Cloudflare challenge page.
chatgpt_register_sub2api/register/session.py:70
↓ 3 callersMethod_b64
(data)
chatgpt_register_sub2api/utils/sentinel.py:96
↓ 3 callersFunction_load_state
Load pool state from disk (email_lower → {state, reason, updated_at}).
chatgpt_register_sub2api/register/mail_provider.py:47
↓ 3 callersFunction_save_state
(state: dict[str, dict[str, Any]])
chatgpt_register_sub2api/register/mail_provider.py:81
↓ 3 callersFunction_set_state
(address: str, state: str, reason: str = "")
chatgpt_register_sub2api/register/mail_provider.py:110
↓ 3 callersFunctionapply_clearance_to_session
Inject clearance cookies and User-Agent into a curl_cffi session.
chatgpt_register_sub2api/utils/proxy.py:172
↓ 3 callersFunctiongenerate_pkce
Generate a PKCE code_verifier and its S256 code_challenge. Returns: (code_verifier, code_challenge) — both base64url-encoded with
chatgpt_register_sub2api/utils/pkce.py:14
↓ 3 callersMethodgenerate_requirements_token
(self)
chatgpt_register_sub2api/utils/sentinel.py:101
↓ 3 callersFunctionjson_headers
JSON API request headers with referer + oai-device-id + Datadog traces.
chatgpt_register_sub2api/register/headers.py:61
↓ 2 callersFunction_base64url_decode
Decode a base64url-encoded string (with padding restored).
chatgpt_register_sub2api/utils/jwt.py:13
↓ 2 callersMethod_cached_access_token
Cache access_token for 10 min to avoid rate limits during polling.
chatgpt_register_sub2api/register/mail_provider.py:392
↓ 2 callersFunction_common_headers
()
chatgpt_register_sub2api/register/headers.py:29
↓ 2 callersFunction_extract_code
Extract 6-digit verification code from email content.
chatgpt_register_sub2api/register/mail_provider.py:175
↓ 2 callersMethod_get_config
(self)
chatgpt_register_sub2api/utils/sentinel.py:45
↓ 2 callersFunction_make_config
Normalize mail config for provider construction.
chatgpt_register_sub2api/register/mail_provider.py:677
↓ 2 callersFunction_message_tracking_ref
Create a content-based tracking reference for deduplication.
chatgpt_register_sub2api/register/mail_provider.py:212
↓ 2 callersFunction_now_iso
()
chatgpt_register_sub2api/export/sub2api.py:24
↓ 2 callersFunction_parse_received_at
(value: Any)
chatgpt_register_sub2api/register/mail_provider.py:247
↓ 2 callersFunctionbuild_credentials
Build the credentials dict for a single sub2api account entry. Args: account: Account record with keys: email, password, acce
chatgpt_register_sub2api/export/sub2api.py:49
↓ 2 callersMethodclose
(self)
chatgpt_register_sub2api/register/mail_provider.py:349
↓ 2 callersFunctioncreate_register_session
Create a curl_cffi Session with proxy and optional Cloudflare clearance. Args: proxy: SOCKS5/HTTP proxy URL flaresolverr_url: Fla
chatgpt_register_sub2api/register/session.py:28
↓ 2 callersFunctiondecode_jwt_payload
Decode the payload (middle segment) of a JWT without verification. Returns an empty dict on any decode error — the caller should handle missi
chatgpt_register_sub2api/utils/jwt.py:19
↓ 2 callersFunctionextract_account_info
Extract account info from an OpenAI access token or id_token JWT. Returns a flat dict with keys matching sub2api credentials schema: email,
chatgpt_register_sub2api/utils/jwt.py:38
↓ 2 callersMethodfetch_clearance
Request clearance from FlareSolverr for target_url. Returns a ClearanceBundle on success, None on failure.
chatgpt_register_sub2api/utils/proxy.py:75
↓ 2 callersMethodfetch_recent_messages
(self, mailbox: dict[str, Any])
chatgpt_register_sub2api/register/mail_provider.py:612
↓ 2 callersFunctionmain
(argv: list[str] | None = None)
chatgpt_register_sub2api/cli.py:198
↓ 2 callersFunctionmark_mailbox_result
Update pool state after registration attempt. - Success → mark as 'used' - Token invalid → mark as 'token_invalid' - Other failure → mark
chatgpt_register_sub2api/register/mail_provider.py:756
↓ 2 callersFunctionre_login_for_team_token
Re-login to get a team-scoped access token. 1. Run OAuth authorize as login (not signup) 2. Enter password 3. Handle OTP 4. Navigate
chatgpt_register_sub2api/login/login_flow.py:75
↓ 2 callersFunctionrefresh_clearance_and_retry
Refresh Cloudflare clearance and apply to session. Returns True if clearance was successfully refreshed.
chatgpt_register_sub2api/register/session.py:90
↓ 2 callersFunctionrun_export
Stage 4: Export accounts as sub2api JSON. Uses team-scoped tokens (team_access_token) when available, falls back to personal tokens.
chatgpt_register_sub2api/pipeline.py:354
↓ 2 callersFunctionrun_join_workspace
Stage 2: Join each account to the K12 parent workspace. Modifies account records in-place with join status.
chatgpt_register_sub2api/pipeline.py:127
↓ 2 callersFunctionrun_register
Stage 1: Register N ChatGPT accounts. Returns list of newly registered account records.
chatgpt_register_sub2api/pipeline.py:62
↓ 2 callersFunctionset_cached_clearance
Cache a clearance bundle.
chatgpt_register_sub2api/utils/proxy.py:199
↓ 2 callersFunctionwait_for_code
Wait for verification code from Outlook mailbox.
chatgpt_register_sub2api/register/mail_provider.py:725
↓ 1 callersMethod__init__
(self, conf: dict, provider_ref: str = "")
chatgpt_register_sub2api/register/mail_provider.py:282
↓ 1 callersFunction_coerce_expires_at
Extract exp from JWT or compute fallback (now + ~10 days).
chatgpt_register_sub2api/export/sub2api.py:28
↓ 1 callersMethod_create_account
(self, name: str, birthdate: str, index: int)
chatgpt_register_sub2api/register/registrar.py:372
↓ 1 callersFunction_deep_merge
Merge overlay into base in-place, recursively.
chatgpt_register_sub2api/config.py:80
↓ 1 callersFunction_entry_available
Check if this email is available for use.
chatgpt_register_sub2api/register/mail_provider.py:89
↓ 1 callersFunction_exchange_login_tokens
Exchange authorization code for tokens after login flow completes. After the login + workspace selection flow, the session should have been r
chatgpt_register_sub2api/login/login_flow.py:366
↓ 1 callersMethod_exchange_refresh_token
( self, client_id: str, refresh_token: str, scope: str )
chatgpt_register_sub2api/register/mail_provider.py:354
↓ 1 callersMethod_exchange_tokens
(self, index: int)
chatgpt_register_sub2api/register/registrar.py:425
↓ 1 callersFunction_extract_oauth_params
(url: str)
chatgpt_register_sub2api/register/registrar.py:121
↓ 1 callersMethod_fnv1a_32
(text: str)
chatgpt_register_sub2api/utils/sentinel.py:33
↓ 1 callersMethod_graph_messages
( self, mailbox: dict[str, Any], access_token: str )
chatgpt_register_sub2api/register/mail_provider.py:516
↓ 1 callersMethod_graph_sender
(message: dict[str, Any])
chatgpt_register_sub2api/register/mail_provider.py:486
↓ 1 callersFunction_handle_login_otp
Handle OTP during login flow.
chatgpt_register_sub2api/login/login_flow.py:236
↓ 1 callersFunction_handle_password_verification
Submit password during login flow. The password verification endpoint may vary. We try the standard Auth0 password verification API at /api/a
chatgpt_register_sub2api/login/login_flow.py:189
↓ 1 callersMethod_imap_messages
( self, mailbox: dict[str, Any], access_token: str )
chatgpt_register_sub2api/register/mail_provider.py:526
↓ 1 callersMethod_make_session
(self)
chatgpt_register_sub2api/register/mail_provider.py:342
↓ 1 callersFunction_make_trace_headers
Generate Datadog APM trace headers (expected by OpenAI's backend).
chatgpt_register_sub2api/register/headers.py:100
↓ 1 callersFunction_message_before_code_boundary
Check if message arrived before the code boundary timestamp.
chatgpt_register_sub2api/register/mail_provider.py:234
↓ 1 callersMethod_normalize_graph_item
( self, mailbox: dict[str, Any], item: dict[str, Any] )
chatgpt_register_sub2api/register/mail_provider.py:494
↓ 1 callersMethod_parse_imap_message
(self, mailbox: dict[str, Any], raw: bytes)
chatgpt_register_sub2api/register/mail_provider.py:566
↓ 1 callersMethod_platform_authorize
(self, email: str, index: int)
chatgpt_register_sub2api/register/registrar.py:225
↓ 1 callersFunction_prewarm_clearance
Try to get initial Cloudflare clearance for auth.openai.com.
chatgpt_register_sub2api/register/session.py:49
↓ 1 callersFunction_random_birthdate
()
chatgpt_register_sub2api/register/registrar.py:83
↓ 1 callersFunction_random_name
()
chatgpt_register_sub2api/register/registrar.py:73
↓ 1 callersFunction_random_password
(length: int = 16)
chatgpt_register_sub2api/register/registrar.py:60
↓ 1 callersMethod_read_graph
(self, access_token: str)
chatgpt_register_sub2api/register/mail_provider.py:453
↓ 1 callersMethod_register_user
(self, email: str, password: str, index: int)
chatgpt_register_sub2api/register/registrar.py:276
↓ 1 callersFunction_release_state
Release in_use state back to unused.
chatgpt_register_sub2api/register/mail_provider.py:124
↓ 1 callersFunction_select_team_workspace
Select the team workspace during login flow. After OTP verification, accounts with multiple workspaces will be presented with a workspace pic
chatgpt_register_sub2api/login/login_flow.py:303
↓ 1 callersMethod_send_otp
(self, index: int)
chatgpt_register_sub2api/register/registrar.py:307
↓ 1 callersFunction_timestamp
()
chatgpt_register_sub2api/pipeline.py:36
↓ 1 callersMethod_validate_otp
(self, code: str, index: int)
chatgpt_register_sub2api/register/registrar.py:329
↓ 1 callersFunctionbackfill_id_token_claims
Ensure an id_token JWT contains chatgpt_account_id and account_id in its https://api.openai.com/auth claim. If either is missing, a compatibi
chatgpt_register_sub2api/utils/jwt.py:70
↓ 1 callersFunctionbuild_account_entry
Build a single sub2api account entry from an account record.
chatgpt_register_sub2api/export/sub2api.py:116
↓ 1 callersFunctionbuild_session_kwargs
Build kwargs for constructing a curl_cffi requests.Session. Args: proxy: SOCKS5/HTTP proxy URL impersonate: TLS fingerprint targe
chatgpt_register_sub2api/utils/proxy.py:140
↓ 1 callersFunctionbuild_sub2api_bundle
Build a complete sub2api bundle from a list of account records. Args: accounts: List of account dicts (from registration or login) R
chatgpt_register_sub2api/export/sub2api.py:143
↓ 1 callersMethodclose
(self)
chatgpt_register_sub2api/register/mail_provider.py:313
↓ 1 callersFunctioncreate_mailbox
Create a mailbox from the Outlook token pool.
chatgpt_register_sub2api/register/mail_provider.py:691
↓ 1 callersMethodcreate_mailbox
(self, username: str | None = None)
chatgpt_register_sub2api/register/mail_provider.py:413
↓ 1 callersFunctionexport_sub2api_json
Export accounts as sub2api bundle JSON. Args: accounts: List of account records output_path: Path to write. If None, auto-generat
chatgpt_register_sub2api/export/sub2api.py:161
↓ 1 callersMethodfetch_latest_message
(self, mailbox: dict[str, Any])
chatgpt_register_sub2api/register/mail_provider.py:286
↓ 1 callersFunctiongenerate_default_config
Write the default config.yaml to disk. Returns the path written.
chatgpt_register_sub2api/config.py:89
↓ 1 callersMethodgenerate_token
(self, seed: str, difficulty: str)
chatgpt_register_sub2api/utils/sentinel.py:107
↓ 1 callersFunctionget_cached_clearance
Get a cached clearance bundle for the target host + proxy combo.
chatgpt_register_sub2api/utils/proxy.py:189
↓ 1 callersMethodis_valid_for
Check if this clearance is still fresh for the given target.
chatgpt_register_sub2api/utils/proxy.py:55
↓ 1 callersFunctionjoin_workspace
Send a single workspace join request. Args: access_token: The account's Bearer token workspace_id: Parent workspace UUID
chatgpt_register_sub2api/workspace/joiner.py:23
↓ 1 callersFunctionjoin_workspaces
Join multiple workspaces sequentially. Args: access_token: The account's Bearer token workspace_ids: List of parent workspace UUI
chatgpt_register_sub2api/workspace/joiner.py:122
↓ 1 callersFunctionjson_dumps
(data)
chatgpt_register_sub2api/register/registrar.py:117
↓ 1 callersFunctionparse_outlook_credentials
Parse outlook token pool text. Format: email----password----client_id----refresh_token (one per line)
chatgpt_register_sub2api/register/mail_provider.py:140
↓ 1 callersMethodregister
Run the complete registration flow. Returns: {email, password, access_token, refresh_token, id_token, source_type, c
chatgpt_register_sub2api/register/registrar.py:471
↓ 1 callersFunctionrelease_mailbox
Release in_use state back to unused (if registration is abandoned).
chatgpt_register_sub2api/register/mail_provider.py:787
↓ 1 callersFunctionrun_full_pipeline
Run the complete pipeline: register → join → re-login → export. Args: config: Full config dict from config.yaml count: Override r
chatgpt_register_sub2api/pipeline.py:391
↓ 1 callersFunctionrun_re_login
Stage 3: Re-login each account with Team space selection. Gets team-scoped tokens for accounts that successfully joined. NOTE: This step requ
chatgpt_register_sub2api/pipeline.py:184
next →1–100 of 126, ranked by callers