{"_id":"@bunnyscholar/sdk","name":"@bunnyscholar/sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@bunnyscholar/sdk","version":"0.1.0","description":"BunnyScholar 开放平台官方 Node.js SDK —— 学术改写（降重）与拟人改写（降 AI / Humanizer）API。","keywords":["bunnyscholar","论文降重","降AI","humanizer","ai-humanizer","academic-rewrite","paraphrase","ai-detection","turnitin","cnki"],"homepage":"https://bunnyscholar.cn/developer","bugs":{"url":"https://github.com/bunnyscholar/bunnyscholar-sdk/issues"},"repository":{"type":"git","url":"git+https://github.com/bunnyscholar/bunnyscholar-sdk.git","directory":"node"},"license":"MIT","author":{"name":"BunnyScholar","email":"support@bunnyscholar.com","url":"https://bunnyscholar.cn"},"publishConfig":{"access":"public"},"type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"engines":{"node":">=18"},"scripts":{"build":"tsc -p tsconfig.json","prepublishOnly":"npm run build"},"devDependencies":{"typescript":"^5.4.0"},"gitHead":"ac0d12f51627d44c9cd9167f5416e976f815ad21","_id":"@bunnyscholar/sdk@0.1.0","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-02+AkESKb/9zeChD4Z0f6TwGKqp3GO32ORcb72v/Acu4jEZWl7WL0OgOiHOR5mbzasyHhzkzxfDOyot/DCqSkA==","shasum":"3210004e3c7e14204b8d2c2dfdec55b88cc22713","tarball":"https://registry.npmjs.org/@bunnyscholar/sdk/-/sdk-0.1.0.tgz","fileCount":5,"unpackedSize":14268,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIChwiQnd603K2GPNA/Yf13OuFWwUDnWZiufYnLGVLnEiAiBmNYM2wNXSl+mRe6JO6AbX/2CvmOgxhvt0te695dxD9A=="}]},"_npmUser":{"name":"bunnyscholar","email":"bunnyscholar@gmail.com"},"directories":{},"maintainers":[{"name":"bunnyscholar","email":"bunnyscholar@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.1.0_1784692983399_0.5118057414954942"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-22T04:03:03.221Z","0.1.0":"2026-07-22T04:03:03.543Z","modified":"2026-07-22T04:03:03.785Z"},"maintainers":[{"name":"bunnyscholar","email":"bunnyscholar@gmail.com"}],"description":"BunnyScholar 开放平台官方 Node.js SDK —— 学术改写（降重）与拟人改写（降 AI / Humanizer）API。","homepage":"https://bunnyscholar.cn/developer","keywords":["bunnyscholar","论文降重","降AI","humanizer","ai-humanizer","academic-rewrite","paraphrase","ai-detection","turnitin","cnki"],"repository":{"type":"git","url":"git+https://github.com/bunnyscholar/bunnyscholar-sdk.git","directory":"node"},"author":{"name":"BunnyScholar","email":"support@bunnyscholar.com","url":"https://bunnyscholar.cn"},"bugs":{"url":"https://github.com/bunnyscholar/bunnyscholar-sdk/issues"},"license":"MIT","readme":"<a name=\"top\"></a>\n\n# @bunnyscholar/sdk\n\n**简体中文 | [English](#english)**\n\n[![npm](https://img.shields.io/npm/v/@bunnyscholar/sdk.svg)](https://www.npmjs.com/package/@bunnyscholar/sdk)\n[![License](https://img.shields.io/badge/License-MIT-16a34a)](./LICENSE)\n\n[**BunnyScholar 开放平台**](https://bunnyscholar.cn/developer) 官方 Node.js SDK。用几行代码接入 **学术改写（降重）** 与 **拟人改写（降 AI / Humanizer）** 能力。零运行时依赖，基于原生 `fetch`（Node 18+）。\n\n🔗 [官网](https://bunnyscholar.cn) · [开发者控制台](https://bunnyscholar.cn/developer) · [API 文档](https://bunnyscholar.cn/developer/docs) · [获取 API Key](https://bunnyscholar.cn/developer/keys) · [定价](https://bunnyscholar.cn/developer/pricing) · [Agent Skill](https://github.com/bunnyscholar/bunnyscholar-api-skill)\n\n> **个人用户**（想直接给自己的论文降重 / 降 AI，不写代码）请移步官网在线使用 → [**bunnyscholar.cn**](https://bunnyscholar.cn) · [会员套餐](https://bunnyscholar.cn/setmeal)。本 SDK 面向开发者。\n\n## 安装\n\n```bash\nnpm install @bunnyscholar/sdk\n```\n\n## 快速开始\n\n```ts\nimport { BunnyScholar } from \"@bunnyscholar/sdk\";\n\nconst client = new BunnyScholar({ apiKey: process.env.BUNNYSCHOLAR_API_KEY! });\n\n// 学术改写 / 降重\nconst rewrite = await client.academicRewrite({\n  text: \"本研究旨在探讨人工智能在学术写作中的应用与影响。\",\n  language: \"zh_CN\",\n  quality: \"medium\", // low | medium | high\n});\nconsole.log(rewrite.text);        // 改写后的文本\nconsole.log(rewrite.usage.amount); // 本次扣费（元）\n\n// 拟人改写 / 降 AI\nconst humanized = await client.humanize({\n  text: \"这段文字由 AI 生成，需要降低 AI 味以通过检测。\",\n  language: \"zh_CN\",\n  platform: \"cnki\", // cnki | wanfang | weipu | gezida | daya | turnitin ...\n});\nconsole.log(humanized.text);\n```\n\n## API\n\n### `new BunnyScholar(options)`\n\n| 选项 | 类型 | 默认 | 说明 |\n| --- | --- | --- | --- |\n| `apiKey` | `string` | —（必填）| API Key，形如 `sk-xxxx`，[在控制台创建](https://bunnyscholar.cn/developer/keys) |\n| `baseUrl` | `string` | `https://bunnyscholar.cn` | 服务基址 |\n| `timeoutMs` | `number` | `60000` | 请求超时 |\n| `fetch` | `typeof fetch` | 全局 `fetch` | 自定义 fetch 实现 |\n\n### `client.academicRewrite(params)`\n\n[学术改写 / 降重](https://bunnyscholar.cn/developer/docs)。`text` 长度 10–2000 字符；`language` 支持 `zh_CN` `zh_TW` `en` `ja` `ko` `fr` `es` `de` `it` `ru` `ms`；`quality` 为 `low`/`medium`/`high`；可选 `personalTerms`（保留术语表）。\n\n### `client.humanize(params)`\n\n[拟人改写 / 降 AI](https://bunnyscholar.cn/developer/docs)。`text` 长度 20–500 字符；`language` 为 `zh_CN`/`en`；可选 `platform`、`needPlagiarismReduction`、`personalTerms`。\n\n两个方法都返回 `{ text, usage }`。\n\n## 错误处理\n\n非 2xx 响应会抛出 `BunnyScholarError`，带 `status` 与 `code`：\n\n```ts\nimport { BunnyScholar, BunnyScholarError } from \"@bunnyscholar/sdk\";\n\ntry {\n  await client.academicRewrite({ text: \"……\" });\n} catch (err) {\n  if (err instanceof BunnyScholarError) {\n    // 例如 402 insufficient_balance / 429 rate_limit_exceeded / 403 INVALID_API_KEY\n    console.error(err.status, err.code);\n  }\n}\n```\n\n## 计费与限流\n\n按输入字符数计费（元 / 千字），实时价见 [定价页](https://bunnyscholar.cn/developer/pricing)，余额可在 [充值页](https://bunnyscholar.cn/developer/recharge) 补充。单 Key 默认约 1800 次 / 60 秒，请对 `429` 做退避重试。\n\n## 相关链接\n\n[官网](https://bunnyscholar.cn) · [开发者文档](https://bunnyscholar.cn/developer/docs) · [Python SDK](https://pypi.org/project/bunnyscholar/) · [Agent Skill](https://github.com/bunnyscholar/bunnyscholar-api-skill) · [服务条款](https://bunnyscholar.cn/terms) · support@bunnyscholar.com\n\n## License\n\n[MIT](./LICENSE)\n\n---\n\n<a name=\"english\"></a>\n\n# @bunnyscholar/sdk (English)\n\n**[简体中文](#top) | English**\n\nOfficial Node.js SDK for the [**BunnyScholar Open Platform**](https://bunnyscholar.cn/developer) — **academic rewrite (paraphrasing)** and **AI humanizer** in a few lines. Zero runtime dependencies, built on native `fetch` (Node 18+).\n\n🔗 [Homepage](https://bunnyscholar.cn) · [Developer console](https://bunnyscholar.cn/developer) · [API docs](https://bunnyscholar.cn/developer/docs) · [Get an API key](https://bunnyscholar.cn/developer/keys) · [Pricing](https://bunnyscholar.cn/developer/pricing)\n\n```bash\nnpm install @bunnyscholar/sdk\n```\n\n```ts\nimport { BunnyScholar } from \"@bunnyscholar/sdk\";\n\nconst client = new BunnyScholar({ apiKey: process.env.BUNNYSCHOLAR_API_KEY! });\n\nconst rewrite = await client.academicRewrite({ text: \"…\", language: \"zh_CN\", quality: \"medium\" });\nconsole.log(rewrite.text, rewrite.usage.amount);\n\nconst humanized = await client.humanize({ text: \"…\", language: \"zh_CN\", platform: \"turnitin\" });\nconsole.log(humanized.text);\n```\n\n- `academicRewrite(params)` — paraphrase / plagiarism reduction. `text` 10–2000 chars; 11 languages; `quality` = `low`/`medium`/`high`.\n- `humanize(params)` — AI humanizer. `text` 20–500 chars; `language` = `zh_CN`/`en`; optional `platform`.\n\nNon-2xx responses throw `BunnyScholarError` with `status` and `code`. Billed per input character — see [pricing](https://bunnyscholar.cn/developer/pricing).\n\nLinks: [Homepage](https://bunnyscholar.cn) · [Docs](https://bunnyscholar.cn/developer/docs) · [Python SDK](https://pypi.org/project/bunnyscholar/) · [Agent Skill](https://github.com/bunnyscholar/bunnyscholar-api-skill) · support@bunnyscholar.com\n\n## License\n\n[MIT](./LICENSE)","readmeFilename":"README.md","_rev":"1-7b97f7fcc9f2210785d9dd69a16e0c3d"}