{"_id":"@alilis/k-hat","_rev":"13-df7b9b9d88767023b89e4badd02f883b","name":"@alilis/k-hat","dist-tags":{"latest":"0.2.11"},"versions":{"0.1.0":{"name":"@alilis/k-hat","version":"0.1.0","keywords":["llm","proxy","api-key","key-rotation","openai","anthropic","codex"],"license":"MIT","_id":"@alilis/k-hat@0.1.0","maintainers":[{"name":"alilis","email":"aweirdocc@163.com"}],"homepage":"https://github.com/aweirdocc/k-hat#readme","bugs":{"url":"https://github.com/aweirdocc/k-hat/issues"},"bin":{"khat":"dist/cli.js"},"dist":{"shasum":"9fbbda3ea25d07c0e9b8cfea0b9dc5875e79188a","tarball":"https://registry.npmjs.org/@alilis/k-hat/-/k-hat-0.1.0.tgz","fileCount":23,"integrity":"sha512-0A5AdVCNR1N+xYc4ZhRD19xxc7AIU28VcEsjYxQ+0VUysOKWvtFVdLp71UhtSTcUz7rZ9cZnoNmPrpJ12ukkxQ==","signatures":[{"sig":"MEUCIACpTZPigQh6gBaKpEt1YxvvmMV4rXx5/A98Mf8llfa5AiEA+ODRw+vNersTNrOdqWiqRvTEgBsyMjArsWDsOL/j0KU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":169479},"type":"module","engines":{"node":">=20"},"gitHead":"6ca18387646c12665f152ec03f279bd1e3e91ed5","scripts":{"khat":"node dist/cli.js","test":"npm run build && node --test test/**/*.test.js","build":"tsc -p tsconfig.json","start":"node dist/cli.js start","prepare":"npm run build"},"_npmUser":{"name":"alilis","email":"aweirdocc@163.com"},"repository":{"url":"git+https://github.com/aweirdocc/k-hat.git","type":"git"},"_npmVersion":"11.16.0","description":"本地 API key 代理管理器，统一管理多个 AI 服务商的密钥并自动轮转","directories":{},"_nodeVersion":"24.18.1","dependencies":{"ink":"^7.1.1","react":"^19.2.8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.0","@types/react":"^19.2.18"},"_npmOperationalInternal":{"tmp":"tmp/k-hat_0.1.0_1787827240319_0.5388444730209958","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@alilis/k-hat","version":"0.2.0","keywords":["llm","proxy","api-key","key-rotation","openai","anthropic","codex"],"license":"MIT","_id":"@alilis/k-hat@0.2.0","maintainers":[{"name":"alilis","email":"aweirdocc@163.com"}],"homepage":"https://github.com/aweirdocc/k-hat#readme","bugs":{"url":"https://github.com/aweirdocc/k-hat/issues"},"bin":{"khat":"dist/cli.js"},"dist":{"shasum":"c0426e9eea8942cf50352134d70b4ca20a85367a","tarball":"https://registry.npmjs.org/@alilis/k-hat/-/k-hat-0.2.0.tgz","fileCount":24,"integrity":"sha512-W5q8Vx3ta7NWwdST+Jgy8bu/iBHv+kDa/lTUBDBdaBImMXedfZ8OL8fYQ3mrHG1z6HIznGNCgaPDXm+XidYOvw==","signatures":[{"sig":"MEUCIQCUAEL8Zt0p2F/cYKH/AKt3OM9/W6djy0WCe3PuRav9EgIgbV/qklKAlAPvbXUb3mXVrPDA0pcEco8enp+mkdyO4KI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":172182},"type":"module","engines":{"node":">=20"},"gitHead":"ee0227b914084ecdc046ede1cae11c59f833829d","scripts":{"khat":"node dist/cli.js","test":"npm run build && node --test test/**/*.test.js","build":"tsc -p tsconfig.json","start":"node dist/cli.js start","prepare":"npm run build"},"_npmUser":{"name":"alilis","email":"aweirdocc@163.com"},"repository":{"url":"git+https://github.com/aweirdocc/k-hat.git","type":"git"},"_npmVersion":"11.16.0","description":"本地 API key 代理管理器，统一管理多个 AI 服务商的密钥并自动轮转","directories":{},"_nodeVersion":"24.18.1","dependencies":{"ink":"^7.1.1","react":"^19.2.8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.0","@types/react":"^19.2.18"},"_npmOperationalInternal":{"tmp":"tmp/k-hat_0.2.0_1787902877204_0.7553263283864764","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@alilis/k-hat","version":"0.2.1","keywords":["llm","proxy","api-key","key-rotation","openai","anthropic","codex"],"license":"MIT","_id":"@alilis/k-hat@0.2.1","maintainers":[{"name":"alilis","email":"aweirdocc@163.com"}],"homepage":"https://github.com/aweirdocc/k-hat#readme","bugs":{"url":"https://github.com/aweirdocc/k-hat/issues"},"bin":{"khat":"dist/cli.js"},"dist":{"shasum":"bfad0fc1c0955d276f571b3aa0820cc9c9944ddd","tarball":"https://registry.npmjs.org/@alilis/k-hat/-/k-hat-0.2.1.tgz","fileCount":24,"integrity":"sha512-QX432WwtPsok/ycg3QL/B4AQ/mpxHYG3+6UQ/FaZ3qhbAnKJ7tarE1n5eDfzE4EQE6AT2yXXxFk7Pk6nXedCwA==","signatures":[{"sig":"MEUCIE/HVSrzptQzrPeATCvq1/kgfvNDdPX3dbpgU+0PtbHJAiEAri6BJiidcHo5pAT5oI3UiaUVq9fRNGWdkYN2JNXOdtI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":188035},"type":"module","engines":{"node":">=20"},"gitHead":"6d860e7d539612a30150f5455ad9d24f5ef56054","scripts":{"khat":"node dist/cli.js","test":"npm run build && node --test test/**/*.test.js","build":"tsc -p tsconfig.json","start":"node dist/cli.js start","prepare":"npm run build"},"_npmUser":{"name":"alilis","email":"aweirdocc@163.com"},"repository":{"url":"git+https://github.com/aweirdocc/k-hat.git","type":"git"},"_npmVersion":"11.16.0","description":"本地 API key 代理管理器，统一管理多个 AI 服务商的密钥并自动轮转","directories":{},"_nodeVersion":"24.18.1","dependencies":{"ink":"^7.1.1","react":"^19.2.8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.0","@types/react":"^19.2.18"},"_npmOperationalInternal":{"tmp":"tmp/k-hat_0.2.1_1787912429333_0.4914116523285894","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@alilis/k-hat","version":"0.2.2","keywords":["llm","proxy","api-key","key-rotation","openai","anthropic","codex"],"license":"MIT","_id":"@alilis/k-hat@0.2.2","maintainers":[{"name":"alilis","email":"aweirdocc@163.com"}],"homepage":"https://github.com/aweirdocc/k-hat#readme","bugs":{"url":"https://github.com/aweirdocc/k-hat/issues"},"bin":{"khat":"dist/cli.js"},"dist":{"shasum":"8986cefeca66e4ecfea1fafaa03b853b86ef4445","tarball":"https://registry.npmjs.org/@alilis/k-hat/-/k-hat-0.2.2.tgz","fileCount":24,"integrity":"sha512-hV4RT3ldAugaWA5+CcQOVdkp+WuHDIW2vz5M70lmoR+pMj6x19AoE+e1V/RTaHAd20HCgg1peXYcLoYZub4jvQ==","signatures":[{"sig":"MEQCIAyok5TT1whmiLmMZEvcQISnTQbmeJwqy92obMKeODH7AiAr+qSmsR/g0lcUOKgUhEO8X+PvtoADSy+xfB/gvGtt/g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":188375},"type":"module","engines":{"node":">=20"},"gitHead":"3e3511832c09cee26218d68ae381622b9a029587","scripts":{"khat":"node dist/cli.js","test":"npm run build && node --test test/**/*.test.js","build":"tsc -p tsconfig.json","start":"node dist/cli.js start","prepare":"npm run build"},"_npmUser":{"name":"alilis","email":"aweirdocc@163.com"},"repository":{"url":"git+https://github.com/aweirdocc/k-hat.git","type":"git"},"_npmVersion":"11.16.0","description":"本地 API key 代理管理器，统一管理多个 AI 服务商的密钥并自动轮转","directories":{},"_nodeVersion":"24.18.1","dependencies":{"ink":"^7.1.1","react":"^19.2.8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.0","@types/react":"^19.2.18"},"_npmOperationalInternal":{"tmp":"tmp/k-hat_0.2.2_1788148771248_0.36714191149131903","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"@alilis/k-hat","version":"0.2.3","keywords":["llm","proxy","api-key","key-rotation","openai","anthropic","codex"],"license":"MIT","_id":"@alilis/k-hat@0.2.3","maintainers":[{"name":"alilis","email":"aweirdocc@163.com"}],"homepage":"https://github.com/aweirdocc/k-hat#readme","bugs":{"url":"https://github.com/aweirdocc/k-hat/issues"},"bin":{"khat":"dist/cli.js"},"dist":{"shasum":"28a1653f3c8b411c1314f631cb5e4e64dcdfc645","tarball":"https://registry.npmjs.org/@alilis/k-hat/-/k-hat-0.2.3.tgz","fileCount":24,"integrity":"sha512-z/Jcuz/J+yNlR3LxlAMz9GSms2hR3kedeim7I6jUKnwDMbHF4IjBUXPyzhpWzfgiDLOuM3RT6oUGWiY9HG35Mg==","signatures":[{"sig":"MEYCIQCCOx4KyN1i98T6Uie5uIfKBOZCIk58LHNx841ch8+OlAIhAObRlROY/OzaXjveBxqoN4AIlvczWD8qh6i4hYRi04X2","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":194372},"type":"module","engines":{"node":">=20"},"gitHead":"b0ad3051dfe03886eb8fa7f81bf5572961d993d8","scripts":{"khat":"node dist/cli.js","test":"npm run build && node --test test/**/*.test.js","build":"tsc -p tsconfig.json","start":"node dist/cli.js start","prepare":"npm run build"},"_npmUser":{"name":"alilis","email":"aweirdocc@163.com"},"repository":{"url":"git+https://github.com/aweirdocc/k-hat.git","type":"git"},"_npmVersion":"11.16.0","description":"本地 API key 代理管理器，统一管理多个 AI 服务商的密钥并自动轮转","directories":{},"_nodeVersion":"24.18.1","dependencies":{"ink":"^7.1.1","react":"^19.2.8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.0","@types/react":"^19.2.18"},"_npmOperationalInternal":{"tmp":"tmp/k-hat_0.2.3_1788157825546_0.2444694467889541","host":"s3://npm-registry-packages-npm-production"}},"0.2.4":{"name":"@alilis/k-hat","version":"0.2.4","keywords":["llm","proxy","api-key","key-rotation","openai","anthropic","codex"],"license":"MIT","_id":"@alilis/k-hat@0.2.4","maintainers":[{"name":"alilis","email":"aweirdocc@163.com"}],"homepage":"https://github.com/aweirdocc/k-hat#readme","bugs":{"url":"https://github.com/aweirdocc/k-hat/issues"},"bin":{"khat":"dist/cli.js"},"dist":{"shasum":"e44cda246a86a318f670952c4bf510af2e03c181","tarball":"https://registry.npmjs.org/@alilis/k-hat/-/k-hat-0.2.4.tgz","fileCount":24,"integrity":"sha512-dR+Yoc83KPDgNcOfu31CDeHIFi8T4V+CNqKrlN8t7gIAUzEVW4+CM/roXB9pVe6/oeyaJoGqg/fi7YsJ3vTOEA==","signatures":[{"sig":"MEYCIQDPiUqWqqLwm6h1povNz5xImY7Jrxp0WrVJpK9W+PzFjAIhAPurZ1AvTF2Y/hVfeWqO9AU5Ol6EWQOXLKH0BRr20weF","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":195640},"type":"module","engines":{"node":">=20"},"gitHead":"5bff2aa6b8a01c4b556442cacdc3802a009279fe","scripts":{"khat":"node dist/cli.js","test":"npm run build && node --test test/**/*.test.js","build":"tsc -p tsconfig.json","start":"node dist/cli.js start","prepare":"npm run build"},"_npmUser":{"name":"alilis","email":"aweirdocc@163.com"},"repository":{"url":"git+https://github.com/aweirdocc/k-hat.git","type":"git"},"_npmVersion":"11.16.0","description":"本地 API key 代理管理器，统一管理多个 AI 服务商的密钥并自动轮转","directories":{},"_nodeVersion":"24.18.1","dependencies":{"ink":"^7.1.1","react":"^19.2.8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.0","@types/react":"^19.2.18"},"_npmOperationalInternal":{"tmp":"tmp/k-hat_0.2.4_1788165688475_0.9081104561813913","host":"s3://npm-registry-packages-npm-production"}},"0.2.5":{"name":"@alilis/k-hat","version":"0.2.5","keywords":["llm","proxy","api-key","key-rotation","openai","anthropic","codex"],"license":"MIT","_id":"@alilis/k-hat@0.2.5","maintainers":[{"name":"alilis","email":"aweirdocc@163.com"}],"homepage":"https://github.com/aweirdocc/k-hat#readme","bugs":{"url":"https://github.com/aweirdocc/k-hat/issues"},"bin":{"khat":"dist/cli.js"},"dist":{"shasum":"6123e878d8983ba30609b77b67f810be4dac242d","tarball":"https://registry.npmjs.org/@alilis/k-hat/-/k-hat-0.2.5.tgz","fileCount":24,"integrity":"sha512-NDm3qxUBa/5IfuO1MKswk9fdqzKnWz8K7NGLvnQ3gBV9Atya2XE1Tc1PDtN+45AP1/GBttBUU+mMKTDmTXUlWQ==","signatures":[{"sig":"MEUCIDCz0552My4xOTybON0amuV17qjPBwwGtQOBCIH+RkjvAiEAsMfOG5LokaHhneKEoWxhl8ZNhoQvfooJCDkVUgYP8Ls=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":199712},"type":"module","engines":{"node":">=20"},"gitHead":"26ad2fea652c19285a702a4e8150f512dce82c77","scripts":{"khat":"node dist/cli.js","test":"npm run build && node --test test/**/*.test.js","build":"tsc -p tsconfig.json","start":"node dist/cli.js start","prepare":"npm run build"},"_npmUser":{"name":"alilis","email":"aweirdocc@163.com"},"repository":{"url":"git+https://github.com/aweirdocc/k-hat.git","type":"git"},"_npmVersion":"11.16.0","description":"本地 API key 代理管理器，统一管理多个 AI 服务商的密钥并自动轮转","directories":{},"_nodeVersion":"24.18.1","dependencies":{"ink":"^7.1.1","react":"^19.2.8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.0","@types/react":"^19.2.18"},"_npmOperationalInternal":{"tmp":"tmp/k-hat_0.2.5_1788256278305_0.2789366587032587","host":"s3://npm-registry-packages-npm-production"}},"0.2.6":{"name":"@alilis/k-hat","version":"0.2.6","keywords":["llm","proxy","api-key","key-rotation","openai","anthropic","codex"],"license":"MIT","_id":"@alilis/k-hat@0.2.6","maintainers":[{"name":"alilis","email":"aweirdocc@163.com"}],"homepage":"https://github.com/aweirdocc/k-hat#readme","bugs":{"url":"https://github.com/aweirdocc/k-hat/issues"},"bin":{"khat":"dist/cli.js"},"dist":{"shasum":"4b39495698f62c5db030cfe641edef191b390945","tarball":"https://registry.npmjs.org/@alilis/k-hat/-/k-hat-0.2.6.tgz","fileCount":24,"integrity":"sha512-vR0Es0JVVwN+VglfGpopX/ISapkkPGH/mwGBPcBHn4tyKDU/GnwrhKIuZ+EUN0a1NWjVtqYigy/v9/6Ws4mVdQ==","signatures":[{"sig":"MEUCIQD5Dm27n+rjUXRhzTrbYxmYI/eDG6xBZdbvMJl4LncqOgIga34IUCCGWfnKvDhxKoyjqRTcNMOEsVxXQCVGKokSkZ8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":205207},"type":"module","engines":{"node":">=20"},"gitHead":"6c67975c975d8b4a84a8d43c902bb4f46cd51f41","scripts":{"khat":"node dist/cli.js","test":"npm run build && node --test test/**/*.test.js","build":"tsc -p tsconfig.json","start":"node dist/cli.js start","prepare":"npm run build"},"_npmUser":{"name":"alilis","email":"aweirdocc@163.com"},"repository":{"url":"git+https://github.com/aweirdocc/k-hat.git","type":"git"},"_npmVersion":"8.19.4","description":"本地 API key 代理管理器，统一管理多个 AI 服务商的密钥并自动轮转","directories":{},"_nodeVersion":"16.20.2","dependencies":{"ink":"^7.1.1","react":"^19.2.8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.0","@types/react":"^19.2.18"},"_npmOperationalInternal":{"tmp":"tmp/k-hat_0.2.6_1788319660053_0.3795388263272377","host":"s3://npm-registry-packages-npm-production"}},"0.2.7":{"name":"@alilis/k-hat","version":"0.2.7","keywords":["llm","proxy","api-key","key-rotation","openai","anthropic","codex"],"license":"MIT","_id":"@alilis/k-hat@0.2.7","maintainers":[{"name":"alilis","email":"aweirdocc@163.com"}],"homepage":"https://github.com/aweirdocc/k-hat#readme","bugs":{"url":"https://github.com/aweirdocc/k-hat/issues"},"bin":{"khat":"dist/cli.js"},"dist":{"shasum":"c05faebc779b670fce4f574b4abcf3ff0320e7e7","tarball":"https://registry.npmjs.org/@alilis/k-hat/-/k-hat-0.2.7.tgz","fileCount":25,"integrity":"sha512-RvAHZZ8ZMYX1JohJdnnoDAHssqggAA13SFv6EI/OBMRx2s8iTxl3XVIHcgHHWkeZaIRwway2DN2T5E6S0kVlEw==","signatures":[{"sig":"MEUCID2pjTIk63KcW7SsmjTpW38uDMy/+xmDEKaeDLVh7BhRAiEAyTCZXdNxwE7S5c11wXS8tuG/wfJuprM7OUTkVyw0Veo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":218556},"type":"module","engines":{"node":">=20"},"gitHead":"8eff4589f6ce87bc8ac4b777d7588a1b54d1b613","scripts":{"khat":"node dist/cli.js","test":"npm run build && node --test test/**/*.test.js","bench":"node bench/bench.js","build":"tsc -p tsconfig.json","start":"node dist/cli.js start","prepare":"npm run build"},"_npmUser":{"name":"alilis","email":"aweirdocc@163.com"},"repository":{"url":"git+https://github.com/aweirdocc/k-hat.git","type":"git"},"_npmVersion":"11.16.0","description":"本地 API key 代理管理器，统一管理多个 AI 服务商的密钥并自动轮转","directories":{},"_nodeVersion":"24.18.1","dependencies":{"ink":"^7.1.1","react":"^19.2.8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.0","@types/react":"^19.2.18"},"_npmOperationalInternal":{"tmp":"tmp/k-hat_0.2.7_1788418166792_0.4483826759845573","host":"s3://npm-registry-packages-npm-production"}},"0.2.8":{"name":"@alilis/k-hat","version":"0.2.8","keywords":["llm","proxy","api-key","key-rotation","openai","anthropic","codex"],"license":"MIT","_id":"@alilis/k-hat@0.2.8","maintainers":[{"name":"alilis","email":"aweirdocc@163.com"}],"homepage":"https://github.com/aweirdocc/k-hat#readme","bugs":{"url":"https://github.com/aweirdocc/k-hat/issues"},"bin":{"khat":"dist/cli/cli.js"},"dist":{"shasum":"75801f5e441e9f5c11414318efaf96b2bb1af640","tarball":"https://registry.npmjs.org/@alilis/k-hat/-/k-hat-0.2.8.tgz","fileCount":26,"integrity":"sha512-uhasI8hs6odRn5nvbOw7BfNbmDJAHYGkA/812fu0xkIhv6bQjD+E4408zuCRrwDOOsmttX9iWgQtpsgF0nZohQ==","signatures":[{"sig":"MEYCIQCB0kb1X8uSKF6nyQ7XwWIpR4yK/L5CoE6mCOHyK0qPZAIhAIWO/D62mZEGUqmL2/Z0vWOuNJOYgxwxmzDt/gsrirzu","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":230195},"type":"module","engines":{"node":">=20"},"gitHead":"104db0e4998cb0b34160ac25426db34da5f6f832","scripts":{"khat":"node dist/cli/cli.js","test":"npm run build && node --test test/**/*.test.js","bench":"node bench/bench.js","build":"tsc -p tsconfig.json","start":"node dist/cli/cli.js start","prepare":"npm run build"},"_npmUser":{"name":"alilis","email":"aweirdocc@163.com"},"repository":{"url":"git+https://github.com/aweirdocc/k-hat.git","type":"git"},"_npmVersion":"11.16.0","description":"本地 API key 代理管理器，统一管理多个 AI 服务商的密钥并自动轮转","directories":{},"_nodeVersion":"24.18.1","dependencies":{"ink":"^7.1.1","react":"^19.2.8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.0","@types/react":"^19.2.18"},"_npmOperationalInternal":{"tmp":"tmp/k-hat_0.2.8_1788514802903_0.772722674416001","host":"s3://npm-registry-packages-npm-production"}},"0.2.9":{"name":"@alilis/k-hat","version":"0.2.9","keywords":["llm","proxy","api-key","key-rotation","openai","anthropic","codex"],"license":"MIT","_id":"@alilis/k-hat@0.2.9","maintainers":[{"name":"alilis","email":"aweirdocc@163.com"}],"homepage":"https://github.com/aweirdocc/k-hat#readme","bugs":{"url":"https://github.com/aweirdocc/k-hat/issues"},"bin":{"khat":"dist/cli/cli.js"},"dist":{"shasum":"9c11c5ba4c38eda56e58d6520805b958bdd1c5c3","tarball":"https://registry.npmjs.org/@alilis/k-hat/-/k-hat-0.2.9.tgz","fileCount":26,"integrity":"sha512-ImrcmZ0TJ9mvLjm8boOSg5xrbNbiRFpzN97xHsmU/Hj5dcKd/X/2CKiNulJgCWHS5F96ZfTGLovonmLM1JM7nw==","signatures":[{"sig":"MEYCIQC/69d8h4sNGRgAb2yKRWeq5UIjG2RlQnNuNB6ZAVMt3QIhAKOgTZEmr/WJLhC3TCjhOzwLOatn3FCRAdGwTLKHB2nL","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":230891},"type":"module","engines":{"node":">=20"},"gitHead":"62c8ef0d81f9af3c6152b650805147428f6d4704","scripts":{"khat":"node dist/cli/cli.js","test":"npm run build && node --test test/**/*.test.js","bench":"node bench/bench.js","build":"tsc -p tsconfig.json","start":"node dist/cli/cli.js start","prepare":"npm run build"},"_npmUser":{"name":"alilis","email":"aweirdocc@163.com"},"repository":{"url":"git+https://github.com/aweirdocc/k-hat.git","type":"git"},"_npmVersion":"11.16.0","description":"本地 API key 代理管理器，统一管理多个 AI 服务商的密钥并自动轮转","directories":{},"_nodeVersion":"24.18.1","dependencies":{"ink":"^7.1.1","react":"^19.2.8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.0","@types/react":"^19.2.18"},"_npmOperationalInternal":{"tmp":"tmp/k-hat_0.2.9_1788754315463_0.9598275765861604","host":"s3://npm-registry-packages-npm-production"}},"0.2.10":{"name":"@alilis/k-hat","version":"0.2.10","keywords":["llm","proxy","api-key","key-rotation","openai","anthropic","codex"],"license":"MIT","_id":"@alilis/k-hat@0.2.10","maintainers":[{"name":"alilis","email":"aweirdocc@163.com"}],"homepage":"https://github.com/aweirdocc/k-hat#readme","bugs":{"url":"https://github.com/aweirdocc/k-hat/issues"},"bin":{"khat":"dist/cli/cli.js"},"dist":{"shasum":"fbd1953f4bb50ab0e7b74d37717f59ba85b936ec","tarball":"https://registry.npmjs.org/@alilis/k-hat/-/k-hat-0.2.10.tgz","fileCount":26,"integrity":"sha512-7vub2eYhZCf5aYb5IKDj0LUW9BVQ4WmuPRVcHfM9NYlF/5n0liHJZDvME8IstMG4NF/aNb9KnuuYNQB39tRvew==","signatures":[{"sig":"MEYCIQCiDwxGrqaz1k16HAVPHnJA51+stEJC2+dI/D4WM1bEuAIhAMwWpyCb5+BO84rap63sn0RTe4GEKQZVLJwMikdLF0Bb","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":230900},"type":"module","engines":{"node":">=20"},"gitHead":"d3a9cf328a1853827e5ef2febbf104ffa0ab4fd2","scripts":{"khat":"node dist/cli/cli.js","test":"npm run build && node --test test/**/*.test.js","bench":"node bench/bench.js","build":"tsc -p tsconfig.json","start":"node dist/cli/cli.js start","prepare":"npm run build"},"_npmUser":{"name":"alilis","email":"aweirdocc@163.com"},"repository":{"url":"git+https://github.com/aweirdocc/k-hat.git","type":"git"},"_npmVersion":"11.16.0","description":"本地 API key 代理管理器，统一管理多个 AI 服务商的密钥并自动轮转","directories":{},"_nodeVersion":"24.18.1","dependencies":{"ink":"^7.1.1","react":"^19.2.8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.0","@types/react":"^19.2.18"},"_npmOperationalInternal":{"tmp":"tmp/k-hat_0.2.10_1788761043853_0.8991498308763719","host":"s3://npm-registry-packages-npm-production"}},"0.2.11":{"name":"@alilis/k-hat","version":"0.2.11","publishConfig":{"access":"public"},"description":"本地 API key 代理管理器，统一管理多个 AI 服务商的密钥并自动轮转","license":"MIT","type":"module","bin":{"khat":"dist/cli/cli.js"},"engines":{"node":">=20"},"keywords":["llm","proxy","api-key","key-rotation","openai","anthropic","codex"],"repository":{"type":"git","url":"git+https://github.com/aweirdocc/k-hat.git"},"homepage":"https://github.com/aweirdocc/k-hat#readme","bugs":{"url":"https://github.com/aweirdocc/k-hat/issues"},"scripts":{"build":"tsc -p tsconfig.json","prepare":"npm run build","start":"node dist/cli/cli.js start","khat":"node dist/cli/cli.js","test":"npm run build && node --test test/**/*.test.js","bench":"node bench/bench.js"},"devDependencies":{"@types/node":"^22.10.0","@types/react":"^19.2.18","typescript":"^5.7.2"},"dependencies":{"ink":"^7.1.1","react":"^19.2.8"},"gitHead":"bb37e3b646338b8312791b39a98b44fc5193e4fa","_id":"@alilis/k-hat@0.2.11","_nodeVersion":"24.18.1","_npmVersion":"11.16.0","dist":{"integrity":"sha512-SBZcbPQdNWmwtnd1XytobnXjAwuCFifdZsP+B5Mo75rGW6IiqfYm7gow7eJJyEBTKYtkfyhnA+8aCLIK4sNWvA==","shasum":"f1e201e5bb130dca9ab7cc5fb8fc0a4fcce2a3fc","tarball":"https://registry.npmjs.org/@alilis/k-hat/-/k-hat-0.2.11.tgz","fileCount":26,"unpackedSize":234266,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDq4QCjsSvsCbIQX23/ZlPg5ge3hFWM9tmrVoE2CKZZkgIgP1rxHhrfw5OWaaorj4vpb+uL0DoPN6jLOuCu9DvcGiE="}]},"_npmUser":{"name":"alilis","email":"aweirdocc@163.com"},"directories":{},"maintainers":[{"name":"alilis","email":"aweirdocc@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/k-hat_0.2.11_1789024055104_0.6732370266164527"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-27T10:40:40.213Z","modified":"2026-09-10T07:07:35.557Z","0.1.0":"2026-08-27T10:40:40.495Z","0.2.0":"2026-08-28T07:41:17.350Z","0.2.1":"2026-08-28T10:20:29.478Z","0.2.2":"2026-08-31T03:59:31.377Z","0.2.3":"2026-08-31T06:30:25.687Z","0.2.4":"2026-08-31T08:41:28.602Z","0.2.5":"2026-09-01T09:51:18.438Z","0.2.6":"2026-09-02T03:27:40.186Z","0.2.7":"2026-09-03T06:49:26.946Z","0.2.8":"2026-09-04T09:40:03.044Z","0.2.9":"2026-09-07T04:11:55.617Z","0.2.10":"2026-09-07T06:04:03.991Z","0.2.11":"2026-09-10T07:07:35.244Z"},"bugs":{"url":"https://github.com/aweirdocc/k-hat/issues"},"license":"MIT","homepage":"https://github.com/aweirdocc/k-hat#readme","keywords":["llm","proxy","api-key","key-rotation","openai","anthropic","codex"],"repository":{"type":"git","url":"git+https://github.com/aweirdocc/k-hat.git"},"description":"本地 API key 代理管理器，统一管理多个 AI 服务商的密钥并自动轮转","maintainers":[{"name":"alilis","email":"aweirdocc@163.com"}],"readme":"# K-Hat\r\n\r\n本地 API key 代理管理器，统一管理多个 AI 服务商的密钥并自动轮转。K-Hat 在本机提供兼容 OpenAI 的 API 入口，将请求按模型路由到已配置的 Provider，并在 key 不可用时自动切换。\r\n\r\n## 安装与首次运行\r\n\r\n要求 Node.js 20 或更高版本。\r\n\r\n```bash\r\nnpm install\r\nnpm link\r\nkhat init\r\nkhat start\r\n```\r\n\r\n如果不希望创建全局命令，也可以在仓库内运行：\r\n\r\n```bash\r\nnpm run khat -- init\r\nnpm run khat -- start\r\n```\r\n\r\n初始化后，使用 Provider、Key 和 Route 命令完成配置。访问令牌可通过 `khat token show` 查看，建议仅在需要配置客户端时使用。\r\n\r\n## 接入客户端\r\n\r\n将客户端的 `base_url` 指向 `http://127.0.0.1:8787/v1`（或 `http://127.0.0.1:8787`，视工具而定），认证令牌填入 `khat init` 生成的访问令牌。\r\n\r\n## 停止后台代理\r\n\r\n```bash\r\nkhat stop\r\n```\r\n\r\n### 服务化部署（M7）\r\n\r\n```bash\r\nkhat service install          # 注册开机自启（Windows 计划任务 / macOS launchd / Linux systemd --user）\r\nkhat service uninstall        # 取消开机自启\r\nkhat service status           # 查看服务注册状态与守护进程运行状态\r\n```\r\n\r\n> **注意**：service 安装时会固定 `KHAT_HOME` 为安装时解析的数据目录；`khat stop` 不会卸载服务，下次登录仍自动启动；Windows 上未采用 NSSM（因用户级 DPAPI vault 无法以 LocalSystem 运行）。\r\n\r\n### 服务自愈与崩溃日志\r\n\r\n- **Windows 自愈**：计划任务除登录触发外，每 5 分钟重复检查一次；supervisor 意外退出后最迟 5 分钟内自动恢复（多实例策略 `IgnoreNew` 保证不会重复启动）。\r\n- **崩溃退避**：supervisor 以指数退避重启 daemon（1s 起步、封顶 60s）。daemon 稳定运行满 5 分钟即清零崩溃计数——连续崩溃才触发加速退避，且不会永久放弃重启。\r\n- **日志位置**：\r\n  - `~/.khat/service.log` — supervisor 事件（daemon 退出码、重启退避、启动失败），超过 1MB 自动截断；\r\n  - `~/.khat/logs/daemon-error.log` — daemon 未捕获异常与未处理的 Promise 拒绝（含完整堆栈）、监听端口失败（如端口占用）。\r\n  \r\n  服务再次中断时优先查看这两个文件定位原因。\r\n\r\n## CLI 命令\r\n\r\n### 初始化与运行\r\n\r\n> 源码运行时无需手动编译：`npm install` 会通过 prepare 钩子自动构建；若手动改过源码，重新执行 `npm run build` 即可。安装为全局命令（`npm link`）后可直接使用 `khat ...`，否则在仓库内用 `npm run khat -- ...`。\r\n\r\n| 命令 | 说明 |\r\n|---|---|\r\n| `khat init` | 首次初始化：创建密钥库 + 访问令牌 + 默认配置；可用 `--port <n>` 指定监听端口 |\r\n| `khat start` | 后台启动代理与 supervisor；使用 `--foreground` 以前台模式诊断，使用 `--port <n>` 修改并持久化监听端口 |\r\n| `khat stop` | 请求后台代理优雅停止 |\r\n| `khat status` | 查看 Provider、key、路由及 key 健康状态 |\r\n| `khat doctor` | 检测本机 Agent Tool 配置并输出接入提示 |\r\n| `khat log [--tail <n>]` | 查看最近的脱敏请求日志 |\r\n| `khat ui` | 签发一次性票据并打开本地管理页 |\r\n| `khat tui` | 终端监控面板：跨 Provider 的 key 健康表（不可用排最前，`e` 一键恢复、`p` 探活）、请求日志与诊断，Tab/1-4 切换区块 |\r\n\r\n> Provider、key 和路由的新增、更新、删除与恢复等管理变更通过本地 Admin API 执行；若 daemon 尚未运行，命令会自动启动它。\r\n\r\n### 模型列表接口\r\n\r\n代理提供带访问令牌认证的只读模型列表接口：\r\n\r\n```bash\r\nTOKEN=$(khat token show)\r\ncurl -s -H \"Authorization: Bearer $TOKEN\" http://127.0.0.1:8787/models\r\n```\r\n\r\n`GET /models` 和兼容 OpenAI 客户端的 `GET /v1/models` 返回当前配置中启用的 `routes`，不会请求上游 Provider，也不会返回 `upstreamModel`：\r\n\r\n```json\r\n{\r\n  \"object\": \"list\",\r\n  \"data\": [\r\n    { \"id\": \"deepseek-chat\", \"object\": \"model\", \"created\": 0, \"owned_by\": \"deepseek\" }\r\n  ]\r\n}\r\n```\r\n\r\n未配置路由时 `data` 为空；禁用路由不会出现在列表中。请求必须携带 `Authorization: Bearer <access-token>`，否则返回 HTTP 401。\r\n\r\n### 访问令牌\r\n\r\n| 命令 | 说明 |\r\n|---|---|\r\n| `khat token show` | 打印当前访问令牌 |\r\n| `khat token rotate` | 轮换访问令牌（需更新所有工具） |\r\n\r\n### Provider 管理\r\n\r\n| 命令 | 说明 |\r\n|---|---|\r\n| `khat provider add <id> --base-url <url> [--name <n>] [--protocol openai\\|anthropic]` | 添加 Provider |\r\n| `khat provider update <id> [--name <n>] [--base-url <url>] [--protocol openai\\|anthropic]` | 更新 Provider 名称、上游地址或协议 |\r\n| `khat provider list` | 列出所有 Provider |\r\n| `khat provider remove <id>` | 删除 Provider（级联删除其 key 与路由） |\r\n\r\n### Key 管理（机密存于加密密钥库）\r\n\r\n`--weight <n>`：该 key 在同一 Provider 内多个 key 之间的相对权重（平滑加权轮询，Nginx 同款算法），默认 1。例如 `--weight 3` 与 `--weight 1` 的两个 key，在都可用时请求约按 3:1 分配；权重只影响轮询占比，不影响 key 的可用性。\r\n\r\n| 命令 | 说明 |\r\n|---|---|\r\n| `khat key add <provider> <id> [--weight <n>] [--value <v>]` | 添加 key（省略 `--value` 时交互式提示） |\r\n| `khat key update <provider> <id> [--weight <n>] [--value <v>]` | 更新 key 权重或机密值 |\r\n| `khat key list [<provider>]` | 列出 key（默认脱敏，仅显示尾 4 位） |\r\n| `khat key remove <provider> <id>` | 删除 key |\r\n| `khat key enable <provider> <id>` | 将被标记不可用的 key 恢复为可用 |\r\n| `khat key test <provider> <id> [--model <m>]` | 直连配置的上游发送一次最小请求探活；成功后自动恢复 key，不会仅因探测返回 401/402/429 就标记 key 不可用 |\r\n\r\n### 路由管理\r\n\r\n| 命令 | 说明 |\r\n|---|---|\r\n| `khat route add <model> <provider>` | 添加「模型名 -> Provider」路由 |\r\n| `khat route update <model> <provider>` | 更新模型路由指向的 Provider |\r\n| `khat route list` | 列出所有路由 |\r\n| `khat route remove <model>` | 删除路由 |\r\n\r\n### 环境变量\r\n\r\n| 变量 | 说明 |\r\n|---|---|\r\n| `KHAT_HOME` | 数据目录（默认 `~/.khat`） |\r\n| `KHAT_ACCESS_TOKEN` | 覆盖密钥库中的访问密钥（主要供测试） |\r\n\r\n## 常见异常与处理\r\n\r\n### Key 不可用与自动切换\r\n\r\n代理转发路径上，上游返回 **401**（鉴权失败）、**402**（余额耗尽）或 **429**（限流）时，当前 key 会被标记为不可用并跳过，请求自动切换到同一 Provider 的其他可用 key 重发（仅在响应首字节返回前）。若该 Provider 下所有 key 都不可用，请求返回错误。\r\n\r\n- **查看**：`khat status` / `khat key list` 中该 key 显示为 `unavailable`，并附最近一次错误（HTTP 状态与时间）。\r\n- **恢复**：`khat key enable <provider> <id>` 手动恢复；或 `khat key test <provider> <id>` 探活，成功后自动恢复。\r\n- **注意**：`key test` 直接连接上游探测，**不会**因返回 401/402/429 就把 key 标记为不可用——不可用标记只发生在代理转发路径上。\r\n\r\n### CLI 常见报错\r\n\r\n| 报错信息 | 原因 | 处理 |\r\n|---|---|---|\r\n| `not initialized; run 'khat init' first` | 数据目录尚无密钥库 | 先执行 `khat init` |\r\n| `no access token found; run khat init` | 密钥库无访问令牌 | `khat init`，或用 `KHAT_ACCESS_TOKEN` 提供 |\r\n| `port <n> is already occupied by process <pid>` | 端口被其它进程占用 | `khat stop`，或用 `taskkill /PID <pid> /T /F` 结束占用进程 |\r\n| `daemon started but health check failed` | 后台 daemon 启动异常 | `khat start --foreground` 前台运行观察日志 |\r\n| `--weight must be a positive integer` | 权重不是正整数 | 传入 ≥1 的整数 |\r\n| `unknown provider: <x>` / `unknown key: <x/y>` | 引用了不存在的 Provider / Key | 用 `khat provider list` / `khat key list` 核对 |\r\n| `khat service is not installed` | service 注册不存在 | `khat service install` |\r\n| `could not register the scheduled task` | Windows 计划任务注册失败 | 检查任务调度器权限，运行 `schtasks /Query /TN khat` 确认 |\r\n| `could not load the launch agent` | macOS launchd 加载失败 | 检查 `~/Library/LaunchAgents/local.khat.plist` 是否被手动删除，运行 `launchctl list local.khat` |\r\n| `could not enable the service` | Linux systemd 启用失败 | 检查 `~/.config/systemd/user/khat.service` 是否被删除，运行 `systemctl --user is-enabled khat` |\r\n| 代理端口连接被拒绝（ECONNREFUSED） | daemon 已退出且未恢复 | 查看 `~/.khat/service.log` 与 `~/.khat/logs/daemon-error.log`；`khat start` 重新拉起 |","readmeFilename":"README.md"}