{"_id":"@apiary-gateway/sdk","_rev":"4-f8d7fbc3f78ac143dbdfab016ee38f7b","name":"@apiary-gateway/sdk","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@apiary-gateway/sdk","version":"1.0.0","keywords":[],"author":"","license":"ISC","_id":"@apiary-gateway/sdk@1.0.0","maintainers":[{"name":"phonzay1","email":"phonzay1@gmail.com"}],"dist":{"shasum":"c3431b1661108f18f5e0d6885b976c64c32b53e3","tarball":"https://registry.npmjs.org/@apiary-gateway/sdk/-/sdk-1.0.0.tgz","fileCount":10,"integrity":"sha512-mtwDbnEtfHc+rdGuCp/N4h3iZuJaIAy9Rhwo4d1rwGxop+6KXnG/mInenIGuy6+Q3DB0N8KX6VgkqsF3VNXCnA==","signatures":[{"sig":"MEYCIQDv5pasBEYXqJI4qNRTuMcDEi+sdGHrQ0d2S569X+i4tAIhAPEuP5TL9fZ4wq+JYwa6XhAMS20IUCk0DPl9kv1BUtjk","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11908},"main":"dist/src/index.js","types":"dist/src/index.d.ts","gitHead":"9915b5738bd66ba812697b204311fd05b9c4dae7","scripts":{"test":"vitest"},"_npmUser":{"name":"phonzay1","email":"phonzay1@gmail.com"},"_npmVersion":"9.2.0","description":"A TypeScript-based client for interacting with Apiary LLM Gateway","directories":{},"_nodeVersion":"18.19.1","dependencies":{"axios":"^1.8.4"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.1.1","typescript":"^5.8.3","@types/node":"^22.14.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.0_1745425673344_0.00961026740349502","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@apiary-gateway/sdk","version":"1.0.1","keywords":[],"author":"","license":"ISC","_id":"@apiary-gateway/sdk@1.0.1","maintainers":[{"name":"phonzay1","email":"phonzay1@gmail.com"},{"name":"kjpoccia","email":"kjpoccia@gmail.com"}],"dist":{"shasum":"9a64f82afd3aa96366003acf47371c1e8f4d763e","tarball":"https://registry.npmjs.org/@apiary-gateway/sdk/-/sdk-1.0.1.tgz","fileCount":10,"integrity":"sha512-4Ns8jKRXSFQ/FJlpjlpxExF8uIaS4bIQIQejoYyQm3oy2cRYNwZgGoHiItNeOY5VCIXUVvLZMGCGPnYldtNI/g==","signatures":[{"sig":"MEYCIQDrieaQccK4cq30snulz2YFkVJj+Ma2/+HWZnQWYKjQ7AIhAPmHSvQ0dqCWmfqC3z4mZZ6oGdqwjWPekV7YNfsJheR1","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12761},"main":"dist/src/index.js","types":"dist/src/index.d.ts","gitHead":"8492203d0aff9bc0d76b29ce7c40fc7c8d93d05d","scripts":{"test":"vitest"},"_npmUser":{"name":"phonzay1","email":"phonzay1@gmail.com"},"_npmVersion":"9.2.0","description":"A TypeScript client for the Apiary LLM Gateway","directories":{},"_nodeVersion":"18.19.1","dependencies":{"axios":"^1.8.4"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.1.2","typescript":"^5.8.3","@types/node":"^22.14.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.1_1746037911294_0.7556501719656061","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@apiary-gateway/sdk","version":"1.0.2","description":"A TypeScript client for the Apiary LLM Gateway","main":"dist/src/index.js","types":"dist/src/index.d.ts","scripts":{"test":"vitest"},"keywords":[],"author":"","license":"ISC","dependencies":{"axios":"^1.8.4"},"devDependencies":{"@types/node":"^22.14.0","typescript":"^5.8.3","vitest":"^3.1.2"},"gitHead":"8492203d0aff9bc0d76b29ce7c40fc7c8d93d05d","_id":"@apiary-gateway/sdk@1.0.2","_nodeVersion":"18.19.1","_npmVersion":"9.2.0","dist":{"integrity":"sha512-NjjFKpWbL5gOVLq6PVzVCDK1Oaurm4VpSYgx4aZsM9XyTiGkWr8fpSQIUeUX2Xz9SGEioBw1DZoz3ug0ZyYo2Q==","shasum":"7da13f728b84394c0690a93974ad2763f352e12e","tarball":"https://registry.npmjs.org/@apiary-gateway/sdk/-/sdk-1.0.2.tgz","fileCount":10,"unpackedSize":12761,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCsEI/UecUlfSpPv3z2iTMotCIWOsRas6Jot7EyZm1pfgIgPIQjbBhjH5EqS6Nl/jnWS6qci6baXFkSMqIxOty9dis="}]},"_npmUser":{"name":"phonzay1","email":"phonzay1@gmail.com"},"directories":{},"maintainers":[{"name":"phonzay1","email":"phonzay1@gmail.com"},{"name":"kjpoccia","email":"kjpoccia@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_1.0.2_1746041314873_0.1617130225371417"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-23T16:27:53.240Z","modified":"2025-04-30T19:28:35.302Z","1.0.0":"2025-04-23T16:27:53.513Z","1.0.1":"2025-04-30T18:31:51.476Z","1.0.2":"2025-04-30T19:28:35.058Z"},"license":"ISC","keywords":[],"description":"A TypeScript client for the Apiary LLM Gateway","maintainers":[{"name":"phonzay1","email":"phonzay1@gmail.com"},{"name":"kjpoccia","email":"kjpoccia@gmail.com"}],"readme":"# Apiary SDK\n\nApiary is an open-source LLM Gateway for managing requests across leading providers. It routes all LLM requests through a single API endpoint, simplifying access to multiple models with a unified API, centralized management of features like routing, caching, and guardrails, and built-in observability.\n\nUse the Apiary TypeScript SDK in your applications to easily send client requests to multiple LLM providers.\n\n## Supported Providers\n\n* Anthropic\n* Gemini\n* OpenAI\n\n## Setup\n\n### Prerequisites\nTo send LLM requests using the Apiary SDK, you must have a running Apiary instance set up\nin your AWS account. Follow the setup instructions in our [installation guide](https://github.com/Apiary-gateway/cli) to easily deploy Apiary's infrastructure using our CLI tool.\n\nThe deployment process will provide an `AiGatewayRestApiEndpoint` URL and API key that you can use\nto send LLM requests with the Apiary SDK.\n\n### Installation\n\nTo install the Apiary SDK, run the following command:\n```bash\nnpm install @apiary-gateway/sdk\n```\n\n### Usage\n\nImport the Apiary client and initialize an instance with your configuration details. \n\nCall the `chatCompletion` method with a prompt (required). \nA `threadID` may also be provided to include conversation context with the prompt. \nOptionally, specify the LLM provider and model to override your configuration details for these fields. \n\n```ts\nimport Apiary from '@apiary-gateway/sdk';\n\n// Initialize the Apiary client\nconst client = new Apiary({\n  apiKey: '<YOUR_API_KEY>',\n  baseUrl: 'https://<YOUR_GATEWAY_URL>.com',\n  // Optionally include a userId to partition cache responses based on userId\n  userId: '<userId>',\n  // Optionally include a metadata object with your custom routing configuration groups\n  metadata: {\n    user-type: 'pro-users'\n  },\n});\n\nconst main = async () => {\n  const completion = await client.chatCompletion(\n    // Example prompt\n    'Do all bees make honey?',\n    // Optionally include a `threadID` to manage conversation context \n    '1745267450008',\n    // Optionally specify the provider and model to override your configuration defaults\n    'openai',\n    'gpt-4',\n  );\n\n  // Log the returned LLM response\n  console.log(completion.response.text);\n\n  // Log the threadID for the returned LLM response\n  console.log(completion.threadID);\n}\n\nmain();\n```\n","readmeFilename":"README.md"}