{"_id":"@assistant-hub/sdk","_rev":"5-5284b7bf801a523de668f394520ebca3","name":"@assistant-hub/sdk","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.1":{"name":"@assistant-hub/sdk","version":"0.0.1","keywords":["ai","gateway","openai","llm","ai-gateway","assistant-hub","assistant-ui","model-routing","api-client"],"license":"MIT","_id":"@assistant-hub/sdk@0.0.1","maintainers":[{"name":"okisdev","email":"acc@okis.dev"}],"homepage":"https://hub.assistant-ui.com","bugs":{"url":"https://github.com/assistant-ui/assistant-hub/issues"},"dist":{"shasum":"6e9a7630bec5eb6df1da46c00dc4a806cec47172","tarball":"https://registry.npmjs.org/@assistant-hub/sdk/-/sdk-0.0.1.tgz","fileCount":6,"integrity":"sha512-mouNXkWiQZRrXMUw6kkzuP4n/UZT2LSto/qVkkiiRdGieLhOMucHB+xZFzwHDXmUhDGWbL+1CEyt5CZ2HNE6NQ==","signatures":[{"sig":"MEUCIQDieG2lGCp2gWfNuENOj1EowTGb4/gSFw7qCBalFpEY9AIgWhmpzTu7srQ+Pt64/Se6wDfX+BTzOIpO+R5p9jTiaOA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27238},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"67c064acc7a8203e338467e1987a0cf4cc445d92","scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","build":"tsup src/index.ts --format cjs,esm --dts --clean","deps:check":"npx taze major -f","deps:update":"npx taze major -f -w && pnpm install","deps:update:no-install":"npx taze major -f -w"},"_npmUser":{"name":"okisdev","email":"acc@okis.dev"},"repository":{"url":"git+https://github.com/assistant-ui/assistant-hub.git","type":"git","directory":"packages/sdk"},"_npmVersion":"11.11.0","description":"Client SDK for Assistant Hub AI Gateway — OpenAI-compatible API with smart routing, caching, and analytics","directories":{},"sideEffects":false,"_nodeVersion":"25.8.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","typescript":"catalog:"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.0.1_1772778276338_0.9833636432482489","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@assistant-hub/sdk","version":"0.0.2","keywords":["ai","gateway","openai","llm","ai-gateway","assistant-hub","assistant-ui","model-routing","api-client"],"license":"MIT","_id":"@assistant-hub/sdk@0.0.2","maintainers":[{"name":"okisdev","email":"acc@okis.dev"},{"name":"yonom","email":"simon.farshid@outlook.com"}],"homepage":"https://hub.assistant-ui.com","bugs":{"url":"https://github.com/assistant-ui/assistant-hub/issues"},"dist":{"shasum":"7b4de0635ec88a21c2d2e2d5c944ccf3bfc5e253","tarball":"https://registry.npmjs.org/@assistant-hub/sdk/-/sdk-0.0.2.tgz","fileCount":10,"integrity":"sha512-gQiqh0oDIh7ew9iGnj27Id05pVZch8Zvb8w+ZgTA+sbuJ1ILF71tX4TBsqeRgrUsRi9mZbrYO0zNK4vJGQOmjA==","signatures":[{"sig":"MEUCIQDRp+cufZhzmf5xNWGr9m/ImWpwJsMyJFWe62+SCFnXsAIgMspiECb9Iz6lsgRyss8gVGK76BYWQ4b9WLRswxSMXA0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":38369},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./ai-sdk":{"import":{"types":"./dist/ai-sdk.d.ts","default":"./dist/ai-sdk.mjs"},"require":{"types":"./dist/ai-sdk.d.cts","default":"./dist/ai-sdk.cjs"}}},"gitHead":"fee64c8351503a723c153583bc9e6895165eef8b","scripts":{"dev":"tsup src/index.ts src/ai-sdk.ts --format cjs,esm --dts --watch","build":"tsup src/index.ts src/ai-sdk.ts --format cjs,esm --dts --clean","deps:check":"npx taze major -f","deps:update":"npx taze major -f -w && pnpm install","deps:update:no-install":"npx taze major -f -w"},"_npmUser":{"name":"okisdev","email":"acc@okis.dev"},"repository":{"url":"git+https://github.com/assistant-ui/assistant-hub.git","type":"git","directory":"packages/sdk"},"_npmVersion":"11.11.0","description":"Client SDK for Assistant Hub AI Gateway — OpenAI-compatible API with smart routing, caching, and analytics","directories":{},"sideEffects":false,"_nodeVersion":"25.8.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","typescript":"catalog:","@ai-sdk/openai-compatible":"^2.0.35"},"peerDependencies":{"@ai-sdk/openai-compatible":"^2.0.0"},"peerDependenciesMeta":{"@ai-sdk/openai-compatible":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.0.2_1772823127934_0.26491403269164193","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@assistant-hub/sdk","version":"0.0.3","keywords":["ai","gateway","openai","llm","ai-gateway","assistant-hub","assistant-ui","model-routing","api-client"],"license":"MIT","_id":"@assistant-hub/sdk@0.0.3","maintainers":[{"name":"okisdev","email":"acc@okis.dev"},{"name":"yonom","email":"simon.farshid@outlook.com"}],"homepage":"https://hub.assistant-ui.com","bugs":{"url":"https://github.com/assistant-ui/assistant-hub/issues"},"dist":{"shasum":"32098a619067f1a6218b3c315469c8db3962b2e0","tarball":"https://registry.npmjs.org/@assistant-hub/sdk/-/sdk-0.0.3.tgz","fileCount":10,"integrity":"sha512-I9QWSXDzxOntoAnXH7CDdEN5IRQVs22Z2AIcv/RXUSlvC2wTcqJkRORE4oS+unYfu7IGKxSY4D148uaqbbw0xA==","signatures":[{"sig":"MEYCIQDXTy6mxeYf8CslbwEMuYQ5DSHPIWpDwWWvunrong4NpwIhAJruv319Q/ahl4AJ8yny7iEGrsf8PYtgNQNd2Aeck+Oa","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":42280},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./ai-sdk":{"import":{"types":"./dist/ai-sdk.d.ts","default":"./dist/ai-sdk.js"},"require":{"types":"./dist/ai-sdk.d.cts","default":"./dist/ai-sdk.cjs"}}},"gitHead":"48e8765f278ab4b62cba7fb7fa13985a383b8dcd","scripts":{"dev":"tsup src/index.ts src/ai-sdk.ts --format cjs,esm --dts --watch","build":"tsup src/index.ts src/ai-sdk.ts --format cjs,esm --dts --clean","deps:check":"npx taze major -f","deps:update":"npx taze major -f -w && pnpm install","deps:update:no-install":"npx taze major -f -w"},"_npmUser":{"name":"okisdev","email":"acc@okis.dev"},"repository":{"url":"git+https://github.com/assistant-ui/assistant-hub.git","type":"git","directory":"packages/sdk"},"_npmVersion":"11.11.0","description":"Client SDK for Assistant Hub AI Gateway — OpenAI-compatible API with smart routing, caching, and analytics","directories":{},"sideEffects":false,"_nodeVersion":"25.8.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","typescript":"catalog:","@ai-sdk/openai-compatible":"^2.0.35"},"peerDependencies":{"@ai-sdk/openai-compatible":"^2.0.0"},"peerDependenciesMeta":{"@ai-sdk/openai-compatible":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.0.3_1772824550316_0.0814087681208795","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@assistant-hub/sdk","version":"0.0.4","description":"Client SDK for Assistant Hub AI Gateway — OpenAI-compatible API with smart routing, caching, and analytics","sideEffects":false,"type":"module","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./ai-sdk":{"import":{"types":"./dist/ai-sdk.d.ts","default":"./dist/ai-sdk.js"},"require":{"types":"./dist/ai-sdk.d.cts","default":"./dist/ai-sdk.cjs"}}},"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"tsup src/index.ts src/ai-sdk.ts --format cjs,esm --dts --clean","dev":"tsup src/index.ts src/ai-sdk.ts --format cjs,esm --dts --watch","deps:check":"npx taze major -f","deps:update":"npx taze major -f -w && pnpm install","deps:update:no-install":"npx taze major -f -w"},"keywords":["ai","gateway","openai","llm","ai-gateway","assistant-hub","assistant-ui","model-routing","api-client"],"license":"MIT","homepage":"https://hub.assistant-ui.com","repository":{"type":"git","url":"git+https://github.com/assistant-ui/assistant-hub.git","directory":"packages/sdk"},"bugs":{"url":"https://github.com/assistant-ui/assistant-hub/issues"},"peerDependencies":{"@ai-sdk/openai-compatible":"^2.0.0"},"peerDependenciesMeta":{"@ai-sdk/openai-compatible":{"optional":true}},"devDependencies":{"@ai-sdk/openai-compatible":"^2.0.35","tsup":"^8.5.1","typescript":"catalog:"},"gitHead":"77ec747ebcab01cb0de3a95674cf48773c2ff1aa","_id":"@assistant-hub/sdk@0.0.4","_nodeVersion":"25.8.0","_npmVersion":"11.11.0","dist":{"integrity":"sha512-vLwsPOQ1qwDRoIpi/UP7A8iAb9JdzSrQFFYjBV8CqAhR0K0ARh8avtIQcYUbbBf9NwU0jK1Ma6DI5bJEjYFBvQ==","shasum":"54fd2e4838a2690a8355a82100cbddb8379c568d","tarball":"https://registry.npmjs.org/@assistant-hub/sdk/-/sdk-0.0.4.tgz","fileCount":10,"unpackedSize":42280,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEms2m42y3dNrrHPs/wQxcNEaYZedyKdJiTvw9vCB6wIAiEAridQolPzHzxbcBgG8oLiWJVAiqBf49wkQg28Gdr+eJQ="}]},"_npmUser":{"name":"okisdev","email":"acc@okis.dev"},"directories":{},"maintainers":[{"name":"okisdev","email":"acc@okis.dev"},{"name":"yonom","email":"simon.farshid@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.0.4_1772829693925_0.8626376522539938"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-06T06:24:36.221Z","modified":"2026-03-06T20:41:34.189Z","0.0.1":"2026-03-06T06:24:36.465Z","0.0.2":"2026-03-06T18:52:08.058Z","0.0.3":"2026-03-06T19:15:50.479Z","0.0.4":"2026-03-06T20:41:34.049Z"},"bugs":{"url":"https://github.com/assistant-ui/assistant-hub/issues"},"license":"MIT","homepage":"https://hub.assistant-ui.com","keywords":["ai","gateway","openai","llm","ai-gateway","assistant-hub","assistant-ui","model-routing","api-client"],"repository":{"type":"git","url":"git+https://github.com/assistant-ui/assistant-hub.git","directory":"packages/sdk"},"description":"Client SDK for Assistant Hub AI Gateway — OpenAI-compatible API with smart routing, caching, and analytics","maintainers":[{"name":"okisdev","email":"acc@okis.dev"},{"name":"yonom","email":"simon.farshid@outlook.com"}],"readme":"# @assistant-hub/sdk\n\nClient SDK for [Assistant Hub](https://hub.assistant-ui.com) AI Gateway.\n\nDrop-in replacement for the OpenAI SDK — just change the base URL and API key.\n\n## Install\n\n```bash\nnpm install @assistant-hub/sdk\n```\n\n## Environment Variables\n\nThe SDK reads these automatically — no configuration needed:\n\n```env\nASSISTANT_HUB_API_KEY=sk_hub_...\nASSISTANT_HUB_BASE_URL=https://api.aichat.new   # optional, this is the default\n```\n\n## Quick Start\n\n```typescript\nimport { HubClient } from \"@assistant-hub/sdk\";\n\n// Reads ASSISTANT_HUB_API_KEY and ASSISTANT_HUB_BASE_URL from env\nconst hub = new HubClient();\n\nconst response = await hub.chat.completions.create({\n  model: \"gpt-4o\",\n  messages: [{ role: \"user\", content: \"Hello!\" }],\n});\n\nconsole.log(response.choices[0].message.content);\n```\n\n## Vercel AI SDK Integration\n\nUse `@assistant-hub/sdk/ai-sdk` for seamless integration with the [Vercel AI SDK](https://sdk.vercel.ai):\n\n```typescript\nimport { createHub } from \"@assistant-hub/sdk/ai-sdk\";\nimport { generateText } from \"ai\";\n\n// Reads env vars automatically\nconst hub = createHub();\n\nconst { text } = await generateText({\n  model: hub(\"gpt-4o\"),\n  prompt: \"Hello!\",\n});\n```\n\nOr use the pre-configured default instance:\n\n```typescript\nimport { hub } from \"@assistant-hub/sdk/ai-sdk\";\nimport { streamText } from \"ai\";\n\nconst result = streamText({\n  model: hub(\"claude-sonnet-4-20250514\"),\n  prompt: \"Write a haiku\",\n});\n```\n\nYou can also pass options explicitly:\n\n```typescript\nconst hub = createHub({\n  apiKey: \"sk_hub_...\",\n  baseURL: \"https://your-gateway.example.com/v1\",\n});\n```\n\n## Streaming\n\n```typescript\nconst stream = await hub.chat.completions.create({\n  model: \"claude-sonnet-4-20250514\",\n  messages: [{ role: \"user\", content: \"Write a haiku\" }],\n  stream: true,\n});\n\nfor await (const chunk of stream) {\n  process.stdout.write(chunk.choices[0]?.delta?.content ?? \"\");\n}\n```\n\n## Embeddings\n\n```typescript\nconst embeddings = await hub.embeddings.create({\n  model: \"text-embedding-3-small\",\n  input: \"Hello world\",\n});\n```\n\n## List Models\n\n```typescript\nconst models = await hub.models.list();\n```\n\n## Context Builders\n\nChain context for request tracking:\n\n```typescript\nconst response = await hub\n  .withUser(\"user-123\")\n  .withMetadata({ session: \"abc\" })\n  .withProvider(\"openai\")\n  .chat.completions.create({\n    model: \"gpt-4o\",\n    messages: [{ role: \"user\", content: \"Hello\" }],\n  });\n```\n\n## Feedback & Scores\n\nSubmit a single feedback score:\n\n```typescript\nawait hub.feedback(\"hrl_xxx\", 5);\n```\n\nSubmit multiple scores at once (including boolean scores):\n\n```typescript\nawait hub.scores(\"hrl_xxx\", {\n  quality: 5,\n  relevance: 3,\n  thumbs_up: true,\n});\n```\n\n## Configuration\n\n```typescript\nconst hub = new HubClient({\n  apiKey: \"sk_hub_...\",                           // or ASSISTANT_HUB_API_KEY env var\n  baseURL: \"https://your-gateway.aichat.new\",     // or ASSISTANT_HUB_BASE_URL env var\n  timeout: 30_000,                                // optional, default 60s\n  defaultHeaders: { \"X-Custom\": \"value\" },        // optional\n});\n```\n\n## Works with OpenAI SDK\n\nYou can also use the official OpenAI SDK directly:\n\n```typescript\nimport OpenAI from \"openai\";\n\nconst client = new OpenAI({\n  apiKey: process.env.ASSISTANT_HUB_API_KEY,\n  baseURL: \"https://api.aichat.new/v1\",\n});\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}