{"_id":"@altexo/ai-gen","_rev":"14-ebc76b6996dbadb3f173c7b63f7c6fb5","name":"@altexo/ai-gen","dist-tags":{"latest":"0.11.0"},"versions":{"0.1.0":{"name":"@altexo/ai-gen","version":"0.1.0","keywords":["ai","image-generation","video-generation","gemini","nano-banana","veo","kling","cli"],"author":{"name":"Sergei Grigorev"},"license":"MIT","_id":"@altexo/ai-gen@0.1.0","maintainers":[{"name":"xorsnn","email":"xors.nn@gmail.com"}],"homepage":"https://github.com/xorsnn/altexo/tree/main/packages/ai-gen#readme","bugs":{"url":"https://github.com/xorsnn/altexo/issues"},"dist":{"shasum":"27a99752544302e7b6f43f80f6149fc268fd6322","tarball":"https://registry.npmjs.org/@altexo/ai-gen/-/ai-gen-0.1.0.tgz","fileCount":21,"integrity":"sha512-VsetKRVOPHWLpei1Us5arDMmLOF2XNKUN6T7DOx146W1yIvURctCpt0lvjwefTjWurBI6mmJeV2P0y4q8oJ0gQ==","signatures":[{"sig":"MEUCIAZDEwgb7mSDAaU/skq4EXN/smmOr8w+p8DG2MXE4+JcAiEA0QprEe7jdz6oMvQcsc1GbAt7oRgR5qZ45e7EirqX820=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":41533},"type":"module","engines":{"node":">=20"},"gitHead":"56c84f2d509f4a55a2b9c619d9e30c8d06b07c2e","scripts":{"veo":"node scripts/gen-veo.js","test":"node --test","image":"node scripts/gen-image.js","kling":"node scripts/gen-kling.js","pipeline":"node scripts/gen-pipeline.js"},"_npmUser":{"name":"xorsnn","email":"xors.nn@gmail.com"},"repository":{"url":"git+https://github.com/xorsnn/altexo.git","type":"git","directory":"packages/ai-gen"},"_npmVersion":"11.11.0","description":"Direct-API CLI + library for AI image/video generation (Nano Banana Pro, Veo 3.1, Kling 3). A cheaper, reproducible alternative to aggregators for repeated templates.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"yaml":"^2.6.0","dotenv":"^16.4.5","jsonwebtoken":"^9.0.2","@google/genai":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ai-gen_0.1.0_1780183596454_0.787174136845163","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@altexo/ai-gen","version":"0.2.1","keywords":["ai","image-generation","video-generation","gemini","nano-banana","veo","kling","cli"],"author":{"name":"Sergei Grigorev"},"license":"MIT","_id":"@altexo/ai-gen@0.2.1","maintainers":[{"name":"xorsnn","email":"xors.nn@gmail.com"}],"homepage":"https://github.com/xorsnn/altexo/tree/main/packages/ai-gen#readme","bugs":{"url":"https://github.com/xorsnn/altexo/issues"},"bin":{"altexo-ai-gen":"bin/altexo-ai-gen.js"},"dist":{"shasum":"c865fe76e7cba404d483538513d1e3d97c5f2d7d","tarball":"https://registry.npmjs.org/@altexo/ai-gen/-/ai-gen-0.2.1.tgz","fileCount":22,"integrity":"sha512-1xVy0414v0TOXiXulXlyIvAjIKcc1SD08BZUEDyyJ/7AM/G9TcVoOAETfjJONmKFywaMm6QbCzIGB8VPE7r7Jg==","signatures":[{"sig":"MEUCIQCn5mqUiF6hqZDA9ZuxU9fkmUW7BHzeW0kb/BRqYkSMZAIgaxnHsAg1LBNGH/LhHU3F1iFvlX/Uzh7E6Ao0lyZNT0w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":50070},"type":"module","engines":{"node":">=20"},"gitHead":"29b8281f51279f4525178ce5c82e699e996fb60f","scripts":{"veo":"node scripts/gen-veo.js","test":"node --test","image":"node scripts/gen-image.js","kling":"node scripts/gen-kling.js","pipeline":"node scripts/gen-pipeline.js"},"_npmUser":{"name":"xorsnn","email":"xors.nn@gmail.com"},"repository":{"url":"git+https://github.com/xorsnn/altexo.git","type":"git","directory":"packages/ai-gen"},"_npmVersion":"11.11.0","description":"Direct-API CLI + library for AI image/video generation (Nano Banana Pro, Veo 3.1, Kling 3). A cheaper, reproducible alternative to aggregators for repeated templates.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"yaml":"^2.6.0","dotenv":"^16.4.5","jsonwebtoken":"^9.0.2","@google/genai":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ai-gen_0.2.1_1780216290274_0.5830457965507714","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@altexo/ai-gen","version":"0.3.0","keywords":["ai","image-generation","video-generation","gemini","nano-banana","veo","kling","openai","gpt-image-1","dall-e","cli"],"author":{"name":"Sergei Grigorev"},"license":"MIT","_id":"@altexo/ai-gen@0.3.0","maintainers":[{"name":"xorsnn","email":"xors.nn@gmail.com"}],"homepage":"https://github.com/xorsnn/altexo/tree/main/packages/ai-gen#readme","bugs":{"url":"https://github.com/xorsnn/altexo/issues"},"bin":{"altexo-ai-gen":"bin/altexo-ai-gen.js"},"dist":{"shasum":"237d6c9fc3b8abc8c7c58aace4ccb3d0089d41df","tarball":"https://registry.npmjs.org/@altexo/ai-gen/-/ai-gen-0.3.0.tgz","fileCount":25,"integrity":"sha512-oEJkOK9LYGkbEuz2CtZ3B1GIJPvEyIMCp39pXynqBI6scKU6/LS+7a5TVQR/m+IXIm3Mmp0MztbZKoVHVbw16Q==","signatures":[{"sig":"MEYCIQCwa5zYoIfsPZQh0xlnzKSr73Z5GZ1D8DUO/2R5ixmwtgIhANnB17KHRxgnFKkiRyWv9AJ05HAYYZATWlFH04k0sDOQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":60230},"type":"module","engines":{"node":">=20"},"gitHead":"5009245913c749a86dad8c8550bc2302e087bfce","scripts":{"veo":"node scripts/gen-veo.js","test":"node --test","image":"node scripts/gen-image.js","kling":"node scripts/gen-kling.js","openai":"node scripts/gen-openai.js","pipeline":"node scripts/gen-pipeline.js"},"_npmUser":{"name":"xorsnn","email":"xors.nn@gmail.com"},"repository":{"url":"git+https://github.com/xorsnn/altexo.git","type":"git","directory":"packages/ai-gen"},"_npmVersion":"11.11.0","description":"Direct-API CLI + library for AI image/video generation (Nano Banana Pro, Veo 3.1, Kling 3, OpenAI gpt-image-1). A cheaper, reproducible alternative to aggregators for repeated templates.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"yaml":"^2.6.0","dotenv":"^16.4.5","jsonwebtoken":"^9.0.2","@google/genai":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ai-gen_0.3.0_1780728297689_0.18384032302937792","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@altexo/ai-gen","version":"0.3.1","keywords":["ai","image-generation","video-generation","gemini","nano-banana","veo","kling","openai","gpt-image-1","dall-e","cli"],"author":{"name":"Sergei Grigorev"},"license":"MIT","_id":"@altexo/ai-gen@0.3.1","maintainers":[{"name":"xorsnn","email":"xors.nn@gmail.com"}],"homepage":"https://github.com/xorsnn/altexo/tree/main/packages/ai-gen#readme","bugs":{"url":"https://github.com/xorsnn/altexo/issues"},"bin":{"altexo-ai-gen":"bin/altexo-ai-gen.js"},"dist":{"shasum":"7efb94d8e854068b1a2f4eeb46ad4475c25fc9da","tarball":"https://registry.npmjs.org/@altexo/ai-gen/-/ai-gen-0.3.1.tgz","fileCount":25,"integrity":"sha512-Yv3QFlri1LsG+oe8LFXRQQfVfR2zaQzMSTkQGlJ+5TpRZtBd0n3Q8OEk5bW1seTQaMV10xIdNJNU18y1zug9tw==","signatures":[{"sig":"MEYCIQC+O7piyhtuTNQMtTVdSTiKJ1I2V2WthNC5syVu5oasCgIhAIMclf1JDzy3EmJd7M3S/nzSbrf2xxPnmg0RPKSSuq/v","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":60954},"type":"module","engines":{"node":">=20"},"gitHead":"5699d552783e8dca680d29449833d7f4c3638b36","scripts":{"veo":"node scripts/gen-veo.js","test":"node --test","image":"node scripts/gen-image.js","kling":"node scripts/gen-kling.js","openai":"node scripts/gen-openai.js","pipeline":"node scripts/gen-pipeline.js"},"_npmUser":{"name":"xorsnn","email":"xors.nn@gmail.com"},"repository":{"url":"git+https://github.com/xorsnn/altexo.git","type":"git","directory":"packages/ai-gen"},"_npmVersion":"11.11.0","description":"Direct-API CLI + library for AI image/video generation (Nano Banana Pro, Veo 3.1, Kling 3, OpenAI gpt-image-1). A cheaper, reproducible alternative to aggregators for repeated templates.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"yaml":"^2.6.0","dotenv":"^16.4.5","jsonwebtoken":"^9.0.2","@google/genai":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ai-gen_0.3.1_1780730461956_0.8509545252085386","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"name":"@altexo/ai-gen","version":"0.3.2","keywords":["ai","image-generation","video-generation","gemini","nano-banana","veo","kling","openai","gpt-image-1","dall-e","cli"],"author":{"name":"Sergei Grigorev"},"license":"MIT","_id":"@altexo/ai-gen@0.3.2","maintainers":[{"name":"xorsnn","email":"xors.nn@gmail.com"}],"homepage":"https://github.com/xorsnn/altexo/tree/main/packages/ai-gen#readme","bugs":{"url":"https://github.com/xorsnn/altexo/issues"},"bin":{"altexo-ai-gen":"bin/altexo-ai-gen.js"},"dist":{"shasum":"2b43001eaf54f94cbcd4a77048c0a6a6791d3704","tarball":"https://registry.npmjs.org/@altexo/ai-gen/-/ai-gen-0.3.2.tgz","fileCount":25,"integrity":"sha512-QaK/UzDGG+0eHzqgLMJeKxm62JKmstuE2DltewkBHG6TfvtKfG7lkEk10Vnm4Kxp27OZSpcDvvVi0CsVS24dnA==","signatures":[{"sig":"MEYCIQD5WUBCKDOSVp3fX/rz7q3ZKDPgAkE9686dRW4hcBkElwIhAOJ7tw1saHiIZfZsSqKjWLH2Rn36qKUpPdsVFLJP799J","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":62835},"type":"module","engines":{"node":">=20"},"gitHead":"fe6beff72a76c81da7152483367854476cc5abec","scripts":{"veo":"node scripts/gen-veo.js","test":"node --test","image":"node scripts/gen-image.js","kling":"node scripts/gen-kling.js","openai":"node scripts/gen-openai.js","pipeline":"node scripts/gen-pipeline.js"},"_npmUser":{"name":"xorsnn","email":"xors.nn@gmail.com"},"repository":{"url":"git+https://github.com/xorsnn/altexo.git","type":"git","directory":"packages/ai-gen"},"_npmVersion":"11.11.0","description":"Direct-API CLI + library for AI image/video generation (Nano Banana Pro, Veo 3.1, Kling 3, OpenAI gpt-image-1). A cheaper, reproducible alternative to aggregators for repeated templates.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"yaml":"^2.6.0","dotenv":"^16.4.5","jsonwebtoken":"^9.0.2","@google/genai":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ai-gen_0.3.2_1780748578042_0.5323512928696943","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@altexo/ai-gen","version":"0.4.0","keywords":["ai","image-generation","video-generation","gemini","nano-banana","veo","kling","openai","gpt-image-1","dall-e","cli"],"author":{"name":"Sergei Grigorev"},"license":"MIT","_id":"@altexo/ai-gen@0.4.0","maintainers":[{"name":"xorsnn","email":"xors.nn@gmail.com"}],"homepage":"https://github.com/xorsnn/altexo/tree/main/packages/ai-gen#readme","bugs":{"url":"https://github.com/xorsnn/altexo/issues"},"bin":{"altexo-ai-gen":"bin/altexo-ai-gen.js"},"dist":{"shasum":"b46ecb5f58862036ce8712db09b2b92d37ce6c99","tarball":"https://registry.npmjs.org/@altexo/ai-gen/-/ai-gen-0.4.0.tgz","fileCount":27,"integrity":"sha512-EQMLkcOZaILmzO+c35qbqmkMrUXl/9LjpikhmGpR0mPi0PU/FzvxXCSZI2eTCP8N+J3Ir+TIalCh2yQ8kmF+Pw==","signatures":[{"sig":"MEYCIQDBScBxUkBu/arI/fYz+kHqEQiYhEooHhvRkPU6y+NDzQIhAI9mTwVv5Hg2SYdIz83CGOdlUVoyqJ936J9j++BY+blW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":76230},"type":"module","engines":{"node":">=20"},"gitHead":"757f4f88b08ef5676b28aeb2bba039cfe3ddfcf8","scripts":{"veo":"node scripts/gen-veo.js","test":"node --test","image":"node scripts/gen-image.js","kling":"node scripts/gen-kling.js","openai":"node scripts/gen-openai.js","element":"node scripts/gen-kling-element.js","pipeline":"node scripts/gen-pipeline.js"},"_npmUser":{"name":"xorsnn","email":"xors.nn@gmail.com"},"repository":{"url":"git+https://github.com/xorsnn/altexo.git","type":"git","directory":"packages/ai-gen"},"_npmVersion":"11.11.0","description":"Direct-API CLI + library for AI image/video generation (Nano Banana Pro, Veo 3.1, Kling 3, OpenAI gpt-image-1). A cheaper, reproducible alternative to aggregators for repeated templates.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"yaml":"^2.6.0","dotenv":"^16.4.5","jsonwebtoken":"^9.0.2","@google/genai":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ai-gen_0.4.0_1780834341753_0.8278154529087831","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@altexo/ai-gen","version":"0.5.0","keywords":["ai","image-generation","video-generation","gemini","nano-banana","veo","kling","openai","gpt-image-1","dall-e","cli"],"author":{"name":"Sergei Grigorev"},"license":"MIT","_id":"@altexo/ai-gen@0.5.0","maintainers":[{"name":"xorsnn","email":"xors.nn@gmail.com"}],"homepage":"https://github.com/xorsnn/altexo/tree/main/packages/ai-gen#readme","bugs":{"url":"https://github.com/xorsnn/altexo/issues"},"bin":{"altexo-ai-gen":"bin/altexo-ai-gen.js"},"dist":{"shasum":"b591a88a4c80ec1536147fda75d208b1372c4f6a","tarball":"https://registry.npmjs.org/@altexo/ai-gen/-/ai-gen-0.5.0.tgz","fileCount":31,"integrity":"sha512-C3MCq+Ynoc0QOSS/e15ssB3pBUiU48EAhcifMlL8MDMHnw7jjIVVOTJ68OPQMmrCxrzXDR2k/TjRmvPTd+w+iQ==","signatures":[{"sig":"MEUCIQCmHUA2mXpW5Gs4/NhWkZ4UTTc4hkaMo2fAJi5ekqLiMgIgX28NYA464vWnmBYKX5GBDo1lpPcNyY1PuLGEANu+g30=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":102443},"main":"./src/index.js","type":"module","types":"./src/index.d.ts","engines":{"node":">=20.3"},"exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js"},"./package.json":"./package.json"},"gitHead":"a41eceb8aba3f2db4119bb71610cb3051b7b0bb9","scripts":{"veo":"node scripts/gen-veo.js","test":"node --test","image":"node scripts/gen-image.js","kling":"node scripts/gen-kling.js","openai":"node scripts/gen-openai.js","element":"node scripts/gen-kling-element.js","pipeline":"node scripts/gen-pipeline.js"},"_npmUser":{"name":"xorsnn","email":"xors.nn@gmail.com"},"repository":{"url":"git+https://github.com/xorsnn/altexo.git","type":"git","directory":"packages/ai-gen"},"_npmVersion":"11.11.0","description":"Direct-API CLI + library for AI image/video generation (Nano Banana Pro, Veo 3.1, Kling 3, OpenAI gpt-image-1). A cheaper, reproducible alternative to aggregators for repeated templates.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"yaml":"^2.6.0","dotenv":"^16.4.5","jsonwebtoken":"^9.0.2","@google/genai":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ai-gen_0.5.0_1781179985765_0.8510988090033915","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"name":"@altexo/ai-gen","version":"0.6.0","keywords":["ai","image-generation","video-generation","gemini","nano-banana","veo","kling","openai","gpt-image-1","dall-e","cli"],"author":{"name":"Sergei Grigorev"},"license":"MIT","_id":"@altexo/ai-gen@0.6.0","maintainers":[{"name":"xorsnn","email":"xors.nn@gmail.com"}],"homepage":"https://github.com/xorsnn/altexo/tree/main/packages/ai-gen#readme","bugs":{"url":"https://github.com/xorsnn/altexo/issues"},"bin":{"altexo-ai-gen":"bin/altexo-ai-gen.js"},"dist":{"shasum":"88c2d522caaa08eb6f7547be7a3e4a115eff6c4d","tarball":"https://registry.npmjs.org/@altexo/ai-gen/-/ai-gen-0.6.0.tgz","fileCount":31,"integrity":"sha512-Cc+37R6UPGDU27Q4OHvoSpgJ6SjuTsACtIBFogN1AedrH7317ZnFWbiAfqO1PwwCU08yXVLt0N5ht7i8gu6PTA==","signatures":[{"sig":"MEUCIQDLDTTRjV/So3TuWzKn6RzSZMRMfpyFYPtK+td+t9dXEAIgG8LEdMgVg8QigZ8MRXY8kNkNoXA9iAAWE2aNLWh6pGw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":117670},"main":"./src/index.js","type":"module","types":"./src/index.d.ts","engines":{"node":">=20.3"},"exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js"},"./package.json":"./package.json"},"gitHead":"524cc0c6dc7822c2a0c8cc2d9eaa43de055ae054","scripts":{"veo":"node scripts/gen-veo.js","test":"node --test","image":"node scripts/gen-image.js","kling":"node scripts/gen-kling.js","openai":"node scripts/gen-openai.js","element":"node scripts/gen-kling-element.js","pipeline":"node scripts/gen-pipeline.js"},"_npmUser":{"name":"xorsnn","email":"xors.nn@gmail.com"},"repository":{"url":"git+https://github.com/xorsnn/altexo.git","type":"git","directory":"packages/ai-gen"},"_npmVersion":"11.11.0","description":"Direct-API CLI + library for AI image/video generation (Nano Banana Pro, Veo 3.1, Kling 3, OpenAI gpt-image-1). A cheaper, reproducible alternative to aggregators for repeated templates.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"yaml":"^2.6.0","dotenv":"^16.4.5","jsonwebtoken":"^9.0.2","@google/genai":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ai-gen_0.6.0_1781582246088_0.23904664411738308","host":"s3://npm-registry-packages-npm-production"}},"0.7.0":{"name":"@altexo/ai-gen","version":"0.7.0","keywords":["ai","image-generation","video-generation","gemini","nano-banana","veo","kling","openai","gpt-image-1","dall-e","cli"],"author":{"name":"Sergei Grigorev"},"license":"MIT","_id":"@altexo/ai-gen@0.7.0","maintainers":[{"name":"xorsnn","email":"xors.nn@gmail.com"}],"homepage":"https://github.com/xorsnn/altexo/tree/main/packages/ai-gen#readme","bugs":{"url":"https://github.com/xorsnn/altexo/issues"},"bin":{"altexo-ai-gen":"bin/altexo-ai-gen.js"},"dist":{"shasum":"c3e329868cb4cf1788924a65e35504cd730a6d59","tarball":"https://registry.npmjs.org/@altexo/ai-gen/-/ai-gen-0.7.0.tgz","fileCount":31,"integrity":"sha512-ajw/WF22HZRAhJ7YGlwKvtgUwU2nrgNgqoNiFzXqAn5HwIQh6KTUAtyCShIkxR9yc0FS1OHkR4CrXB0Sy4xTpQ==","signatures":[{"sig":"MEYCIQCTYOCLLXSrFEuA2zXwd/8eqRlKMP27JfQsFM7LT0g84wIhANThG7PZ9mCXDvChn0rKtTxre7a6Z2PqBqxK3MBLhP1x","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":117834},"main":"./src/index.js","type":"module","types":"./src/index.d.ts","engines":{"node":">=20.3"},"exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js"},"./package.json":"./package.json"},"gitHead":"66e126e168ddc6b3ee97f62ebffdd73b249b3d7b","scripts":{"veo":"node scripts/gen-veo.js","test":"node --test","image":"node scripts/gen-image.js","kling":"node scripts/gen-kling.js","openai":"node scripts/gen-openai.js","element":"node scripts/gen-kling-element.js","pipeline":"node scripts/gen-pipeline.js"},"_npmUser":{"name":"xorsnn","email":"xors.nn@gmail.com"},"repository":{"url":"git+https://github.com/xorsnn/altexo.git","type":"git","directory":"packages/ai-gen"},"_npmVersion":"11.11.0","description":"Direct-API CLI + library for AI image/video generation (Nano Banana Pro, Veo 3.1, Kling 3, OpenAI gpt-image-1). A cheaper, reproducible alternative to aggregators for repeated templates.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"yaml":"^2.6.0","dotenv":"^16.4.5","jsonwebtoken":"^9.0.2","@google/genai":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ai-gen_0.7.0_1781678092037_0.1826649804995406","host":"s3://npm-registry-packages-npm-production"}},"0.8.0":{"name":"@altexo/ai-gen","version":"0.8.0","keywords":["ai","image-generation","video-generation","gemini","nano-banana","veo","kling","openai","gpt-image-1","dall-e","cli"],"author":{"name":"Sergei Grigorev"},"license":"MIT","_id":"@altexo/ai-gen@0.8.0","maintainers":[{"name":"xorsnn","email":"xors.nn@gmail.com"}],"homepage":"https://github.com/xorsnn/altexo/tree/main/packages/ai-gen#readme","bugs":{"url":"https://github.com/xorsnn/altexo/issues"},"bin":{"altexo-ai-gen":"bin/altexo-ai-gen.js"},"dist":{"shasum":"8977224857eccfc21ee000c8cf56692578387e1b","tarball":"https://registry.npmjs.org/@altexo/ai-gen/-/ai-gen-0.8.0.tgz","fileCount":31,"integrity":"sha512-9X32+Pq5j17d2nH2IUtoeAiWojvVdntaNK0ShPDn/vp11o4/963mXPJwxxOuskbZqjWzt/AuYhowU4DXmHHxQQ==","signatures":[{"sig":"MEYCIQCWYb8EEMW/nPD9gvc3kPyzIUupBlkMWfOAQXSE1L3h3gIhAO5HXeitPzILHpYzYRwVy/2+DvXVdGOjkDd9nL6W5Zaz","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":127203},"main":"./src/index.js","type":"module","types":"./src/index.d.ts","engines":{"node":">=20.3"},"exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js"},"./package.json":"./package.json"},"gitHead":"e5969e74073155b3a4f4a3bdada9650516ea0330","scripts":{"veo":"node scripts/gen-veo.js","test":"node --test","image":"node scripts/gen-image.js","kling":"node scripts/gen-kling.js","openai":"node scripts/gen-openai.js","element":"node scripts/gen-kling-element.js","pipeline":"node scripts/gen-pipeline.js"},"_npmUser":{"name":"xorsnn","email":"xors.nn@gmail.com"},"repository":{"url":"git+https://github.com/xorsnn/altexo.git","type":"git","directory":"packages/ai-gen"},"_npmVersion":"11.13.0","description":"Direct-API CLI + library for AI image/video generation (Nano Banana Pro, Veo 3.1, Kling 3, OpenAI gpt-image-1). A cheaper, reproducible alternative to aggregators for repeated templates.","directories":{},"_nodeVersion":"24.17.0","dependencies":{"yaml":"^2.6.0","dotenv":"^16.4.5","jsonwebtoken":"^9.0.2","@google/genai":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ai-gen_0.8.0_1788336347572_0.3960267345708086","host":"s3://npm-registry-packages-npm-production"}},"0.9.0":{"name":"@altexo/ai-gen","version":"0.9.0","keywords":["ai","image-generation","video-generation","gemini","nano-banana","veo","kling","openai","gpt-image-1","dall-e","cli"],"author":{"name":"Sergei Grigorev"},"license":"MIT","_id":"@altexo/ai-gen@0.9.0","maintainers":[{"name":"xorsnn","email":"xors.nn@gmail.com"}],"homepage":"https://github.com/xorsnn/altexo/tree/main/packages/ai-gen#readme","bugs":{"url":"https://github.com/xorsnn/altexo/issues"},"bin":{"altexo-ai-gen":"bin/altexo-ai-gen.js"},"dist":{"shasum":"c90295cedf83b429edc299981df61794dbcd3d61","tarball":"https://registry.npmjs.org/@altexo/ai-gen/-/ai-gen-0.9.0.tgz","fileCount":31,"integrity":"sha512-GBO+diBzZyds2pd5bCRi4n+UDKBEFG/PBx1reCSSB+MK777o+Rm0KMIXg0bKDUIk+mr5V4qzOHzeA/oOmcWJrQ==","signatures":[{"sig":"MEUCIQC6Nov7HK4fqKozqoB7xj7jX/ZJu6GAgVpjeA/bRY5Y6wIgLjUyA3Cnvk9XMo1hRsBF+29XOIZMuD/iHMILxmhgw+w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":127667},"main":"./src/index.js","type":"module","types":"./src/index.d.ts","engines":{"node":">=20.3"},"exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js"},"./package.json":"./package.json"},"gitHead":"9c40723fce3c3647fccff4bf50f45817f4384677","scripts":{"veo":"node scripts/gen-veo.js","test":"node --test","image":"node scripts/gen-image.js","kling":"node scripts/gen-kling.js","openai":"node scripts/gen-openai.js","element":"node scripts/gen-kling-element.js","pipeline":"node scripts/gen-pipeline.js"},"_npmUser":{"name":"xorsnn","email":"xors.nn@gmail.com"},"repository":{"url":"git+https://github.com/xorsnn/altexo.git","type":"git","directory":"packages/ai-gen"},"_npmVersion":"11.13.0","description":"Direct-API CLI + library for AI image/video generation (Nano Banana Pro, Veo 3.1, Kling 3, OpenAI gpt-image-1). A cheaper, reproducible alternative to aggregators for repeated templates.","directories":{},"_nodeVersion":"24.17.0","dependencies":{"yaml":"^2.6.0","dotenv":"^16.4.5","@google/genai":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ai-gen_0.9.0_1788384957988_0.11341700933835241","host":"s3://npm-registry-packages-npm-production"}},"0.10.0":{"name":"@altexo/ai-gen","version":"0.10.0","keywords":["ai","image-generation","video-generation","gemini","nano-banana","veo","kling","openai","gpt-image-1","dall-e","cli"],"author":{"name":"Sergei Grigorev"},"license":"MIT","_id":"@altexo/ai-gen@0.10.0","maintainers":[{"name":"xorsnn","email":"xors.nn@gmail.com"}],"homepage":"https://github.com/xorsnn/altexo/tree/main/packages/ai-gen#readme","bugs":{"url":"https://github.com/xorsnn/altexo/issues"},"bin":{"altexo-ai-gen":"bin/altexo-ai-gen.js"},"dist":{"shasum":"d96983c07eea2c451cd0c26a37af3626f5c05151","tarball":"https://registry.npmjs.org/@altexo/ai-gen/-/ai-gen-0.10.0.tgz","fileCount":31,"integrity":"sha512-JydyPwbyLCad0OUF39WSi89R1mHmSDfR9DeLPmQy25x9/E0eQRnRNj3IPI945ZpRhpfMo/bsnzB+Li4viZ4JoA==","signatures":[{"sig":"MEYCIQDhyHbLrYUXYlKS9maez9hKMyNvK09Reig5VESPIDyBsAIhAPF5ejJwTrXB4S8on2Pb2V0vdFKpm2fCt1VH3+2HM1In","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":134556},"main":"./src/index.js","type":"module","types":"./src/index.d.ts","engines":{"node":">=20.3"},"exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js"},"./package.json":"./package.json"},"gitHead":"b38ab0d287df1cd8f807b42d865c757380cd9a9c","scripts":{"veo":"node scripts/gen-veo.js","test":"node --test","image":"node scripts/gen-image.js","kling":"node scripts/gen-kling.js","openai":"node scripts/gen-openai.js","element":"node scripts/gen-kling-element.js","pipeline":"node scripts/gen-pipeline.js"},"_npmUser":{"name":"xorsnn","email":"xors.nn@gmail.com"},"repository":{"url":"git+https://github.com/xorsnn/altexo.git","type":"git","directory":"packages/ai-gen"},"_npmVersion":"11.13.0","description":"Direct-API CLI + library for AI image/video generation (Nano Banana Pro, Veo 3.1, Kling 3, OpenAI gpt-image-1). A cheaper, reproducible alternative to aggregators for repeated templates.","directories":{},"_nodeVersion":"24.17.0","dependencies":{"yaml":"^2.6.0","dotenv":"^16.4.5","@google/genai":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ai-gen_0.10.0_1788406333829_0.6623320759721647","host":"s3://npm-registry-packages-npm-production"}},"0.10.1":{"name":"@altexo/ai-gen","version":"0.10.1","keywords":["ai","image-generation","video-generation","gemini","nano-banana","veo","kling","openai","gpt-image-1","dall-e","cli"],"author":{"name":"Sergei Grigorev"},"license":"MIT","_id":"@altexo/ai-gen@0.10.1","maintainers":[{"name":"xorsnn","email":"xors.nn@gmail.com"}],"homepage":"https://github.com/xorsnn/altexo/tree/main/packages/ai-gen#readme","bugs":{"url":"https://github.com/xorsnn/altexo/issues"},"bin":{"altexo-ai-gen":"bin/altexo-ai-gen.js"},"dist":{"shasum":"cb9b5f2d948b49305206f4606c3aa3c4481071f3","tarball":"https://registry.npmjs.org/@altexo/ai-gen/-/ai-gen-0.10.1.tgz","fileCount":31,"integrity":"sha512-Vls6fsQxYL6tncdMZmm8eoLzLXsd9ONe8YIjJ0FQvlTvid+RLx9VIQlSYJ73bUby1FLL7rBEhMBqEXVxv4tM+g==","signatures":[{"sig":"MEQCIGpLD07F52DvewWLltDOle+Q8NuoRPcHS5VqAlvTKyq+AiA05CS7e2o8n0SaS9HeTsomx39+z/8fIkuwY/aQFbDmHg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":135754},"main":"./src/index.js","type":"module","types":"./src/index.d.ts","engines":{"node":">=20.3"},"exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js"},"./package.json":"./package.json"},"gitHead":"04ab193090af7d0b423fd443654d704b9b7a5abd","scripts":{"veo":"node scripts/gen-veo.js","test":"node --test","image":"node scripts/gen-image.js","kling":"node scripts/gen-kling.js","openai":"node scripts/gen-openai.js","element":"node scripts/gen-kling-element.js","pipeline":"node scripts/gen-pipeline.js"},"_npmUser":{"name":"xorsnn","email":"xors.nn@gmail.com"},"repository":{"url":"git+https://github.com/xorsnn/altexo.git","type":"git","directory":"packages/ai-gen"},"_npmVersion":"11.13.0","description":"Direct-API CLI + library for AI image/video generation (Nano Banana Pro, Veo 3.1, Kling 3, OpenAI gpt-image-1). A cheaper, reproducible alternative to aggregators for repeated templates.","directories":{},"_nodeVersion":"24.17.0","dependencies":{"yaml":"^2.6.0","dotenv":"^16.4.5","@google/genai":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ai-gen_0.10.1_1788410000872_0.2576413254144847","host":"s3://npm-registry-packages-npm-production"}},"0.11.0":{"name":"@altexo/ai-gen","version":"0.11.0","description":"Direct-API CLI + library for AI image/video generation (Nano Banana Pro, Veo 3.1, Kling 3, OpenAI gpt-image-1). A cheaper, reproducible alternative to aggregators for repeated templates.","license":"MIT","author":{"name":"Sergei Grigorev"},"type":"module","main":"./src/index.js","types":"./src/index.d.ts","exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js"},"./package.json":"./package.json"},"bin":{"altexo-ai-gen":"bin/altexo-ai-gen.js"},"engines":{"node":">=20.3"},"keywords":["ai","image-generation","video-generation","gemini","nano-banana","veo","kling","openai","gpt-image-1","dall-e","cli"],"repository":{"type":"git","url":"git+https://github.com/xorsnn/altexo.git","directory":"packages/ai-gen"},"homepage":"https://github.com/xorsnn/altexo/tree/main/packages/ai-gen#readme","bugs":{"url":"https://github.com/xorsnn/altexo/issues"},"publishConfig":{"access":"public"},"scripts":{"image":"node scripts/gen-image.js","openai":"node scripts/gen-openai.js","veo":"node scripts/gen-veo.js","kling":"node scripts/gen-kling.js","pipeline":"node scripts/gen-pipeline.js","element":"node scripts/gen-kling-element.js","test":"node --test"},"dependencies":{"@google/genai":"^1.0.0","dotenv":"^16.4.5","yaml":"^2.6.0"},"gitHead":"7f0a5eaa620fc2d5729ab37e55616d4bb8568e5c","_id":"@altexo/ai-gen@0.11.0","_nodeVersion":"24.17.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-OW4iY4UcuK5XOQM08jA5AFKDHmYQnAY4b6pVrvVRGL5THcWsiouwZgzGb5Vrgj/Uxc0e5gFOsMojS+ek6iIhzQ==","shasum":"37c96a71ee72c63f47cc023524a4285c0b735c83","tarball":"https://registry.npmjs.org/@altexo/ai-gen/-/ai-gen-0.11.0.tgz","fileCount":31,"unpackedSize":146239,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDHdoKB5iurKP1d/xMShw9u+a4+/mHAaDlX+C6tBo5zVAiAgKtT1ur87Kjnaa3n9xZ0/4LIxv/6VG5+3JvmOF6QFAA=="}]},"_npmUser":{"name":"xorsnn","email":"xors.nn@gmail.com"},"directories":{},"maintainers":[{"name":"xorsnn","email":"xors.nn@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ai-gen_0.11.0_1788499721026_0.07605409136520169"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-30T23:26:36.260Z","modified":"2026-09-04T05:28:41.309Z","0.1.0":"2026-05-30T23:26:36.620Z","0.2.1":"2026-05-31T08:31:30.462Z","0.3.0":"2026-06-06T06:44:57.823Z","0.3.1":"2026-06-06T07:21:02.103Z","0.3.2":"2026-06-06T12:22:58.181Z","0.4.0":"2026-06-07T12:12:22.024Z","0.5.0":"2026-06-11T12:13:05.913Z","0.6.0":"2026-06-16T03:57:26.220Z","0.7.0":"2026-06-17T06:34:52.224Z","0.8.0":"2026-09-02T08:05:47.739Z","0.9.0":"2026-09-02T21:35:58.142Z","0.10.0":"2026-09-03T03:32:14.041Z","0.10.1":"2026-09-03T04:33:21.025Z","0.11.0":"2026-09-04T05:28:41.149Z"},"bugs":{"url":"https://github.com/xorsnn/altexo/issues"},"author":{"name":"Sergei Grigorev"},"license":"MIT","homepage":"https://github.com/xorsnn/altexo/tree/main/packages/ai-gen#readme","keywords":["ai","image-generation","video-generation","gemini","nano-banana","veo","kling","openai","gpt-image-1","dall-e","cli"],"repository":{"type":"git","url":"git+https://github.com/xorsnn/altexo.git","directory":"packages/ai-gen"},"description":"Direct-API CLI + library for AI image/video generation (Nano Banana Pro, Veo 3.1, Kling 3, OpenAI gpt-image-1). A cheaper, reproducible alternative to aggregators for repeated templates.","maintainers":[{"name":"xorsnn","email":"xors.nn@gmail.com"}],"readme":"# @altexo/ai-gen\n\nDirect-API scripts for AI image and video generation. Calls **Nano Banana Pro**\n(image), **OpenAI gpt-image-1** (image), **Veo 3.1** (video), and **Kling 3**\n(video) over their native APIs and writes deterministic outputs into\n`out/<project>/YYYY-MM-DD_HHMM_<slug>_<model>/` with a `manifest.json`\nreproducibility receipt.\n\nIt's a cheaper, reproducible alternative to canvas-style aggregators when you run\nthe **same template many times** — every call is scripted from a small YAML file,\nso a shot is re-runnable and diff-able instead of hand-clicked.\n\nRelease notes live in [`CHANGELOG.md`](CHANGELOG.md).\n\n## Install\n\n```bash\nnpm install @altexo/ai-gen\n```\n\nOr work from a clone:\n\n```bash\ngit clone https://github.com/xorsnn/altexo.git\ncd altexo && npm install\ncd packages/ai-gen\ncp .env.example .env     # fill in your keys\n```\n\nNode >= 20.3.\n\n## Quickstart\n\n```bash\n# image (Nano Banana)\nnpm run image -- prompts/example.image.yaml\n\n# image (OpenAI gpt-image-1) — same YAML, different engine\nnpm run openai -- prompts/example.image.yaml\n\n# video (Veo)\nnpm run veo -- prompts/example.veo.yaml\n\n# video (Kling, official API)\nnpm run kling -- prompts/example.kling.yaml\n\n# image -> video pipeline\nnpm run pipeline -- prompts/example.pipeline.yaml\n```\n\nOutputs land in `out/<project>/YYYY-MM-DD_HHMM_<slug>_<modelAlias>/`. The project\nsubfolder groups every asset for one job side-by-side; the model alias in the\nsuffix keeps comparisons (e.g. `..._myshot_kling-pro` vs `..._myshot_veo-fast`)\nscannable at a glance. Every prompt YAML must declare a `project:` field — the\nscripts refuse to run without it (see [`prompts/_schema.md`](prompts/_schema.md)).\n`out/` is gitignored.\n\n## Library usage\n\nThe package is embeddable — import from the package root (deep `src/*` imports\nare not part of the contract). TypeScript declarations ship with the package.\nImporting loads **no `.env`** and never mutates `process.env` (only the CLI\nentry points read the package-local `.env`). The one thing that happens at\nimport time is a synchronous read of the packaged model-registry JSON — so a\nbad `AI_GEN_MODELS_CONFIG` path throws immediately instead of mispricing later.\n\n```js\nimport { generateImage, MissingKeyError, SafetyBlockError } from '@altexo/ai-gen';\n\nconst { images, modelId, costEstimate } = await generateImage({\n  prompt: 'a lighthouse at dusk, volumetric fog',\n  aspect: '9:16',\n  references: ['/tmp/parent-frame.png'], // read from disk — server-trusted paths only\n  numberOfImages: 3,\n  apiKey: userKey,                        // per-call; falls back to GEMINI_API_KEY\n  signal: controller.signal,              // optional AbortSignal\n  timeoutMs: 120_000,                     // default; 0 disables the bound\n});\n// images: [{ mimeType, data: Buffer }]\n```\n\nThe library **throws, never calls `process.exit`** — safe to embed in a server.\n`generateImage` failures carry a stable `code` for programmatic handling:\n`missing-key` (no/invalid key), `invalid-input` (unknown model, unreadable\nreference, bad count — deterministic, don't retry unchanged), `safety-block`\n(model returned zero images — rephrase and retry), `rate-limit` (a throttle —\nback off), `insufficient-balance` (the provider ACCOUNT is out of funds —\n**never** auto-retry; only a payment clears it), `network` (transport/5xx —\nretry), `unknown` (anything else, wrapped as `AiGenError`).\n\n**HTTP 429 is not one condition.** Kling returns it both for \"you are going too\nfast\" and for \"this account has no money left\", which is why those are two codes\nsince 0.10.0 rather than one. Treating them alike means an auto-retry loop\nhammering an account that cannot pay — and, on the other side, an alert that\npages whoever owns the deploy for a wallet they may not control. If you switch on\n`code`, give `insufficient-balance` its own branch.\n\nCaller aborts and timeouts surface unwrapped\n(`err.name === 'AbortError' | 'TimeoutError'`) — the library recovers the\ndistinction even though the underlying SDK drops abort reasons.\n\nTrust boundaries: `references` paths are read from disk and sent to the\nprovider — never wire raw user input into them (the reads are bounded by the\nsame abort/timeout as the provider call). `saveImages(images, outDir, prefix)`\ncreates `outDir` if missing; `outDir` must be server-trusted and `prefix` must\nbe a bare file-name fragment (path separators are rejected). File names are\ndeterministic, so a reused `outDir` fails loudly (`wx`) instead of silently\noverwriting a sibling generation. `saveImages` filesystem failures are raw\nNode errors, not taxonomy errors, and all writes have settled before it\nreturns or throws.\n\n### Video (Kling)\n\n`generateVideo` follows the same contract — validate-before-I/O, per-call keys,\nabort/timeout, the error taxonomy — and submits + polls the Kling task to\ncompletion (renders take minutes, so the default `timeoutMs` is **600s**):\n\n```js\nimport { generateVideo, saveVideo } from '@altexo/ai-gen';\n\nconst { videoUrl, taskId, costEstimate, durationSeconds } = await generateVideo({\n  prompt: 'slow push-in on the lighthouse, fog rolling',\n  model: 'kling-pro',          // verified 3–15s tier; default is 'kling-std'\n  duration: 5,\n  imagePath: '/tmp/head.png',  // head frame (image-to-video); omit for text-to-video\n  imageTailPath: '/tmp/tail.png', // optional tail frame — requires imagePath\n  apiKey,                      // per-call; falls back to KLING_API_KEY\n  signal: controller.signal,   // cancels submit, polls, and the file reads\n  timeoutMs: 600_000,          // default; 0 disables the bound\n});\nawait saveVideo(videoUrl, '/tmp/out'); // downloads to /tmp/out/video-01.mp4\n```\n\n`taskId` is the provider task id — record it to observe or resume a render.\nCost: `costEstimate` (and the standalone `estimateVideoCost(model, seconds,\n{ audio })`) is `priceVideo` × the model's audio multiplier. Kling renders one\nclip per task; run N calls in parallel for N variants. Failures carry the same\n`code`s as `generateImage`; a content-rejected task surfaces as an `AiGenError`.\n\n#### Checking a Kling key without rendering\n\nKling has no unauthenticated probe, so `validateKlingApiKey` answers \"is this\ncredential live?\" with one cheap authenticated GET instead of a paid render:\n\n```js\nimport { validateKlingApiKey } from '@altexo/ai-gen';\n\nconst r = await validateKlingApiKey({ apiKey }); // timeoutMs default 8s\n// { status: 'valid' }\n// { status: 'invalid', message }      the provider refused these credentials\n// { status: 'unavailable', message }  no verdict: outage, 429, timeout, abort\n```\n\nIt **never throws** — an unusable credential is a verdict, not an exception, so\nthere is no try/catch to write. The key is per-call only here (no env fallback), and\nthe provider's body is never echoed into `message`, so a result is safe to log.\n\nTreat the three-way split as load-bearing: only `invalid` means the provider\nactually refused the pair. If you demote or delete a stored key, do it on\n`invalid` alone — acting on `unavailable` costs a user a working credential\nduring a provider blip.\n\n**Next.js embedders:** add `serverExternalPackages: ['@altexo/ai-gen']` to\n`next.config.js`. The model registry is read from a packaged JSON at runtime\nvia `import.meta.url`-relative paths, which breaks if the bundler inlines the\npackage.\n\nAlso exported: `saveImages`, `extractImages`, `saveVideo`, `MODELS`,\n`priceImage`, `priceVideo`, `estimateImageCost`, `estimateVideoCost`,\n`classifyError`, and the error classes. Off the surface until hardened to the\nsame contract: Veo and the OpenAI image generator.\n\n## Configuration\n\nThe toolkit runs from config — nothing is hardcoded to a particular machine or repo.\n\n**API keys.** The CLI loads `.env` if present — package-local when run from a\nclone, from your current directory when installed via npm/`npx` (that's where\n`altexo-ai-gen init` writes it). The library never loads `.env` — pass `apiKey`\nper call or set the env vars yourself. Values already in your shell environment\ntake precedence. Required:\n\n- `GEMINI_API_KEY` — Nano Banana + Veo — <https://aistudio.google.com/apikey>\n- `KLING_API_KEY` — Kling — <https://app.klingai.com/global/dev/account>\n- `OPENAI_API_KEY` — gpt-image-1 (optional) — <https://platform.openai.com/api-keys>\n\nSee [`.env.example`](.env.example).\n\n**Model registry + pricing** live in [`models.default.json`](models.default.json)\n(data, not code; `src/models.js` reads it). To change model IDs or prices without\nediting source, set `AI_GEN_MODELS_CONFIG` to a JSON file path (absolute, or\nrelative to cwd). It layers **per-model shallow replace**: a model present in your\noverride replaces the default entry wholesale, models you don't mention keep their\ndefaults, and new aliases are added. A bad path throws — a misconfigured override\nsurfaces immediately rather than silently mispricing.\n\n```jsonc\n// my-models.json — bump Kling Pro's price and swap its model id\n{ \"kling-pro\": { \"vendor\": \"kling\", \"id\": \"kling-v3.1\", \"mode\": \"pro\",\n                 \"kind\": \"video\", \"pricing\": { \"5\": 0.50, \"10\": 1.00 } } }\n```\n\n```bash\nAI_GEN_MODELS_CONFIG=./my-models.json npm run kling -- prompts/example.kling.yaml\n```\n\n**Output root.** Defaults to the package's own `out/` directory — that is\n`./out` when you work from a clone's package root, but for npm/`npx` installs\nit lands inside the installed package copy. Set `AI_GEN_OUT_ROOT` (absolute, or\nrelative to cwd) to write elsewhere — recommended for installed use.\n\n## Prompt files\n\nYAML — see [`prompts/_schema.md`](prompts/_schema.md) for the full field reference.\nThe `prompts/example.*.yaml` files are working samples for each generator.\n\n## Cost reference (per single generation, USD)\n\nNative API list prices, from `models.default.json`:\n\n| Model               | Output        | Native API |\n| ------------------- | ------------- | ---------: |\n| Nano Banana Pro 1K  | image         | $0.134     |\n| Nano Banana Pro 2K  | image         | $0.134     |\n| Nano Banana Pro 4K  | image         | $0.24      |\n| Nano Banana Flash   | image         | $0.039     |\n| gpt-image-1 (high)  | image (2:3)   | ~$0.25     |\n| Veo 3.1 (8s)        | video + audio | $3.20      |\n| Veo 3.1 Fast (8s)   | video + audio | $1.20      |\n| Kling 3 Master      | video         | ~$0.14/s   |\n| Kling 3 Pro         | video         | ~$0.084/s  |\n| Kling 3 Std         | video         | ~$0.042/s  |\n\nAggregators that resell these models typically mark them up ~1.5–3× (and often\ngate them behind a subscription), which is the whole reason this calls the native\nAPIs directly. Each run's `manifest.json` records the cost estimate. Prices\napproximate as of mid-2026 — verify against the providers' current pricing.\n\nKling 3 bills **per second** over a 3–15s clip (e.g. kling-pro: 5s ≈ $0.42, 10s ≈ $0.84,\n15s ≈ $1.26); the per-second rates are derived from the legacy 5/10s points. `kling-pro`\nwith `audio: true` doubles (2× `audioMultiplier`).\n\n## Model notes\n\n### Nano Banana Pro — `src/nano-banana.js`\n- Model ID `gemini-3-pro-image-preview` (use `nano-banana-flash` →\n  `gemini-2.5-flash-image` for cheaper drafts).\n- SDK `@google/genai`, `ai.models.generateContent({...})` with\n  `responseModalities: ['IMAGE']`.\n- Aspect ratios: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9.\n- Up to 14 reference images via `references:` — how you keep style/character\n  consistent across a series.\n- Outputs carry an invisible SynthID watermark.\n\n### Veo 3.1 — `src/veo.js`\n- Model IDs `veo-3.1-generate-preview` or `veo-3.1-fast-generate-preview`\n  (~3× cheaper).\n- Same `GEMINI_API_KEY`. SDK `ai.models.generateVideos({...})` returns a\n  long-running op; the wrapper polls every 10s and downloads the MP4 (Veo URIs\n  need the API key as a `?key=` param to download).\n- Length 4/6/8s. Native audio on by default (`audio: false` to disable).\n- `image_input:` animates a still — the natural pairing with Nano Banana.\n- A single video typically takes 1–4 minutes.\n\n### Kling 3 — `src/kling.js`\n- Kuaishou's official international API at `https://api.klingai.com`.\n- **On the stable library surface as of 0.6.0** — `generateVideo` /\n  `saveVideo` import from the package root and follow the `generateImage`\n  contract (per-call `apiKey`, `signal`/`timeoutMs`, the error\n  taxonomy, the stable return shape). See \"Video (Kling)\" under Library usage.\n- Auth: a single `KLING_API_KEY`, sent verbatim as `Authorization: Bearer <key>`.\n  Kling documents the older access-key/secret-key JWT pair as legacy and the console\n  issues one API key; **0.9.0 removed the JWT path entirely** (and with it the\n  `jsonwebtoken` dependency).\n- `validateKlingApiKey({ apiKey })` probes the same host with the same credential and\n  returns `valid` / `invalid` / `unavailable` — the only way to check a key without\n  paying for a render.\n- Model IDs are best-guess for Kling 3 — if you get `invalid model_name`, open the\n  [Kling dev console](https://app.klingai.com/global/dev), trigger a working\n  request, and copy the exact `model_name` from the Network tab into your\n  `AI_GEN_MODELS_CONFIG` override.\n- Length: Kling 3 (pro/std) is the integer range **3–15s** (default 5); legacy tiers were\n  5/10. Allowed values are data-driven per model (`models.default.json` `durations`); the\n  wrapper rejects an out-of-range length. `image_input:` is base64-encoded into the request\n  (no upload step).\n- Native audio on **kling-pro**: set `audio: true` for synced SFX / ambient — the\n  wrapper sends the official Kling `sound: \"on\"` field. Pro tier only, single start\n  frame only (not with `image_tail`), billed at the model's `audioMultiplier` (~2×).\n  Other tiers are silent — pair with a music bed in your editor.\n- **Multi-shot** (Kling v3): `multi_shot: [{ prompt, seconds }]` (≤6 shots) splits one clip\n  into prompted segments; the seconds sum to the clip length (3–15). `shot_type: customize`\n  honors the list, `intelligence` auto-storyboards. Good for a motion *arc*, not a\n  hold-still beat. (lib: `generateVideo({ multiShot, shotType })`.)\n- **Reference subjects / elements** (Kling v3): keep a character/object consistent across the\n  clip. Build a reusable element with `node scripts/gen-kling-element.js <name> <frontal.png>\n  <refer1.png> [refer2 ...]` (a frontal + 1–3 refer images), or inline via `elements: [{name,\n  description, images}]`; then reference it in the prompt as `<<<element_1>>>` (max 3). lib:\n  `createElement({ imagePaths, apiKey })` + `generateVideo({ elementIds, apiKey })` — pass the\n  **same** key to both: an element lives inside one Kling account and its id resolves nowhere\n  else, so a caller working across two credentials builds one element per account.\n- Base URL override: `KLING_BASE_URL` (the international host moved to\n  `api-singapore.klingai.com`; the default `api.klingai.com` still resolves).\n- Rate limits are stricter than Google's; keep calls sequential.\n\n### OpenAI gpt-image-1 — `src/openai-image.js`\n- A second image engine, handy for **A/B**: feed the *same* prompt YAML to\n  `npm run openai` and `npm run image` and compare gpt-image-1 against Nano Banana.\n- Auth: `OPENAI_API_KEY`. Dependency-free raw `fetch` against the Images API;\n  mirrors the `nano-banana.js` shape so the same save / out-dir plumbing is reused.\n- Sizes are fixed: `1024x1536` (2:3), `1024x1024` (1:1), `1536x1024` (3:2). **There\n  is no true 9:16** — a `9:16` input maps to `1024x1536` and the manifest records the\n  actual pixel `size`. `quality:` is `low` / `medium` / `high` (default `high`).\n\n### Pipeline — `scripts/gen-pipeline.js`\nChains Nano Banana → Veo or Kling in one call, so you get a high-fidelity hero\nframe instead of letting the video model hallucinate the first frame from text.\nSee [`prompts/example.pipeline.yaml`](prompts/example.pipeline.yaml).\n\n## Reproducibility\n\n`out/<run>/manifest.json` captures the project, prompt, model ID, params, timing,\nand cost estimate — everything needed to re-run a generation. Commit a manifest\nalongside an asset if you want a permanent record of how it was made.\n\n## License\n\nMIT © Sergei Grigorev\n","readmeFilename":"README.md"}