Repository Analysis

basketikun/chatgpt2api

ChatGPT官网接口纯协议的逆向实现,支持GPT-Image-2模型、文本模型,兼容OpenAI接口协议,在线批量生图/编辑图,号池管理,支持可编辑PPT/PSD文件逆向,支持导入CPA、sub2api号池 、支持接入Cherry Studio、New Api 等软件

14.8 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of basketikun/chatgpt2api, a Python project with 6,051 GitHub stars. SynthScan v2.0 examined 42,653 lines of code across 186 source files, recording 630 pattern matches distributed across 10 syntactic categories. The overall adjusted score of 14.8 places this repository in the Low AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

14.8
Adjusted Score
14.8
Raw Score
100%
Time Factor
2026-07-29
Last Push
6.1K
Stars
Python
Language
42.7K
Lines of Code
186
Files
630
Pattern Hits
2026-08-29
Scan Date
0.01
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 1MEDIUM 15LOW 614

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 630 distinct pattern matches across 10 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Hyper-Verbose Identifiers330 hits · 334 pts
SeverityFileLineSnippetContext
LOWtest/test_model_catalog_service.py85 def test_catalog_unions_anonymous_and_each_active_account_type(self) -> None:CODE
LOWtest/test_model_catalog_service.py104 def test_catalog_is_cached_until_ttl_expires(self) -> None:CODE
LOWtest/test_model_catalog_service.py112 def test_concurrent_readers_share_one_catalog_refresh(self) -> None:CODE
LOWtest/test_model_catalog_service.py122 def test_failed_refresh_keeps_last_successful_models_for_that_type(self) -> None:CODE
LOWtest/test_model_catalog_service.py136 def test_removed_account_type_drops_its_stale_capabilities(self) -> None:CODE
LOWtest/test_image_storage_service.py72 def test_local_mode_saves_to_local_directory(self):CODE
LOWtest/test_image_storage_service.py79 def test_webdav_mode_uploads_without_local_file(self):CODE
LOWtest/test_image_storage_service.py95 def test_list_items_ignores_non_image_files(self):CODE
LOWtest/test_image_storage_service.py108 def test_both_mode_saves_to_local_and_webdav(self):CODE
LOWtest/test_image_storage_service.py124 def test_test_webdav_writes_and_deletes_probe_file(self):CODE
LOWtest/test_image_tasks_api.py72 def test_create_generation_task(self):CODE
LOWtest/test_image_tasks_api.py85 def test_create_edit_task_accepts_multiple_images(self):CODE
LOWtest/test_image_tasks_api.py103 def test_create_edit_task_accepts_image_url(self):CODE
LOWtest/test_image_tasks_api.py121 def test_list_tasks_reports_missing_ids(self):CODE
LOWtest/test_account_image_capabilities.py20 def test_image_accounts_require_positive_quota(self) -> None:CODE
LOWtest/test_account_image_capabilities.py33 def test_prolite_variants_are_normalized(self) -> None:CODE
LOWtest/test_account_image_capabilities.py39 def test_search_account_type_ignores_unrelated_scalar_values(self) -> None:CODE
LOWtest/test_account_image_capabilities.py53 def test_mark_image_result_consumes_quota(self) -> None:CODE
LOWtest/test_account_image_capabilities.py71 def test_split_image_model_supports_plan_type_prefix(self) -> None:CODE
LOWtest/test_account_image_capabilities.py79 def test_get_available_access_token_filters_by_plan_type(self) -> None:CODE
LOWtest/test_account_image_capabilities.py99 def test_refresh_accounts_can_remove_invalid_token_without_confirmation_delay(self) -> None:CODE
LOWtest/test_account_image_capabilities.py123 def test_refresh_accounts_defers_invalid_token_removal_by_default(self) -> None:CODE
LOWtest/test_account_image_capabilities.py150 def test_anonymize_token_hides_raw_value(self) -> None:CODE
LOWtest/test_account_image_capabilities.py159 def test_create_authenticate_disable_and_delete_user_key(self) -> None:CODE
LOWtest/test_account_image_capabilities.py185 def test_authenticate_ignores_last_used_save_failure(self) -> None:CODE
LOWtest/test_account_image_capabilities.py201 def test_update_user_key_replaces_raw_key(self) -> None:CODE
LOWtest/test_account_image_capabilities.py215 def test_user_key_name_must_be_unique(self) -> None:CODE
LOWtest/test_v1_models.py17 def test_list_models_only_returns_image_models_backed_by_account_types(self):CODE
LOWtest/test_v1_models.py43 def test_list_models_does_not_return_codex_models_for_web_plus_accounts(self):CODE
LOWtest/test_v1_models.py65 def test_list_models_function(self):CODE
LOWtest/test_proxy_runtime_api.py42 def get_proxy_runtime_settings(self) -> dict[str, object]:CODE
LOWtest/test_proxy_runtime_api.py45 def get_public_proxy_runtime_settings(self) -> dict[str, object]:CODE
LOWtest/test_proxy_runtime_api.py127 def test_proxy_test_can_use_active_runtime_when_url_is_empty(self) -> None:CODE
LOWtest/test_proxy_runtime_api.py136 def test_proxy_runtime_endpoint_reads_and_updates_runtime_config(self) -> None:CODE
LOWtest/test_proxy_runtime_api.py156 def test_clearance_test_endpoint_runs_clearance_refresh_without_returning_cookie_values(self) -> None:CODE
LOWtest/test_proxy_runtime_api.py170 def test_health_json_includes_proxy_runtime_status(self) -> None:CODE
LOWtest/test_multi_image_results.py48 def _get_attachment_download_url(self, conversation_id: str, attachment_id: str) -> str:CODE
LOWtest/test_multi_image_results.py53 def test_stream_id_extractor_keeps_full_file_ids(self) -> None:CODE
LOWtest/test_multi_image_results.py65 def test_conversation_record_extractor_finds_all_generated_assets(self) -> None:CODE
LOWtest/test_multi_image_results.py114 def test_poll_waits_for_generated_asset_ids_to_settle(self) -> None:CODE
LOWtest/test_multi_image_results.py131 def test_resolver_uses_file_and_sediment_urls(self) -> None:CODE
LOWtest/test_multi_image_results.py147 def test_resolver_keeps_stream_ids_when_poll_extension_fails(self) -> None:CODE
LOWtest/test_multi_image_results.py157 def test_responses_stream_emits_all_image_output_items(self) -> None:CODE
LOWtest/test_v1_images_edits.py69 def test_image_edit_stream_http(self):CODE
LOWtest/test_image_base_url_api.py15 def test_prefers_configured_base_url(self) -> None:CODE
LOWtest/test_image_base_url_api.py23 def test_falls_back_to_request_host(self) -> None:CODE
LOWtest/test_image_base_url_api.py32 def test_falls_back_to_request_netloc_when_host_missing(self) -> None:CODE
LOWtest/test_init_proxy_config.py23 def test_creates_warp_defaults_when_proxy_runtime_missing(self) -> None:CODE
LOWtest/test_init_proxy_config.py41 def test_existing_custom_runtime_is_not_overwritten(self) -> None:CODE
LOWtest/test_init_proxy_config.py74 def test_env_can_disable_runtime_defaults_for_warp_compose(self) -> None:CODE
LOWtest/test_init_proxy_config.py95 def test_bind_mounted_config_file_falls_back_when_atomic_replace_is_busy(self) -> None:CODE
LOWtest/test_text_model_routing.py37 def test_explicit_model_selects_only_advertising_account_type(self) -> None:CODE
LOWtest/test_text_model_routing.py47 def test_auto_model_keeps_existing_unfiltered_rotation(self) -> None:CODE
LOWtest/test_text_model_routing.py60 def test_anonymous_model_uses_anonymous_backend(self) -> None:CODE
LOWtest/test_text_model_routing.py70 def test_model_without_eligible_account_fails_closed(self) -> None:CODE
LOWtest/test_text_model_routing.py80 def test_text_backend_passes_requested_model_to_account_selector(self) -> None:CODE
LOWtest/test_text_model_routing.py95 def test_chat_completions_passes_requested_model_to_text_backend(self) -> None:CODE
LOWtest/test_text_model_routing.py108 def test_responses_passes_requested_model_to_text_backend(self) -> None:CODE
LOWtest/test_text_model_routing.py118 def test_anthropic_messages_passes_requested_model_to_account_selector(self) -> None:CODE
LOWtest/test_text_model_routing.py135 def test_invalid_token_retry_keeps_requested_model_filter(self) -> None:CODE
270 more matches not shown…
Excessive Try-Catch Wrapping152 hits · 150 pts
SeverityFileLineSnippetContext
LOWtest/test_v1_images_edits.py113 except Exception:CODE
LOWtest/test_v1_messages.py40 except Exception:CODE
LOWtest/test_v1_messages.py79 except Exception:CODE
LOWtest/test_v1_chat_completions.py116 except Exception:CODE
LOWtest/test_v1_responses.py55 except Exception:CODE
LOWtest/test_v1_responses.py98 except Exception:CODE
LOWtest/test_v1_responses.py129 except Exception:CODE
LOWtest/test_v1_responses.py185 except Exception:CODE
LOWtest/test_v1_responses.py222 except Exception:CODE
LOWtest/test_v1_responses.py278 except Exception:CODE
LOWtest/test_v1_images_generations.py75 except Exception:CODE
LOWutils/turnstile.py53 except Exception:CODE
LOWutils/turnstile.py182 except Exception:CODE
LOWutils/log.py26 except Exception:CODE
LOWutils/image_tokens.py55 except Exception:CODE
LOWutils/image_tokens.py71 except Exception:CODE
LOWutils/image_tokens.py209 except Exception:CODE
LOWutils/image_tokens.py283 except Exception:CODE
LOWutils/helper.py59 except Exception as exc:CODE
LOWutils/helper.py183 except Exception:CODE
LOWutils/helper.py199 except Exception as exc:CODE
LOWutils/helper.py218 except Exception as exc:CODE
LOWutils/helper.py349 except Exception as exc:CODE
MEDIUMutils/helper.py212def anthropic_sse_stream(items) -> Iterator[str]:CODE
LOWutils/sentinel.py140 except Exception:CODE
LOWscripts/test_storage.py120 except Exception as e:CODE
LOWscripts/test_outlook_token_mailbox.py132 except Exception:CODE
LOWscripts/test_outlook_token_mailbox.py166 except Exception:CODE
LOWscripts/test_outlook_token_mailbox.py191 except Exception:CODE
LOWscripts/test_outlook_token_mailbox.py206 except Exception:CODE
LOWscripts/test_outlook_token_mailbox.py224 except Exception:CODE
LOWscripts/test_outlook_token_mailbox.py258 except Exception:CODE
LOWscripts/test_outlook_token_mailbox.py292 except Exception as error:CODE
LOWscripts/test_outlook_token_mailbox.py305 except Exception as error:CODE
LOWapi/support.py108 except Exception as exc:CODE
LOWapi/accounts.py263 except Exception as e:CODE
LOWapi/accounts.py291 except Exception as e:CODE
LOWapi/accounts.py501 except Exception as exc:CODE
LOWapi/accounts.py513 except Exception as exc:CODE
MEDIUMapi/accounts.py260def _do_refresh():CODE
MEDIUMapi/accounts.py288def _do_relogin():CODE
LOWapi/ai.py88 except Exception as exc:CODE
LOWapi/ai.py187 except Exception as exc:CODE
LOWapi/image_inputs.py274 except Exception as exc:CODE
LOWservices/openai_backend_api.py1663 except Exception:CODE
LOWservices/openai_backend_api.py226 except Exception:CODE
LOWservices/openai_backend_api.py621 except Exception:CODE
LOWservices/openai_backend_api.py729 except Exception as exc:CODE
LOWservices/openai_backend_api.py740 except Exception as exc:CODE
LOWservices/openai_backend_api.py857 except Exception:CODE
LOWservices/openai_backend_api.py1090 except Exception as exc:CODE
LOWservices/openai_backend_api.py1815 except Exception:CODE
LOWservices/openai_backend_api.py2223 except Exception as exc:CODE
LOWservices/openai_backend_api.py2424 except Exception as exc:CODE
LOWservices/openai_backend_api.py2455 except Exception as exc:CODE
LOWservices/openai_backend_api.py2534 except Exception as exc:CODE
LOWservices/openai_backend_api.py2595 except Exception:CODE
LOWservices/openai_backend_api.py2640 except Exception as exc:CODE
LOWservices/openai_backend_api.py2649 except Exception:CODE
LOWservices/auth_service.py66 except Exception:CODE
92 more matches not shown…
Unused Imports73 hits · 71 pts
SeverityFileLineSnippetContext
LOWmain.py1CODE
LOWtest/test_model_catalog_service.py1CODE
LOWtest/test_image_storage_service.py1CODE
LOWtest/test_image_tasks_api.py1CODE
LOWtest/test_account_image_capabilities.py1CODE
LOWtest/test_v1_models.py1CODE
LOWtest/test_proxy_runtime_api.py1CODE
LOWtest/test_gpt_ppt.py1CODE
LOWtest/test_multi_image_results.py1CODE
LOWtest/test_v1_images_edits.py1CODE
LOWtest/test_gpt_search.py1CODE
LOWtest/test_v1_messages.py1CODE
LOWtest/test_image.py1CODE
LOWtest/test_text_model_routing.py1CODE
LOWtest/test_image_task_service.py1CODE
LOWtest/test_v1_chat_completions.py1CODE
LOWtest/test_v1_images_edits_json.py1CODE
LOWtest/test_image_tokens.py1CODE
LOWtest/test_chat_completion_cache.py1CODE
LOWtest/test_v1_responses.py1CODE
LOWtest/test_v1_images_generations.py1CODE
LOWtest/test_v1_images_edits_api.py1CODE
LOWtest/test_gpt_psd.py1CODE
LOWutils/pkce.py2CODE
LOWutils/image_tokens.py1CODE
LOWutils/sentinel.py5CODE
LOWutils/sentinel.py15CODE
LOWscripts/test_outlook_token_mailbox.py1CODE
LOWscripts/verify_oauth_refresh.py13CODE
LOWscripts/init_proxy_config.py4CODE
LOWapi/system.py1CODE
LOWapi/support.py1CODE
LOWapi/accounts.py1CODE
LOWapi/ai.py1CODE
LOWapi/__init__.py1CODE
LOWapi/image_inputs.py1CODE
LOWapi/image_tasks.py1CODE
LOWapi/app.py1CODE
LOWapi/errors.py1CODE
LOWservices/auth_service.py1CODE
LOWservices/config.py1CODE
LOWservices/backup_service.py1CODE
LOWservices/backup_service.py18CODE
LOWservices/account_service.py1CODE
LOWservices/oauth_login_service.py13CODE
LOWservices/editable_file_task_service.py1CODE
LOWservices/model_service.py1CODE
LOWservices/log_service.py1CODE
LOWservices/proxy_service.py3CODE
LOWservices/content_filter.py1CODE
LOWservices/image_service.py1CODE
LOWservices/image_service.py6CODE
LOWservices/sub2api_service.py3CODE
LOWservices/image_task_service.py1CODE
LOWservices/image_tags_service.py1CODE
LOWservices/image_tags_service.py4CODE
LOWservices/cpa_service.py3CODE
LOWservices/image_storage_service.py1CODE
LOWservices/protocol/openai_search.py1CODE
LOWservices/protocol/conversation.py1CODE
13 more matches not shown…
Deep Nesting55 hits · 44 pts
SeverityFileLineSnippetContext
LOWtest/test_codex_4k.py21CODE
LOWutils/turnstile.py49CODE
LOWutils/turnstile.py106CODE
LOWutils/log.py67CODE
LOWutils/image_tokens.py267CODE
LOWutils/helper.py302CODE
LOWutils/helper.py397CODE
LOWscripts/test_storage.py21CODE
LOWapi/support.py82CODE
LOWapi/support.py85CODE
LOWservices/openai_backend_api.py438CODE
LOWservices/openai_backend_api.py718CODE
LOWservices/openai_backend_api.py1791CODE
LOWservices/openai_backend_api.py1985CODE
LOWservices/openai_backend_api.py2095CODE
LOWservices/openai_backend_api.py2128CODE
LOWservices/openai_backend_api.py2483CODE
LOWservices/auth_service.py225CODE
LOWservices/backup_service.py558CODE
LOWservices/account_service.py189CODE
LOWservices/account_service.py437CODE
LOWservices/account_service.py473CODE
LOWservices/account_service.py585CODE
LOWservices/account_service.py1301CODE
LOWservices/account_service.py1335CODE
LOWservices/account_service.py1483CODE
LOWservices/model_service.py111CODE
LOWservices/log_service.py116CODE
LOWservices/proxy_service.py171CODE
LOWservices/content_filter.py40CODE
LOWservices/content_filter.py52CODE
LOWservices/image_service.py194CODE
LOWservices/image_service.py278CODE
LOWservices/image_service.py320CODE
LOWservices/sub2api_service.py271CODE
LOWservices/sub2api_service.py333CODE
LOWservices/image_storage_service.py338CODE
LOWservices/protocol/conversation.py155CODE
LOWservices/protocol/conversation.py169CODE
LOWservices/protocol/conversation.py240CODE
LOWservices/protocol/conversation.py713CODE
LOWservices/protocol/conversation.py838CODE
LOWservices/protocol/conversation.py1290CODE
LOWservices/protocol/conversation.py1529CODE
LOWservices/protocol/conversation.py1620CODE
LOWservices/protocol/anthropic_v1_messages.py225CODE
LOWservices/protocol/openai_v1_response.py85CODE
LOWservices/protocol/web_search_tool.py48CODE
LOWservices/protocol/web_search_tool.py127CODE
LOWservices/protocol/openai_v1_chat_complete.py263CODE
LOWservices/protocol/error_response.py19CODE
LOWservices/storage/database_storage.py46CODE
LOWservices/storage/database_storage.py74CODE
LOWservices/storage/database_storage.py89CODE
LOWservices/storage/factory.py12CODE
Decorative Section Separators6 hits · 18 pts
SeverityFileLineSnippetContext
MEDIUMweb/src/lib/api.ts700// ── CPA (CLIProxyAPI) ──────────────────────────────────────────────COMMENT
MEDIUMweb/src/lib/api.ts770// ── Sub2API ────────────────────────────────────────────────────────COMMENT
MEDIUMweb/src/lib/api.ts866// ── Upstream proxy ────────────────────────────────────────────────COMMENT
MEDIUMutils/sentinel.py87# ── 默认 User-Agent 和 sec-ch-ua ──────────────────────────────COMMENT
MEDIUMservices/account_service.py607 # ─── 方式2: OAuth authorize 流程 ──────────────────────────COMMENT
MEDIUMservices/account_service.py735 # ─── 处理邮箱 OTP 验证 ──────────────────────────COMMENT
Modern Structural Boilerplate8 hits · 7 pts
SeverityFileLineSnippetContext
LOWservices/account_service.py1397 def update_refresh_progress(self, progress_id: str, token: str) -> None:CODE
LOWservices/account_service.py1446 def update_relogin_progress(self, progress_id: str, token: str, status: str, error: str | None = None) -> None:CODE
LOWservices/editable_file_task_service.py164 def _update_task(self, key: str, **updates: Any) -> None:CODE
LOWservices/proxy_service.py414 def _set_cached_bundle(self, key: tuple[str, str], bundle: ClearanceBundle) -> None:CODE
LOWservices/sub2api_service.py470 def _update_job(self, server_id: str, **updates) -> None:CODE
LOWservices/image_task_service.py349 def _update_task(self, key: str, **updates: Any) -> None:CODE
LOWservices/protocol/conversation.py592def update_conversation_state(state: ConversationState, payload: str, event: dict[str, Any] | None = None) -> None:CODE
LOWservices/storage/__init__.py5__all__ = ["create_storage_backend"]CODE
Docstring Block Structure1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHutils/sentinel.py104请求 sentinel token 并返回 (sentinel_header_value, oai_sc_cookie_value)。 Args: session: curl_cffi Session 实例 STRING
Over-Commented Block3 hits · 3 pts
SeverityFileLineSnippetContext
LOWdocker-compose.local.yml21 # DATABASE_URL: postgresql://user:password@host:5432/dbnameCOMMENT
LOWdocker-compose.yml21 # - GIT_TOKEN=ghp_xxxxxxxxxxxxCOMMENT
LOWtest/test_codex_4k.py1#!/usr/bin/env python3COMMENT
Fake / Example Data1 hit · 1 pts
SeverityFileLineSnippetContext
LOWweb/src/app/settings/components/sub2api-connections.tsx603 placeholder="admin@example.com"CODE
AI Structural Patterns1 hit · 1 pts
SeverityFileLineSnippetContext
LOWservices/backup_service.py236CODE