{"_id":"@akaknele/aihubmix-auth","_rev":"2-94305a05777f23794b8d400770ad3c25","name":"@akaknele/aihubmix-auth","dist-tags":{"latest":"2026.2.21"},"versions":{"2026.2.20":{"name":"@akaknele/aihubmix-auth","version":"2026.2.20","_id":"@akaknele/aihubmix-auth@2026.2.20","maintainers":[{"name":"akaken","email":"akakenle@gmail.com"}],"dist":{"shasum":"f0aeaca8eece993acf9993e2a607117231473671","tarball":"https://registry.npmjs.org/@akaknele/aihubmix-auth/-/aihubmix-auth-2026.2.20.tgz","fileCount":4,"integrity":"sha512-FnXNCtFNsJfRmYAHSuoy5J/Eq1yEwtKkDUe2fIkWcFz1Thz3HfiS/it4DwIQtQsoTtm0yI3zBCgfN2SH7mCXHQ==","signatures":[{"sig":"MEUCIEsx/SYR+M7F0Yasqky1kw8VO+pYlSeT3BtVKgiBi8TbAiEAxsqQ1EReqSbTf6YjBhg825bz40PeqsuaLs03iKFH+ww=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16362},"type":"module","gitHead":"d833dcd731875262cdffe3fc60137dfaf53e16b3","_npmUser":{"name":"akaken","email":"akakenle@gmail.com"},"openclaw":{"extensions":["./index.ts"]},"_npmVersion":"11.3.0","description":"OpenClaw AIHubmix API provider plugin","directories":{},"_nodeVersion":"23.6.1","_hasShrinkwrap":false,"devDependencies":{"openclaw":"workspace:*"},"_npmOperationalInternal":{"tmp":"tmp/aihubmix-auth_2026.2.20_1771581189288_0.20201414842839838","host":"s3://npm-registry-packages-npm-production"}},"2026.2.21":{"name":"@akaknele/aihubmix-auth","version":"2026.2.21","description":"OpenClaw AIHubmix API provider plugin","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./openclaw.plugin.json":"./openclaw.plugin.json"},"scripts":{"build":"tsc -p tsconfig.json","test":"vitest run","prepare":"npm run build","prepublishOnly":"npm run build"},"devDependencies":{"@types/node":"^22.10.0","openclaw":"^2026.6.6","typescript":"^5.6.3","vitest":"^2.1.5"},"peerDependencies":{"openclaw":">=2026.5.27"},"openclaw":{"extensions":["./dist/index.js"],"runtimeExtensions":["./dist/index.js"],"compat":{"pluginApi":">=2026.5.27"},"install":{"npmSpec":"@akaknele/aihubmix-auth@2026.2.21","minHostVersion":">=2026.5.27"}},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/akakenle/aihubmix-auth.git"},"bugs":{"url":"https://github.com/akakenle/aihubmix-auth/issues"},"homepage":"https://github.com/akakenle/aihubmix-auth#readme","_id":"@akaknele/aihubmix-auth@2026.2.21","_integrity":"sha512-AT5abYY2mI68xEdzk7XhAnf1lJMy8Jcs+EbB2HHYJsbvL4+mJUgK4RvVztwlQfh/YZ94eF4WWkSkIHZJjfTu/w==","_resolved":"/private/tmp/aihubmix-auth-publish/akaknele-aihubmix-auth-2026.2.21.tgz","_from":"file:akaknele-aihubmix-auth-2026.2.21.tgz","_nodeVersion":"23.6.1","_npmVersion":"11.3.0","dist":{"integrity":"sha512-AT5abYY2mI68xEdzk7XhAnf1lJMy8Jcs+EbB2HHYJsbvL4+mJUgK4RvVztwlQfh/YZ94eF4WWkSkIHZJjfTu/w==","shasum":"51af7234034cad6a83736874e64ce07ca0bf8572","tarball":"https://registry.npmjs.org/@akaknele/aihubmix-auth/-/aihubmix-auth-2026.2.21.tgz","fileCount":6,"unpackedSize":22493,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDaW9R5xBUHmxF5dk5diBI/R/RlIRt/nrSpzV0tc0qynAIhANEnMcKB5Zn4npMI3W0syl8q6HWp/cCaSSbSYtVYtcOD"}]},"_npmUser":{"name":"akaken","email":"akakenle@gmail.com"},"directories":{},"maintainers":[{"name":"akaken","email":"akakenle@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/aihubmix-auth_2026.2.21_1781526779171_0.7264367172274073"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-20T09:53:09.163Z","modified":"2026-06-15T12:32:59.427Z","2026.2.20":"2026-02-20T09:53:09.425Z","2026.2.21":"2026-06-15T12:32:59.292Z"},"description":"OpenClaw AIHubmix API provider plugin","maintainers":[{"name":"akaken","email":"akakenle@gmail.com"}],"readme":"# @akaknele/aihubmix-auth\n\nOpenClaw provider-auth plugin for AIHubMix. Routes OpenAI, Anthropic, and\nGemini model calls through AIHubMix's unified endpoint.\n\n## Requirements\n\n- OpenClaw **2026.5.27 or newer** (the `openclaw.compat.pluginApi` floor for\n  this plugin)\n- Node.js 22.19+ (TypeScript ESM module support)\n\n## Install\n\n```bash\nopenclaw plugins install @akaknele/aihubmix-auth\nopenclaw gateway restart\n```\n\nThe package ships prebuilt JavaScript at `dist/index.js` and a manifest at\n`openclaw.plugin.json`, so OpenClaw does not need to compile TypeScript at\ninstall time.\n\n## Login and sync models\n\n```bash\nopenclaw models auth login --provider aihubmix-openai --method api-key --set-default\n```\n\nThe same one-shot key is shared across all four transports\n(`aihubmix-openai`, `aihubmix-anthropic`, `aihubmix-google`, `aihubmix-other`)\nbecause the SDK stores credentials against the alias root and resolves them\nfor the matching transport at request time. You can run the same command\nagainst `--provider aihubmix-anthropic`, `--provider aihubmix-google`, or\n`--provider aihubmix-other`; only one needs to be configured.\n\nAfter login, the plugin pulls the latest model catalog from\n`https://aihubmix.com/api/v1/models?sort_by=order&sort_order=desc` and maps\nresults into four provider buckets, then patches the active OpenClaw config:\n\n- `openai` -> `https://aihubmix.com/v1` (`openai-completions`)\n- `anthropic` -> `https://aihubmix.com` (`anthropic-messages`)\n- `google` -> `https://aihubmix.com/gemini/v1beta` (`google-generative-ai`)\n- `other` -> `https://aihubmix.com/v1` (`openai-completions`)\n\nThe static base URL + api route for each transport is always written to the\nconfig (it is not gated on a key being present). The credential itself is\nstored in the auth-profile by the SDK, so the inline `apiKey` field in\n`models.providers.*` is only set when `AIHUBMIX_API_KEY` was already exported\nin the environment that ran the plugin.\n\nYou can also pre-set the key without going through the wizard:\n\n```bash\nexport AIHUBMIX_API_KEY=sk-...\nopenclaw plugins install @akaknele/aihubmix-auth\n```\n\n## Dynamic models\n\nThe plugin registers a `resolveDynamicModel` hook on every transport so\nshorthand model ids resolve to the correct transport and base URL without\nlisting them in the static catalog first:\n\n- `claude-...` -> `aihubmix-anthropic` (`anthropic-messages`,\n  `https://aihubmix.com`)\n- `gemini-...` -> `aihubmix-google` (`google-generative-ai`,\n  `https://aihubmix.com/gemini/v1beta`)\n- `gpt-...` / `o1-...` / `o3-...` / `o4-...` -> `aihubmix-openai`\n  (`openai-completions`, `https://aihubmix.com/v1`)\n- everything else -> `aihubmix-other` (`openai-completions`,\n  `https://aihubmix.com/v1`)\n\nThe hook only routes a model id to the right transport and base URL; it does\nnot pre-populate token limits or cost data. Static catalog rows from the\nauth-time fetch take precedence when both are available.\n\n## Verifying the install\n\n```bash\nopenclaw plugins inspect aihubmix-auth --runtime --json\n```\n\nThe runtime entrypoint should resolve to the package's `dist/index.js`, and\nthe manifest shape should report the four provider buckets, the per-provider\n`resolveDynamicModel` hook, and the `liveCatalog` hook.\n\n## Local development\n\n```bash\nnpm install\nnpm run build\nnpm test\n```\n\n`npm run build` compiles `index.ts` to `dist/index.js` + `dist/index.d.ts`.\n`npm test` runs the Vitest suite. Run `npm run prepublishOnly` (or rely on\nthe `prepublishOnly` script) before publishing to make sure the published\ntarball contains a fresh `dist/`.\n","readmeFilename":"README.md","homepage":"https://github.com/akakenle/aihubmix-auth#readme","repository":{"type":"git","url":"git+https://github.com/akakenle/aihubmix-auth.git"},"bugs":{"url":"https://github.com/akakenle/aihubmix-auth/issues"},"license":"MIT"}