{"id":31068439,"url":"https://github.com/cooksleep/newapi-special-test","last_synced_at":"2026-02-27T17:47:40.106Z","repository":{"id":314590652,"uuid":"1056077358","full_name":"CookSleep/newapi-special-test","owner":"CookSleep","description":"纯前端的 New API 调用测试页面，用来测试 OpenAI/Claude/Gemini 的一些特殊调用方式。所有数据仅在浏览器本地处理与保存。","archived":false,"fork":false,"pushed_at":"2025-09-13T12:23:38.000Z","size":598,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-13T13:43:50.445Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://cooksleep.github.io/newapi-special-test/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CookSleep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-13T10:42:55.000Z","updated_at":"2025-09-13T12:23:42.000Z","dependencies_parsed_at":"2025-09-13T13:43:53.140Z","dependency_job_id":"4a2a844f-f57b-4038-b8ff-d119f506edd9","html_url":"https://github.com/CookSleep/newapi-special-test","commit_stats":null,"previous_names":["cooksleep/newapi-special-test"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/CookSleep/newapi-special-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CookSleep%2Fnewapi-special-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CookSleep%2Fnewapi-special-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CookSleep%2Fnewapi-special-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CookSleep%2Fnewapi-special-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CookSleep","download_url":"https://codeload.github.com/CookSleep/newapi-special-test/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CookSleep%2Fnewapi-special-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275322513,"owners_count":25444331,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-15T02:00:09.272Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-15T21:22:35.034Z","updated_at":"2026-02-27T17:47:40.089Z","avatar_url":"https://github.com/CookSleep.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eNew API 特殊调用测试\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e纯前端的 \u003ca href=\"https://github.com/QuantumNous/new-api\"\u003eNew API\u003c/a\u003e 调用测试页面，用来测试 OpenAI/Anthropic/Google 的一些特殊调用方式。所有数据仅在浏览器本地处理与保存。\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"example.png\" alt=\"使用示例\" /\u003e\n\u003c/div\u003e\n\n## 功能特性\n\n- **纯前端与本地存储：**\n  - 所有配置保存在浏览器 LocalStorage 中\n  - 不上传数据到第三方服务器，安全可控\n- **多厂商与多场景测试：**\n  - **OpenAI:** 工具调用（Chat Completions/Responses）、搜索（Responses）\n  - **Anthropic:** 工具调用\n  - **Google Gemini:** 工具调用、搜索、URL 上下文\n- **配置管理与一键默认：**\n  - 通过“管理配置”弹窗新增/编辑/删除配置\n  - 支持星标“默认配置”，页面加载自动应用\n  - **安全性：** 支持 API Key 显隐切换，配置仅保存在本地 LocalStorage\n- **交互与可视化：**\n  - 分厂商切换测试类型，自动填充默认测试输入\n  - 左侧“轮次与消息”时间线，右侧“请求与响应”代码块\n  - 支持一键复制请求/响应内容\n- **健壮的错误处理：**\n  - 自动识别并提示错误的 API URL（如返回 HTML）\n  - 支持非 JSON 响应的原始预览\n  - 实时显示请求状态与耗时统计\n\n## 如何使用\n\n1. **直接打开页面：**\n   - 用浏览器打开 https://cooksleep.github.io/newapi-special-test\n2. **填写 API 信息：**\n   - 在“API 配置”中填写 `API URL`、`API Key`、`模型`，或点击“管理配置”从右侧列表选择并应用。\n3. **选择测试类型：**\n   - 首先在“测试内容”中选择厂商（OpenAI / Anthropic / Google）。\n   - 然后选择具体的测试场景（如工具调用、搜索等）。页面会自动填充推荐的测试消息。\n4. **输入用户消息并发送：**\n   - 在文本框输入用户消息，点击“发送测试请求”。\n5. **查看结果：**\n   - 左侧查看“轮次与消息”，右侧查看“请求与响应”。每个代码块都支持复制。\n\n\u003e 小贴士：该页面为纯前端网页，所有信息仅存储在您的浏览器本地。\n\n## 修改默认系统配置\n\n如需预置默认的 API URL、API Key、模型，可编辑 `assets/js/config.js` 中的 `window.APP_CONFIG`（部署到静态服务器时也可以按需修改）：\n\n```js\nwindow.APP_CONFIG = {\n  apiUrl: 'https://api.openai.com',\n  apiKey: '',\n  model: 'gemini-3-flash-preview'\n};\n```\n\n- 该文件在页面加载时先于主脚本注入，主脚本会读取 `window.APP_CONFIG` 作为系统默认。\n- 不建议在公共仓库提交真实的 API Key，可保持为空，使用时手动填写或通过“管理配置”保存到本地。\n\n## 部署\n\n- 本项目为静态页面，可直接托管至任意静态托管平台（GitHub Pages、Netlify、Vercel、Nginx 等）。\n- 如需覆盖默认配置，直接修改 `assets/js/config.js` 并重新部署即可。\n\n## 贡献\n\n欢迎对项目进行改进！如果你有新的想法或想要完善交互，请提交 Issue 或 Pull Request。\n\n## 许可证\n\n本项目采用 [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.html) 许可证，详情请见 [LICENSE](LICENSE) 文件。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcooksleep%2Fnewapi-special-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcooksleep%2Fnewapi-special-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcooksleep%2Fnewapi-special-test/lists"}