llm-api-purity-check 0.0.0-stage → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,27 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AIAPIPK (https://www.aiapipk.com) / yiios
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+ Third-Party Notice:
25
+ The bundled 1-355 numerical reference bank (`data/bank.generated.json`) and
26
+ Hellinger + Ordered-block statistical attribution method build on MIT-licensed
27
+ open-source work by xqy2006/ModelTrace and kiss-kedaya/chanshui.
package/README.md CHANGED
@@ -1,3 +1,162 @@
1
- # Temporary Holding Version
1
+ # llm-api-purity-check
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![npm version](https://img.shields.io/npm/v/llm-api-purity-check.svg)](https://www.npmjs.com/package/llm-api-purity-check)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
5
+ [![Node.js >= 18](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg)](https://nodejs.org)
6
+ [![Zero Dependencies](https://img.shields.io/badge/dependencies-0-success.svg)](package.json)
7
+
8
+ [中文文档 (README_CN.md)](./README_CN.md) | [Agent Skill (SKILL.md)](./skills/aiapipk-check/SKILL.md)
9
+
10
+ A **zero-dependency** CLI tool to audit third-party LLM API proxies, gateways, and relays **100% locally (zero API key upload)** for **hidden/conditional prompt injection (10s A/B/C single-char probe)**, **model substitution (38-model 1–355 numerical fingerprinting)**, **silent downgrade**, **fake or broken Prompt Caching**, **instruction/tools tampering**, **Anthropic Thinking cryptographic signature forgery**, **multimodal image stripping**, **fake streaming**, and **output token billing inflation** (with thinking/reasoning-model exemption).
11
+
12
+ > **Don't want to run scripts locally?**
13
+ > Use the free, zero-storage online web verifier (38-model reference bank + 10s A/B/C conditional injection probe + Pelican/Zebra SVG visual downgrade comparison + official local Tokenizer recount) and explore the live benchmark of **370+ AI API providers** at **AIAPIPK**:
14
+ > - Online Model & Cache Verifier: **https://www.aiapipk.com/detect/?from=github**
15
+ > - Live Probe Arena & Pricing Radar: **https://www.aiapipk.com/?from=github**
16
+
17
+ ---
18
+
19
+ ## Why This Exists
20
+
21
+ When running Coding Agents (Claude Code, Codex CLI, Cursor, Antigravity, Cline) or production workloads through third-party LLM API relays, headline pricing (`$1 = ¥1`) often hides much larger real costs:
22
+
23
+ 1. **Silent Prompt Caching Failure**: In automated 4-turn probe audits tracked by [AIAPIPK](https://www.aiapipk.com/), **65% (13/20)** of tested third-party relay endpoints returned **`0%` real Prompt Caching hit rate** on identical 2.5K+ token prefixes—quietly multiplying real Coding Agent bills by 5x–10x.
24
+ 2. **Model Substitution / Downgrade**: Routing flagship requests (e.g. Claude Opus/Sonnet, GPT-5/6, DeepSeek, Gemini, Qwen, Kimi, GLM) to cheaper or quantized models behind the scenes.
25
+ 3. **Instruction & Tools Tampering**: Silently injecting system instructions or extra tool definitions on `/v1/responses` endpoints (observed live on active relays).
26
+ 4. **Fake Streaming, Forged Thinking Signatures & Output Token Inflation**: Buffering completions into a single SSE burst, stripping/forging Anthropic thinking signatures, stripping image attachments, or inflating `completion_tokens` beyond real output.
27
+
28
+ `llm-api-purity-check` has **zero npm dependencies**—you can audit the entire codebase in minutes before running it locally with a temporary test API key.
29
+
30
+ ---
31
+
32
+ ## Features
33
+
34
+ | Check | Flag | What It Verifies |
35
+ | :--- | :--- | :--- |
36
+ | **10s A/B/C Prompt-Injection Probe** | `inject` | Sends 3 ultra-cheap single-char (`"a"`, `max_tokens=8`) probes — bare vs. tiny system + Coding Agent `User-Agent` vs. +1 minimal neutral business tool — to classify `zero`, `micro_injection`, `conditional_injection`, and `heavy_injection`, accounting for Anthropic's native ~300-token tool preamble. |
37
+ | **Streaming, 16-Channel Signature & Billing Audit** | `stream` | Measures real SSE TTFT & TPS, detects fake-streaming bursts, classifies **16 upstream channels** from 35+ safe whitelisted headers with zero extra calls (Cloudflare AI Gateway / OpenRouter / LiteLLM / New-API / One-API / AWS Bedrock / Google Vertex AI / Azure OpenAI / Anthropic / OpenAI / DeepSeek / DashScope / Volcengine Ark / Groq / Together AI / SiliconFlow — info only, never penalizes `unknown`), diffs `/v1/responses` echoed `instructions` & `tools`, and flags gross output token inflation with **server-consistent thinking/reasoning exemption** (`reasoning_tokens`, `reasoning_content`, Anthropic `thinking_delta` + `signature_delta`). |
38
+ | **Two-Round Real Prompt Caching** | `cache` | Sends an identical randomized-domain 2.5K+ token TypeScript codebase prefix twice (with `cache_control: ephemeral` on Anthropic `/v1/messages`) and verifies real `cached_tokens` / `cache_read_input_tokens` / `prompt_cache_hit_tokens` hit rate and Round-2 TTFT drop. |
39
+ | **Anti-Downgrade Dynamic Logic Puzzle** | `logic` | Generates randomized two-shape pigeonhole problems (anti-memorization) with an exact optimal answer vs. a classic skip-step trap answer that weaker/downgraded models frequently fall into. |
40
+ | **38-Model 1–355 Numerical Fingerprinting** | `fingerprint` | Samples 3 rounds of ~300 unconstrained integers (1..355) and runs symmetric Hellinger + nuisance-projected Ordered-block attribution (`w=0.4`, `beta=5.0`) with unified relay ID normalization (`us.anthropic.`, `-v1:0`, `:thinking`, `[官转]`), degenerate-sequence rejection, 4 sibling clusters, and strict OOD fit gating against the bundled **38-model 7-family** offline bank (GPT, Claude, DeepSeek, Gemini, Qwen, Kimi, GLM). |
41
+ | **Anthropic Thinking Signature Roundtrip** *(optional)* | `--verify-signature` | Reuses Turn-1 `thinking + signature` (or runs 1 minimal extended-thinking turn) and sends 2 tiny `max_tokens=16` follow-ups (intact vs. 1-char tampered signature). Verifies real cryptographic validation (`verified`), flags forged/ignored signatures (`tampered_accepted`), and gracefully skips (`skipped`) with zero penalty when no signature is returned. |
42
+ | **4-Color 64×64 Solid PNG Multimodal Probe** *(optional)* | `--multimodal` | Dynamically generates a valid 64×64 solid RGB PNG (red/blue/green/yellow) using built-in `zlib.deflateSync` (zero deps) and verifies real vision pass-through across `openai-chat`, `openai-responses`, and `anthropic`. |
43
+
44
+ Supports **OpenAI Chat (`/v1/chat/completions`, with modern `max_completion_tokens` & automatic HTTP 400 parameter downgrade retry that preserves `stream_options`)**, **OpenAI Responses (`/v1/responses`)**, and **Anthropic Messages (`/v1/messages`)**, plus structured preflight error classification (`auth_error`, `model_not_found`, `quota_exhausted`, `rate_limited`, `waf_blocked`) and automatic secret redaction in error messages.
45
+
46
+ ---
47
+
48
+ ## Quick Start
49
+
50
+ Requires **Node.js >= 18** (zero dependencies — run directly via `npx` or clone the source to audit first).
51
+
52
+ ```bash
53
+ # Zero-install run via npx (all 5 core checks, protocol auto-inferred from model name)
54
+ npx llm-api-purity-check \
55
+ --base-url https://api.example.com \
56
+ --api-key sk-your-temp-test-key \
57
+ --model claude-sonnet-4-5
58
+
59
+ # 10-second quick check: A/B/C single-char prompt-injection probe + streaming/channel check
60
+ npx llm-api-purity-check \
61
+ --base-url https://api.example.com \
62
+ --api-key sk-your-temp-test-key \
63
+ --model claude-sonnet-4-5 \
64
+ --checks inject,stream
65
+
66
+ # Full Claude deep check + cryptographic Thinking signature roundtrip + 4-color PNG multimodal check
67
+ npx llm-api-purity-check \
68
+ --base-url https://api.example.com \
69
+ --api-key sk-your-temp-test-key \
70
+ --model claude-opus-4-6 \
71
+ --verify-signature \
72
+ --multimodal
73
+
74
+ # Audit an OpenAI /v1/responses endpoint for injection + caching + instruction tampering + vision
75
+ npx llm-api-purity-check \
76
+ --base-url https://api.example.com \
77
+ --api-key sk-your-temp-test-key \
78
+ --model gpt-5 \
79
+ --protocol openai-responses \
80
+ --checks inject,cache,stream \
81
+ --multimodal
82
+
83
+ # Machine-readable JSON output (great for CI / Coding Agents)
84
+ LLM_API_KEY="sk-your-temp-test-key" npx llm-api-purity-check \
85
+ --base-url https://api.example.com \
86
+ --model deepseek-chat \
87
+ --json
88
+
89
+ # List all 38 reference models bundled in the offline fingerprint bank
90
+ npx llm-api-purity-check --list-models
91
+ ```
92
+
93
+ Prefer inspecting every line locally before running?
94
+
95
+ ```bash
96
+ git clone https://github.com/yiios/llm-api-purity-check.git
97
+ cd llm-api-purity-check
98
+ node bin/cli.mjs --base-url https://api.example.com --api-key sk-your-temp-test-key --model claude-sonnet-4-5
99
+ ```
100
+
101
+ You can also pass credentials via environment variables (`LLM_API_KEY`, `OPENAI_API_KEY`, or `ANTHROPIC_API_KEY`) instead of `--api-key`.
102
+
103
+ ---
104
+
105
+ ## One-Click Local Agent Skill (Zero Key Upload)
106
+
107
+ Let **Claude Code**, **Cursor**, **Codex CLI**, or **Antigravity** audit your current relay configuration directly on your own machine via `npx llm-api-purity-check`—**your API key never leaves your machine and is never echoed in plain text**.
108
+
109
+ Install [`skills/aiapipk-check/SKILL.md`](./skills/aiapipk-check/SKILL.md) into your agent's skill directory:
110
+
111
+ ```bash
112
+ # Antigravity (~/.agents/skills)
113
+ mkdir -p ~/.agents/skills/aiapipk-check && curl -fsSL https://raw.githubusercontent.com/yiios/llm-api-purity-check/main/skills/aiapipk-check/SKILL.md -o ~/.agents/skills/aiapipk-check/SKILL.md
114
+
115
+ # Claude Code (~/.claude/skills)
116
+ mkdir -p ~/.claude/skills/aiapipk-check && curl -fsSL https://raw.githubusercontent.com/yiios/llm-api-purity-check/main/skills/aiapipk-check/SKILL.md -o ~/.claude/skills/aiapipk-check/SKILL.md
117
+
118
+ # Cursor (~/.cursor/skills)
119
+ mkdir -p ~/.cursor/skills/aiapipk-check && curl -fsSL https://raw.githubusercontent.com/yiios/llm-api-purity-check/main/skills/aiapipk-check/SKILL.md -o ~/.cursor/skills/aiapipk-check/SKILL.md
120
+
121
+ # Codex CLI (~/.codex/skills)
122
+ mkdir -p ~/.codex/skills/aiapipk-check && curl -fsSL https://raw.githubusercontent.com/yiios/llm-api-purity-check/main/skills/aiapipk-check/SKILL.md -o ~/.codex/skills/aiapipk-check/SKILL.md
123
+ ```
124
+
125
+ Then simply ask your agent: *"Check whether my current API relay is clean / has prompt injection or model swap."*
126
+
127
+ ---
128
+
129
+ ## Running Unit Tests
130
+
131
+ ```bash
132
+ npm test
133
+ ```
134
+
135
+ All tests use Node's built-in `node:test` runner and require zero network calls.
136
+
137
+ ---
138
+
139
+ ## CLI vs. AIAPIPK Online Verifier
140
+
141
+ | Capability | `llm-api-purity-check` (CLI) | [AIAPIPK Online (`/detect/`)](https://www.aiapipk.com/detect/) |
142
+ | :--- | :---: | :---: |
143
+ | Runs 100% locally, zero dependencies, zero key upload | ✅ | Web (in-memory, zero storage) |
144
+ | 10s A/B/C conditional prompt-injection probe | ✅ | ✅ |
145
+ | 1–355 numerical model fingerprinting | ✅ (38-model 7-family bundled bank) | ✅ (38-model live bank) |
146
+ | 16-channel upstream signature detection | ✅ | ✅ |
147
+ | Anthropic Thinking cryptographic signature roundtrip | ✅ (`--verify-signature`) | ✅ |
148
+ | 4-color 64×64 solid PNG multimodal probe | ✅ (`--multimodal`) | ✅ |
149
+ | Two-round real Prompt Caching test | ✅ | ✅ |
150
+ | Randomized pigeonhole anti-downgrade test | ✅ | ✅ |
151
+ | `/v1/responses` instruction & tools tamper diff | ✅ | ✅ |
152
+ | Pelican / Zebra SVG visual downgrade side-by-side | — | ✅ |
153
+ | Official BPE / Tiktoken exact output recount | Conservative upper-bound + thinking exemption | ✅ Exact Tokenizer |
154
+ | Continuous 370+ provider liveness & 3h pricing radar | — | ✅ [aiapipk.com](https://www.aiapipk.com/) |
155
+
156
+ ---
157
+
158
+ ## Credits & License
159
+
160
+ - Built and maintained by **[AIAPIPK](https://www.aiapipk.com/)**.
161
+ - The 1–355 numerical fingerprinting methodology and bundled reference bank build on MIT-licensed research by [xqy2006/ModelTrace](https://github.com/xqy2006/ModelTrace) and [kiss-kedaya/chanshui](https://github.com/kiss-kedaya/chanshui).
162
+ - Released under the [MIT License](./LICENSE).
package/README_CN.md ADDED
@@ -0,0 +1,122 @@
1
+ # llm-api-purity-check(AI API 代理验真与防降智命令行工具)
2
+
3
+ [English README](./README.md) | [Coding Agent 零传 Key 技能 (SKILL.md)](./skills/aiapipk-check/SKILL.md)
4
+
5
+ 一个**零第三方依赖**(仅需 Node.js >= 18)、**API Key 零上传本机直测**的开源命令行工具,用来现场检测第三方 AI API 中转站/代理渠道是否存在 **暗中提示词注入 / 条件注入(A/B/C 单字探针)**、**模型换壳掉包(38 模型 1–355 数字指纹)**、**静默降智**、**假缓存 / 掉缓存**、**暗中篡改指令或 Tools**、**伪造 Anthropic Thinking 思考签名**、**阉割图片多模态**、**假流式** 与 **输出 Token 虚报计费**(内置思考模型豁免,绝不误杀诚实思考模型)。
6
+
7
+ > **不想在本地跑脚本?**
8
+ > 可以直接使用免费、零落盘的在线检测版(完整 38 模型数字指纹库 + 10 秒 A/B/C 条件注入探针 + 鹈鹕骑自行车/斑马奔跑 SVG 实画降智对照 + 本地官方 Tokenizer 精确复算)并查看 370+ 家中转站实时监控榜单与每 3 小时价目异动雷达:
9
+ > - 在线模型验真工具:**https://www.aiapipk.com/detect/?from=github**
10
+ > - 实时探针竞技场与全量目录:**https://www.aiapipk.com/?from=github**
11
+
12
+ ---
13
+
14
+ ## 为什么做这个工具?
15
+
16
+ 在 [AIAPIPK](https://www.aiapipk.com/) 持续对 370+ 家 AI API 中转站的自动化巡检与深度探针实测中,我们发现比“表面充值汇率”更隐蔽的成本黑洞包括:
17
+
18
+ 1. **Prompt Caching 掉缓**:在已完成的 4 轮深度审计中,高达 **65%(13/20)** 的第三方渠道在两轮完全相同的 2.5K+ 前缀上下文下实测缓存命中率为 **0%**——对重度依赖缓存的 Claude Code / Codex 用户来说,真实花费会被放大 5~10 倍。
19
+ 2. **暗中篡改上下文**:在 `/v1/responses` 回显对比中,实测捕获到渠道存在强塞系统指令(`instructions_injected`)和偷加工具定义(`tools_injected`)的现象。
20
+ 3. **模型换壳、假签名与降智**:用低成本或量化模型冒充旗舰型号、伪造或剥离 Anthropic Thinking 加密签名、静默丢弃图片多模态,或通过假流式掩盖延迟。
21
+
22
+ 本工具坚持 **0 外部 npm 依赖**,代码全部透明可读,方便你在使用临时测试 Key 前自己审计每一行代码。
23
+
24
+ ---
25
+
26
+ ## 七大检测模块
27
+
28
+ 1. **10 秒 A/B/C 单字提示词注入探针(`inject`)**:连续发出「裸单字 `"a"`」→「单字 `"a"` + 极简 3 词 `system` + 模拟 Coding Agent `User-Agent`」→「再加 1 个中性业务最小函数工具」三组超低耗请求(`max_tokens=8`),对比 `input_tokens` 增量并结合 `/v1/responses` 回显 Diff,精准区分 `0 注入`、`微注入`、`条件注入` 与 `重度全局注入`,且内置 Anthropic 官方工具约 300 Token 系统开销补偿,避免直连误报。
29
+ 2. **流式速度、16 渠道指纹识别与思考模型计费豁免(`stream`)**:实测真实 SSE TTFT 与 TPS,排查假流式与 `/v1/responses` 指令/Tools 篡改;从 35+ 安全白名单响应头零额外请求识别 **16 类常见上游渠道**(Cloudflare AI Gateway / OpenRouter / LiteLLM / New-API / One-API / AWS Bedrock / Google Vertex AI / Azure OpenAI / Anthropic 官方 / OpenAI 官方 / DeepSeek 官方 / 阿里云百炼 DashScope / 火山方舟 Ark / Groq / Together AI / SiliconFlow,纯信息佐证,`unknown` 绝不扣分);支持提取 `reasoning_content`、`thinking_delta`、`signature_delta`、`reasoning_tokens`,对思考模型执行与服务端一致的输出倍率豁免(剔除已上报 `reasoning_tokens` 重算,未拆分但存在 thinking 内容/签名时 `< 8.0x` 豁免),彻底杜绝诚实思考模型误判虚报。
30
+ 3. **双轮真缓存命中实测(`cache`)**:从 4 套真实业务域动态生成两轮完全一致的 2.5K+ Token TypeScript 代码前缀(Anthropic 自动携带 `cache_control: ephemeral`),验证真实 `cache_read_input_tokens` / `cached_tokens` / `prompt_cache_hit_tokens` 命中率与第二轮 TTFT 降幅。
31
+ 4. **动态防背题逻辑推理(`logic`)**:实时随机生成双形态抽屉原理参数题,精准区分“最优策略解”与弱模型最容易掉入的“跳步陷阱解”。
32
+ 5. **38 模型 1–355 数字分布指纹归因(`fingerprint`)**:连续采样 3 轮约 300 个 1..355 自由整数序列,自动剥离 `us.anthropic.`、`-v1:0`、`:thinking`、`[官转]` 等常见中转前后缀,使用对称 Hellinger + 干扰投影 Ordered-block(`w=0.4`、`beta=5.0`)、退化序列预检、4 组同家族近亲簇与未入库四重绝对拟合门控,离线比对内置 **7 大家族 38 款参考模型库**(GPT、Claude、DeepSeek、Gemini、Qwen、Kimi、GLM)。
33
+ 6. **Anthropic Thinking 签名加密往返验真(可选 `--verify-signature`)**:仅对 `anthropic` 协议生效。复用或采集 1 轮 `thinking + signature` 块后,追加 2 次极短续写(原样 vs 篡改 1 字符):原样放行且篡改被拒判 `verified`(加密验真通过),篡改 1 字符仍返回 200 判 `tampered_accepted`(高危伪造/忽略签名),无签名自动 `skipped` 绝不误杀。
34
+ 7. **4 色轮换 64×64 纯色 PNG 多模态辨色(可选 `--multimodal`)**:用 Node 内置 `zlib.deflateSync` 零依赖动态生成 64×64 红/蓝/绿/黄纯色 PNG,支持 `openai-chat`、`openai-responses` 与 `anthropic` 三协议,实测视觉输入是否真正透传。
35
+
36
+ 同时支持 **OpenAI Chat(`/v1/chat/completions`,原生支持 GPT-5/6/o1/o3/o4 `max_completion_tokens` 与 HTTP 400 参数自动兼容重试且按需保留 `stream_options`)**、**OpenAI Responses(`/v1/responses`)** 和 **Anthropic Messages(`/v1/messages`)** 三种协议,并对 401/404/402/429/WAF 等前置异常做结构化错误分型与错误体密钥自动脱敏。
37
+
38
+ ---
39
+
40
+ ## 快速上手
41
+
42
+ 需要 **Node.js >= 18**(零第三方依赖,支持 `npx` 一行直跑,也可克隆源码逐行审计后运行):
43
+
44
+ ```bash
45
+ # 免安装一行直跑全套 5 项核心检测(自动归一化中转前缀并推断协议)
46
+ npx llm-api-purity-check \
47
+ --base-url https://api.example.com \
48
+ --api-key sk-your-temp-test-key \
49
+ --model claude-sonnet-4-5
50
+
51
+ # 10 秒快检:只跑 A/B/C 单字提示词注入探针 + 流式/渠道检查(花不到一厘钱)
52
+ npx llm-api-purity-check \
53
+ --base-url https://api.example.com \
54
+ --api-key sk-your-temp-test-key \
55
+ --model claude-sonnet-4-5 \
56
+ --checks inject,stream
57
+
58
+ # Claude 深度验真 + Thinking 签名加密往返 + 64x64 多模态辨色
59
+ npx llm-api-purity-check \
60
+ --base-url https://api.example.com \
61
+ --api-key sk-your-temp-test-key \
62
+ --model claude-opus-4-6 \
63
+ --verify-signature \
64
+ --multimodal
65
+
66
+ # 仅检测 OpenAI /v1/responses 的注入、真缓存、指令篡改与多模态
67
+ npx llm-api-purity-check \
68
+ --base-url https://api.example.com \
69
+ --api-key sk-your-temp-test-key \
70
+ --model gpt-5 \
71
+ --protocol openai-responses \
72
+ --checks inject,cache,stream \
73
+ --multimodal
74
+
75
+ # 通过环境变量传 Key 并输出 JSON 报告(适合 CI / Coding Agent 自动化巡检)
76
+ LLM_API_KEY="sk-your-temp-test-key" npx llm-api-purity-check \
77
+ --base-url https://api.example.com \
78
+ --model deepseek-chat \
79
+ --json
80
+
81
+ # 查看内置离线指纹库覆盖的 38 款参考模型
82
+ npx llm-api-purity-check --list-models
83
+ ```
84
+
85
+ ---
86
+
87
+ ## 一键安装到本地 Coding Agent(零传 Key 技能)
88
+
89
+ 将本仓库内置的 [`skills/aiapipk-check/SKILL.md`](./skills/aiapipk-check/SKILL.md) 放入你的 Agent Skills 目录,即可直接在对话里说“帮我测一下当前 API 中转站有没有掺水/注入”,Agent 会在你的本机直接调用 `npx llm-api-purity-check`——**全程 API Key 零上传、不回显明文**:
90
+
91
+ ```bash
92
+ # Antigravity
93
+ mkdir -p ~/.agents/skills/aiapipk-check && curl -fsSL https://raw.githubusercontent.com/yiios/llm-api-purity-check/main/skills/aiapipk-check/SKILL.md -o ~/.agents/skills/aiapipk-check/SKILL.md
94
+
95
+ # Claude Code
96
+ mkdir -p ~/.claude/skills/aiapipk-check && curl -fsSL https://raw.githubusercontent.com/yiios/llm-api-purity-check/main/skills/aiapipk-check/SKILL.md -o ~/.claude/skills/aiapipk-check/SKILL.md
97
+
98
+ # Cursor
99
+ mkdir -p ~/.cursor/skills/aiapipk-check && curl -fsSL https://raw.githubusercontent.com/yiios/llm-api-purity-check/main/skills/aiapipk-check/SKILL.md -o ~/.cursor/skills/aiapipk-check/SKILL.md
100
+
101
+ # Codex CLI
102
+ mkdir -p ~/.codex/skills/aiapipk-check && curl -fsSL https://raw.githubusercontent.com/yiios/llm-api-purity-check/main/skills/aiapipk-check/SKILL.md -o ~/.codex/skills/aiapipk-check/SKILL.md
103
+ ```
104
+
105
+ 如果想先拉取源码逐行审计后再运行:
106
+
107
+ ```bash
108
+ git clone https://github.com/yiios/llm-api-purity-check.git
109
+ cd llm-api-purity-check
110
+ node bin/cli.mjs --base-url https://api.example.com --api-key sk-your-temp-test-key --model claude-sonnet-4-5
111
+ npm test # 运行本地单元测试(无需联网与 Key)
112
+ ```
113
+
114
+ > 安全提示:建议始终使用低限额、可随时吊销的临时测试 Key,并优先通过环境变量 `LLM_API_KEY` 传入。
115
+
116
+ ---
117
+
118
+ ## 致谢与协议
119
+
120
+ - 由 **[AIAPIPK](https://www.aiapipk.com/)** 提取维护。
121
+ - 1–355 数字指纹算法与基础参考库基于 MIT 开源项目 [xqy2006/ModelTrace](https://github.com/xqy2006/ModelTrace) 与 [kiss-kedaya/chanshui](https://github.com/kiss-kedaya/chanshui)。
122
+ - 本项目采用 [MIT License](./LICENSE) 开源。