{"_id":"batch-ai","_rev":"8-e48486cb6fa9ebc87f212fb8ad23e12c","name":"batch-ai","dist-tags":{"latest":"2.1.0"},"versions":{"0.1.0":{"name":"batch-ai","version":"0.1.0","keywords":["ai","batch","openai","anthropic","llm","sdk"],"author":{"name":"Grant Singleton"},"license":"MIT","_id":"batch-ai@0.1.0","maintainers":[{"name":"grantwsingleton","email":"pangobooks@pangobooks.com"}],"dist":{"shasum":"8bc365258cd5691731d99bc52e43d45f7460d76e","tarball":"https://registry.npmjs.org/batch-ai/-/batch-ai-0.1.0.tgz","fileCount":12,"integrity":"sha512-iiKtHkJjdp3jbwJe2aDUDw/DmcPeIBsoWjIDDoSxU+I8vpdsdbNegG6C09umxOdXKsb5qzO0a3KQFnkPE4Nbeg==","signatures":[{"sig":"MEYCIQCtO2OU/xDZ40+pEDDubRYQbLwZMBnUf+1Sxro3+EnGUwIhAIIFCLHJfs9c+PHIi4DWMKZY42vc6jm8N0JLfHUKIYdt","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31005},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"c00c4f0e78c3d0f9d220437f358832e3bddc4153","scripts":{"lint":"eslint .","test":"jest","build":"tsc","watch":"tsc --watch","version":"git add -A src","preversion":"npm run lint","postversion":"git push && git push --tags","prepublishOnly":"npm test && npm run lint"},"_npmUser":{"name":"grantwsingleton","email":"pangobooks@pangobooks.com"},"_npmVersion":"10.8.2","description":"A unified SDK for making batch AI requests across different model providers","directories":{},"_nodeVersion":"20.12.2","dependencies":{"zod":"^3.24.1","openai":"^4.83.0","@anthropic-ai/sdk":"^0.36.3","zod-to-json-schema":"^3.24.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9.20.1","ts-jest":"^29.1.2","typescript":"^5.7.3","@types/jest":"^29.5.12","@types/node":"^20.11.17","@typescript-eslint/parser":"^8.24.0","@typescript-eslint/eslint-plugin":"^8.24.0"},"peerDependencies":{"typescript":">=4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/batch-ai_0.1.0_1739559899523_0.5545892246723712","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"batch-ai","version":"0.1.2","keywords":["ai","batch","openai","anthropic","llm","sdk"],"author":{"name":"Grant Singleton"},"license":"MIT","_id":"batch-ai@0.1.2","maintainers":[{"name":"grantwsingleton","email":"pangobooks@pangobooks.com"}],"homepage":"https://github.com/grantsingleton/batch-ai#readme","bugs":{"url":"https://github.com/grantsingleton/batch-ai/issues"},"dist":{"shasum":"4fd263e72772646f09eb3f7013f3b299a99df037","tarball":"https://registry.npmjs.org/batch-ai/-/batch-ai-0.1.2.tgz","fileCount":12,"integrity":"sha512-LC7ZJXStULk7QhzIzz1AaDjTFwCc+Z9TXaIUi+dnuK0TzWqXySn7/Ij+rxa9kSnrvC3Wih261VBVHDh8OyrMeQ==","signatures":[{"sig":"MEQCIE8fULR+TKdShlqPtn6xqliuPRFsg+M43OhlcERDCTMoAiAolJ/nWwF85vAsRsjLH6wXDUThLCh/KCaTTvgKsGZWsg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31271},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"4cdc3d98825831d18464b3fd50b6f7616ff00e4d","scripts":{"lint":"eslint .","test":"jest","build":"tsc","watch":"tsc --watch","version":"git add -A src","preversion":"npm run lint","postversion":"git push && git push --tags","prepublishOnly":"npm test && npm run lint"},"_npmUser":{"name":"grantwsingleton","email":"pangobooks@pangobooks.com"},"repository":{"url":"git+https://github.com/grantsingleton/batch-ai.git","type":"git"},"_npmVersion":"10.8.2","description":"A unified SDK for making batch AI requests across different model providers","directories":{},"_nodeVersion":"20.12.2","dependencies":{"zod":"^3.24.1","openai":"^4.83.0","@anthropic-ai/sdk":"^0.36.3","zod-to-json-schema":"^3.24.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9.20.1","ts-jest":"^29.1.2","typescript":"^5.7.3","@types/jest":"^29.5.12","@types/node":"^20.11.17","@typescript-eslint/parser":"^8.24.0","@typescript-eslint/eslint-plugin":"^8.24.0"},"peerDependencies":{"typescript":">=4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/batch-ai_0.1.2_1739560262287_0.8601079988552123","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"batch-ai","version":"0.1.4","keywords":["ai","batch","openai","anthropic","llm","sdk"],"author":{"name":"Grant Singleton"},"license":"MIT","_id":"batch-ai@0.1.4","maintainers":[{"name":"grantwsingleton","email":"pangobooks@pangobooks.com"}],"homepage":"https://github.com/grantsingleton/batch-ai#readme","bugs":{"url":"https://github.com/grantsingleton/batch-ai/issues"},"dist":{"shasum":"33a78a86e624b5efab7b8261205b358368f90213","tarball":"https://registry.npmjs.org/batch-ai/-/batch-ai-0.1.4.tgz","fileCount":12,"integrity":"sha512-VuPwif/J8oeJqNSPlj4UCr6stxJ+AMrRse/EwZZ/JFIo56d5vdREnfwGVs2V2szVgC7NwKW/nL8Y1OIBspuKIw==","signatures":[{"sig":"MEQCIB/krJPDrXl/pY4cfBf78gubFswfQ5Ia4n7mAWsXNWVeAiBQfTJYpqP/VJjO+oQw8VQJrpnHmTagb2t0EaCLNf0DgQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31372},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"b99d8743f2cde5ba756439a3be60dbaf893afba1","scripts":{"lint":"eslint .","test":"jest","build":"tsc && tsc -p tsconfig.cjs.json && node scripts/prepare-dist.js","watch":"tsc --watch","version":"git add -A src","preversion":"npm run lint","postversion":"git push && git push --tags","prepublishOnly":"npm test && npm run lint"},"_npmUser":{"name":"grantwsingleton","email":"pangobooks@pangobooks.com"},"repository":{"url":"git+https://github.com/grantsingleton/batch-ai.git","type":"git"},"_npmVersion":"10.8.2","description":"A unified SDK for making batch AI requests across different model providers","directories":{},"_nodeVersion":"20.12.2","dependencies":{"zod":"^3.24.1","openai":"^4.83.0","@anthropic-ai/sdk":"^0.36.3","zod-to-json-schema":"^3.24.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9.20.1","ts-jest":"^29.1.2","typescript":"^5.7.3","@types/jest":"^29.5.12","@types/node":"^20.11.17","@typescript-eslint/parser":"^8.24.0","@typescript-eslint/eslint-plugin":"^8.24.0"},"peerDependencies":{"typescript":">=4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/batch-ai_0.1.4_1739632515006_0.05339414908611939","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"batch-ai","version":"0.1.6","keywords":["ai","batch","openai","anthropic","llm","sdk"],"author":{"name":"Grant Singleton"},"license":"MIT","_id":"batch-ai@0.1.6","maintainers":[{"name":"grantwsingleton","email":"pangobooks@pangobooks.com"}],"homepage":"https://github.com/grantsingleton/batch-ai#readme","bugs":{"url":"https://github.com/grantsingleton/batch-ai/issues"},"dist":{"shasum":"327e4ef4363b4d87cefc88fa71911cc44868e9ed","tarball":"https://registry.npmjs.org/batch-ai/-/batch-ai-0.1.6.tgz","fileCount":13,"integrity":"sha512-OeOyAi0sGB1iuqmjaV7pftkQ4ZAjh8E1AxXN2uOU1Gvfu5OurUttRZchaEDb/rNJkicled+VffZc/uSE1va3LA==","signatures":[{"sig":"MEUCIGagsGyxgQg5O7UgWS1h++5MYkxfC37B6pObTfBU2PZSAiEAji+ne/pE6DsLmZgIYE9G+7naM9nk8kL9fFQkD9WdEs0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32196},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"843f13112b4ce0a3dfff34b01422ba3c7a19f2ce","scripts":{"lint":"eslint .","test":"jest","build":"rm -rf dist && npm run build:cjs && mv dist/index.js dist/index.cjs && npm run build:esm","watch":"tsc --watch","version":"git add -A src","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc","preversion":"npm run lint","postversion":"git push && git push --tags","prepublishOnly":"npm test && npm run lint"},"_npmUser":{"name":"grantwsingleton","email":"pangobooks@pangobooks.com"},"repository":{"url":"git+https://github.com/grantsingleton/batch-ai.git","type":"git"},"_npmVersion":"10.8.2","description":"A unified SDK for making batch AI requests across different model providers","directories":{},"_nodeVersion":"20.12.2","dependencies":{"zod":"^3.24.1","openai":"^4.83.0","@anthropic-ai/sdk":"^0.36.3","zod-to-json-schema":"^3.24.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9.20.1","ts-jest":"^29.1.2","typescript":"^5.7.3","@types/jest":"^29.5.12","@types/node":"^20.11.17","@typescript-eslint/parser":"^8.24.0","@typescript-eslint/eslint-plugin":"^8.24.0"},"peerDependencies":{"typescript":">=4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/batch-ai_0.1.6_1739633034355_0.24891279793587207","host":"s3://npm-registry-packages-npm-production"}},"0.1.7":{"name":"batch-ai","version":"0.1.7","keywords":["ai","batch","openai","anthropic","llm","sdk"],"author":{"name":"Grant Singleton"},"license":"MIT","_id":"batch-ai@0.1.7","maintainers":[{"name":"grantwsingleton","email":"grantwsingleton@gmail.com"}],"homepage":"https://github.com/grantsingleton/batch-ai#readme","bugs":{"url":"https://github.com/grantsingleton/batch-ai/issues"},"dist":{"shasum":"d83dc80b496d76d5bc42c46e6550daacf1b20ad0","tarball":"https://registry.npmjs.org/batch-ai/-/batch-ai-0.1.7.tgz","fileCount":13,"integrity":"sha512-mvEVPlPBlqqWjLABBofV069W+/+mU5VgXLardQ9j/ietuAecXdOwWzqRhQOF1SNsh5+tHoLm77+VyvPsYWWuwg==","signatures":[{"sig":"MEUCIQCuRKgTMAJzGIemHVRRQ1DaCITF0Jsx9ZgaQ50UXgGnpwIgGpSnMcchJyLhpPG0KTaWZ33VaJ2we6RyiUqEyIzbJAA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":33481},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"30485bb3e0dfda2a3bde799a27af877e601221db","scripts":{"lint":"eslint .","test":"jest","build":"rm -rf dist && npm run build:cjs && mv dist/index.js dist/index.cjs && npm run build:esm","watch":"tsc --watch","version":"git add -A src","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc","preversion":"npm run lint","postversion":"git push && git push --tags","prepublishOnly":"npm test && npm run lint"},"_npmUser":{"name":"grantwsingleton","email":"grantwsingleton@gmail.com"},"repository":{"url":"git+https://github.com/grantsingleton/batch-ai.git","type":"git"},"_npmVersion":"10.8.2","description":"A unified SDK for making batch AI requests across different model providers","directories":{},"_nodeVersion":"20.12.2","dependencies":{"zod":"^3.24.1","openai":"^4.83.0","@anthropic-ai/sdk":"^0.36.3","zod-to-json-schema":"^3.24.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9.20.1","ts-jest":"^29.1.2","typescript":"^5.7.3","@types/jest":"^29.5.12","@types/node":"^20.11.17","@typescript-eslint/parser":"^8.24.0","@typescript-eslint/eslint-plugin":"^8.24.0"},"peerDependencies":{"typescript":">=4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/batch-ai_0.1.7_1742832479103_0.7519193233988593","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"batch-ai","version":"1.0.0","keywords":["ai","batch","openai","anthropic","llm","sdk"],"author":{"name":"Grant Singleton"},"license":"MIT","_id":"batch-ai@1.0.0","maintainers":[{"name":"grantwsingleton","email":"grantwsingleton@gmail.com"}],"homepage":"https://github.com/grantsingleton/batch-ai#readme","bugs":{"url":"https://github.com/grantsingleton/batch-ai/issues"},"dist":{"shasum":"73b1f0354efddb6866d08433d1befe9d61db340d","tarball":"https://registry.npmjs.org/batch-ai/-/batch-ai-1.0.0.tgz","fileCount":13,"integrity":"sha512-WBnbJiAhPXqvuBxXr5bRMoed3ivCk3p/NXqOC7WvcfGuAXqFGN13TP/NhtC/iXSkxhXBG7fxWiC2YDMnuKioLA==","signatures":[{"sig":"MEYCIQDrUzcE4Nj5nFJm6OHNUupyFfhzkpusyiSEEWKDKq0u6AIhAP4+S+kcNF/BqYdR+CX8VbnQ8jjB++uuI4MXYgic82q5","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35492},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"05c7e9f132b3e6ec6504de3d82371889fdc2d368","scripts":{"lint":"eslint .","test":"jest","build":"rm -rf dist && npm run build:cjs && mv dist/index.js dist/index.cjs && npm run build:esm","watch":"tsc --watch","version":"git add -A src","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc","preversion":"npm run lint","postversion":"git push && git push --tags","prepublishOnly":"npm test && npm run lint"},"_npmUser":{"name":"grantwsingleton","actor":{"name":"grantwsingleton","type":"user","email":"grantwsingleton@gmail.com"},"email":"grantwsingleton@gmail.com"},"repository":{"url":"git+https://github.com/grantsingleton/batch-ai.git","type":"git"},"_npmVersion":"10.8.2","description":"A unified SDK for making batch AI requests across different model providers","directories":{},"_nodeVersion":"20.12.2","dependencies":{"zod":"^3.24.1","openai":"^4.83.0","@anthropic-ai/sdk":"^0.36.3","zod-to-json-schema":"^3.24.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9.20.1","ts-jest":"^29.1.2","typescript":"^5.7.3","@types/jest":"^29.5.12","@types/node":"^20.11.17","@typescript-eslint/parser":"^8.24.0","@typescript-eslint/eslint-plugin":"^8.24.0"},"peerDependencies":{"typescript":">=4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/batch-ai_1.0.0_1752098833537_0.7867499691144044","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"batch-ai","version":"2.0.0","keywords":["ai","batch","openai","anthropic","llm","sdk"],"author":{"name":"Grant Singleton"},"license":"MIT","_id":"batch-ai@2.0.0","maintainers":[{"name":"grantwsingleton","email":"grantwsingleton@gmail.com"}],"homepage":"https://github.com/grantsingleton/batch-ai#readme","bugs":{"url":"https://github.com/grantsingleton/batch-ai/issues"},"dist":{"shasum":"27a9afd9742f375dd17ceebfa8815e9e433900d1","tarball":"https://registry.npmjs.org/batch-ai/-/batch-ai-2.0.0.tgz","fileCount":18,"integrity":"sha512-xE/3I8JKxXQqE01PiuGM8eq/e7iTjx+f1B4G4eG45e6UBXMujWKeqUbVAIlbxh8h07tM71ZvJDmQ3z0kFoOtmQ==","signatures":[{"sig":"MEUCIQDx1k6oFeWTZsjMQgVRUNWUpdz7cB4oQ9JcWpwt4ZgaQQIgHYyIfbd2ZSBt7ddPPIgJLpvPLip78O39IbONfElJGhI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":57113},"main":"./dist/cjs/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/cjs/index.js"}},"gitHead":"0470d510c4f1cc15b269276bf176ae9ecfe712a1","scripts":{"lint":"eslint .","test":"jest","build":"rm -rf dist && npm run build:esm && npm run build:cjs","watch":"tsc --watch","version":"git add -A src","build:cjs":"tsc -p tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json","build:esm":"tsc","preversion":"npm run lint","postversion":"git push && git push --tags","prepublishOnly":"npm test && npm run lint && npm run build"},"_npmUser":{"name":"grantwsingleton","email":"grantwsingleton@gmail.com"},"repository":{"url":"git+https://github.com/grantsingleton/batch-ai.git","type":"git"},"_npmVersion":"10.9.4","description":"A unified SDK for making batch AI requests across different model providers","directories":{},"_nodeVersion":"22.22.0","dependencies":{"openai":"^7.4.0","@anthropic-ai/sdk":"^0.117.1","zod-to-json-schema":"^3.25.2"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.4.3","jest":"^29.7.0","eslint":"^9.20.1","ts-jest":"^29.4.12","typescript":"^5.9.3","@types/jest":"^29.5.12","@types/node":"^22.10.0","@typescript-eslint/parser":"^8.24.0","@typescript-eslint/eslint-plugin":"^8.24.0"},"peerDependencies":{"zod":"^3.25.0 || ^4.0.0","typescript":">=4.9.0"},"peerDependenciesMeta":{"typescript":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/batch-ai_2.0.0_1786718110323_0.9435626142164999","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"batch-ai","version":"2.1.0","description":"A unified SDK for making batch AI requests across different model providers","main":"./dist/cjs/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/cjs/index.js","default":"./dist/index.js"}},"engines":{"node":">=22.0.0"},"scripts":{"build:cjs":"tsc -p tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json","build:esm":"tsc","build":"rm -rf dist && npm run build:esm && npm run build:cjs","watch":"tsc --watch","test":"jest","lint":"eslint .","prepublishOnly":"npm test && npm run lint && npm run build","preversion":"npm run lint","version":"git add -A src","postversion":"git push && git push --tags"},"keywords":["ai","batch","openai","anthropic","llm","sdk"],"author":{"name":"Grant Singleton"},"repository":{"type":"git","url":"git+https://github.com/grantsingleton/batch-ai.git"},"homepage":"https://github.com/grantsingleton/batch-ai#readme","bugs":{"url":"https://github.com/grantsingleton/batch-ai/issues"},"license":"MIT","devDependencies":{"@types/jest":"^29.5.12","@types/node":"^22.10.0","@typescript-eslint/eslint-plugin":"^8.24.0","@typescript-eslint/parser":"^8.24.0","eslint":"^9.20.1","jest":"^29.7.0","ts-jest":"^29.4.12","typescript":"^5.9.3","zod":"^4.4.3"},"peerDependencies":{"typescript":">=4.9.0","zod":"^3.25.0 || ^4.0.0"},"peerDependenciesMeta":{"typescript":{"optional":true}},"dependencies":{"@anthropic-ai/sdk":"^0.117.1","@google/genai":"^2.17.1","openai":"^7.4.0","zod-to-json-schema":"^3.25.2"},"_id":"batch-ai@2.1.0","gitHead":"f890ce49e42ee571cfdc6ae5d96de83869841aea","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-r91uC/epPZII7kz8sak2zDSmVUxax+yqI8RQ7BytZ6L9D4mxybWa0ePxmfM2IJTYULsTpadq1rDKHmIxr6L8KQ==","shasum":"0ec88d47915e92806e4afe178e217de2c618af0d","tarball":"https://registry.npmjs.org/batch-ai/-/batch-ai-2.1.0.tgz","fileCount":24,"unpackedSize":78188,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDA4Tm6Rb+CjR4n3DfGoEBaQ8Md3/NGu5rttOoY1cPMdwIhALtomlItaDE9dwv+gvKrfJDMqRWjgLWyIqywX6hmeAyf"}]},"_npmUser":{"name":"grantwsingleton","email":"grantwsingleton@gmail.com"},"directories":{},"maintainers":[{"name":"grantwsingleton","email":"grantwsingleton@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/batch-ai_2.1.0_1786724952783_0.8836605693874793"},"_hasShrinkwrap":false}},"time":{"created":"2025-02-14T19:04:59.521Z","modified":"2026-08-14T16:29:13.097Z","0.1.0":"2025-02-14T19:04:59.702Z","0.1.2":"2025-02-14T19:11:02.453Z","0.1.4":"2025-02-15T15:15:15.230Z","0.1.6":"2025-02-15T15:23:54.541Z","0.1.7":"2025-03-24T16:07:59.278Z","1.0.0":"2025-07-09T22:07:13.721Z","2.0.0":"2026-08-14T14:35:10.474Z","2.1.0":"2026-08-14T16:29:12.932Z"},"bugs":{"url":"https://github.com/grantsingleton/batch-ai/issues"},"author":{"name":"Grant Singleton"},"license":"MIT","homepage":"https://github.com/grantsingleton/batch-ai#readme","keywords":["ai","batch","openai","anthropic","llm","sdk"],"repository":{"type":"git","url":"git+https://github.com/grantsingleton/batch-ai.git"},"description":"A unified SDK for making batch AI requests across different model providers","maintainers":[{"name":"grantwsingleton","email":"grantwsingleton@gmail.com"}],"readme":"# batch-ai\n\n[![npm version](https://img.shields.io/npm/v/batch-ai.svg)](https://www.npmjs.com/package/batch-ai)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.0-blue.svg)](https://www.typescriptlang.org/)\n\nA unified TypeScript SDK for making batch AI requests across different model providers. Process thousands of prompts efficiently using official batch APIs from OpenAI and Anthropic.\n\nInspired by the [Vercel AI SDK](https://sdk.vercel.ai/docs), this library aims to provide a unified interface for batch processing across different AI providers. Just like Vercel's SDK allows developers to easily switch between different LLM providers without changing their application code, batch-ai lets you handle large-scale batch processing with the same simplicity - write once, run with any supported provider.\n\n## Features\n\n- 🚀 **Unified Interface**: Single API for multiple AI providers\n- 🔒 **Type Safety**: Full TypeScript support with Zod schema validation\n- 📦 **Provider Support**:\n  - OpenAI (`gpt-5.6`, `gpt-5.6-terra`, `gpt-5.6-luna`, `gpt-4.1`, etc.)\n  - Anthropic (`claude-opus-5`, `claude-sonnet-5`, `claude-haiku-4-5`, etc.)\n  - Google (`gemini-3.6-pro`, `gemini-3.6-flash`, etc.) — text inputs only for now\n  - Coming Soon:\n    - xAI (Grok)\n    - _Want another provider? [Open an issue](https://github.com/grantsingleton/batch-ai/issues/new)!_\n- 🛠️ **Batch Operations**:\n  - `createObjectBatch`: Generate structured outputs (JSON) from prompts\n  - Coming Soon:\n    - `generateTextBatch`: Generate free-form text responses\n    - _Want to speed up text batch development? [Open an issue](https://github.com/grantsingleton/batch-ai/issues/new)!_\n- ⚡ **Performance**: Process thousands of prompts efficiently\n- 🔍 **Error Handling**: Robust error handling with detailed error types\n\n## System Prompts\n\nbatch-ai supports system prompts for both OpenAI and Anthropic models. System prompts help you guide the model's behavior without taking up space in your input text.\n\nTo use system prompts, simply add the optional `systemPrompt` property to your requests:\n\n```typescript\nconst requests = [\n  {\n    customId: \"task-1\",\n    input: \"What is the capital of France?\",\n    systemPrompt:\n      \"You are a helpful geography expert. Provide concise answers.\",\n  },\n];\n```\n\nSystem prompts are completely optional and can be omitted if not needed.\n\n## Installation\n\n```bash\nnpm install batch-ai\n# or\nyarn add batch-ai\n# or\npnpm add batch-ai\n```\n\n### Requirements\n\n- **Node.js >= 22**\n- **zod 3.25+ or zod 4** (peer dependency — npm 7+ installs it automatically alongside batch-ai)\n\n## Quick Start\n\n### API Key Configuration\n\nYou can configure your API keys in one of two ways:\n\n1. Environment Variables (Recommended):\n\n```bash\n# .env\nOPENAI_API_KEY=sk-...\nANTHROPIC_API_KEY=sk-...\nGEMINI_API_KEY=...\n```\n\n2. Explicit Configuration:\n\n```typescript\nconst model = openai(\"gpt-5.6\", {\n  apiKey: \"sk-...\", // Your OpenAI API key\n});\n\n// or\nconst model = anthropic(\"claude-sonnet-5\", {\n  apiKey: \"sk-...\", // Your Anthropic API key\n});\n```\n\n### Basic Usage\n\n```typescript\nimport { z } from \"zod\";\nimport { openai, anthropic, createObjectBatch, getObjectBatch } from \"batch-ai\";\n\n// Define your output schema\nconst SentimentSchema = z.object({\n  sentiment: z.enum([\"positive\", \"negative\", \"neutral\"]),\n  confidence: z.number(),\n});\n\n// Initialize a model\nconst model = openai(\"gpt-5.6\", {\n  apiKey: process.env.OPENAI_API_KEY, // Optional if set in environment\n});\n\n// Prepare your batch requests, input can include text and images\n// Both OpenAI and Anthropic use the same input format\nconst requests = [\n  {\n    customId: \"review-1\",\n    input: [\n      {\n        type: \"text\",\n        text: \"I absolutely love this product! Best purchase ever.\",\n      },\n    ],\n    systemPrompt:\n      \"You are a sentiment analysis assistant. Analyze the sentiment of the review provided.\",\n  },\n  {\n    customId: \"review-2\",\n    input: [\n      { type: \"text\", text: \"This is terrible, would not recommend.\" },\n      {\n        type: \"image_url\",\n        image_url: {\n          url: \"https://example.com/product-image.jpg\",\n        },\n      },\n    ],\n    systemPrompt:\n      \"You are a sentiment analysis assistant. Analyze the sentiment of the review provided.\",\n  },\n];\n\n// Create a batch\nconst { batchId } = await createObjectBatch({\n  model,\n  requests,\n  outputSchema: SentimentSchema,\n});\n\n// Poll for results\nconst { batch, results } = await getObjectBatch({\n  model,\n  batchId,\n});\n\n// Process results\nresults?.forEach((result) => {\n  console.log(result.customId, result.output);\n});\n```\n\n### Using with Anthropic\n\nThe same input format works with Anthropic:\n\n```typescript\nconst model = anthropic(\"claude-opus-5\", {\n  apiKey: process.env.ANTHROPIC_API_KEY,\n});\n\n// Same request format as OpenAI\nconst requests = [\n  {\n    customId: \"analysis-1\",\n    input: [\n      { type: \"text\", text: \"Analyze this text for sentiment\" },\n      {\n        type: \"image_url\",\n        image_url: {\n          url: \"https://example.com/image.jpg\",\n        },\n      },\n    ],\n  },\n];\n\nconst { batchId } = await createObjectBatch({\n  model,\n  requests,\n  outputSchema: SentimentSchema,\n});\n```\n\n## Supported Providers\n\n### OpenAI\n\n```typescript\nimport { openai } from \"batch-ai\";\n\nconst model = openai(\"gpt-5.6\", {\n  apiKey: process.env.OPENAI_API_KEY,\n});\n```\n\n> **Note on schemas:** OpenAI structured outputs don't support purely optional fields. If your output schema has optional fields, mark them `.optional().nullable()` — a schema with `.optional()` alone will be rejected at batch creation.\n\n### Anthropic\n\n```typescript\nimport { anthropic } from \"batch-ai\";\n\nconst model = anthropic(\"claude-sonnet-5\", {\n  apiKey: process.env.ANTHROPIC_API_KEY,\n});\n```\n\n### Google (Gemini)\n\n```typescript\nimport { google } from \"batch-ai\";\n\nconst model = google(\"gemini-3.6-flash\", {\n  apiKey: process.env.GEMINI_API_KEY,\n});\n```\n\n> **Note:** The Gemini provider currently supports **text inputs only**. The Gemini API doesn't fetch arbitrary image URLs, so `image_url` content parts throw an error at batch creation. Open an issue if you need image support (inline base64 is feasible).\n\n## API Reference\n\n### Factory Functions\n\n#### `openai(modelId: OpenAIModel, config?: LanguageModelConfig)`\n\nCreates an OpenAI language model instance.\n\n```typescript\ninterface LanguageModelConfig {\n  apiKey?: string;\n}\n```\n\n#### `anthropic(modelId: AnthropicModel, config?: LanguageModelConfig)`\n\nCreates an Anthropic language model instance.\n\n### Batch Operations\n\n#### `createObjectBatch`\n\nCreates a new batch of requests.\n\n```typescript\ninterface CreateObjectBatchParams {\n  model: LanguageModel;\n  requests: BatchRequest<string>[];\n  outputSchema: z.ZodSchema<unknown>;\n}\n\ninterface CreateObjectBatchResponse {\n  batchId: string;\n}\n```\n\n#### `getObjectBatch`\n\nRetrieves batch status and results.\n\n```typescript\ninterface GetObjectBatchParams {\n  model: LanguageModel;\n  batchId: string;\n}\n\n// Returns\ninterface {\n  batch: Batch;\n  results?: BatchResponse<TOutput>[];\n}\n```\n\n### Types\n\n#### `BatchStatus`\n\n```typescript\ntype BatchStatus =\n  | \"validating\"\n  | \"in_progress\"\n  | \"completed\"\n  | \"failed\"\n  | \"expired\"\n  | \"cancelling\"\n  | \"cancelled\";\n```\n\n#### `BatchResponse<T>`\n\n```typescript\ninterface BatchResponse<T> {\n  customId: string;\n  output?: T;\n  error?: {\n    code: string;\n    message: string;\n  };\n  usage?: {\n    promptTokens: number;\n    completionTokens: number;\n    totalTokens: number;\n  };\n}\n```\n\n## Error Handling\n\nThe SDK throws typed `BatchError` instances:\n\n```typescript\nclass BatchError extends Error {\n  constructor(message: string, public code: string, public batchId?: string);\n}\n```\n\nCommon error codes:\n\n- `batch_creation_failed`: Failed to create a new batch\n- `batch_retrieval_failed`: Failed to retrieve batch status\n- `results_not_ready`: Batch results are not yet available\n- `results_retrieval_failed`: Failed to retrieve batch results\n- `batch_cancellation_failed`: Failed to cancel batch\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","readmeFilename":"README.md"}