{"_id":"@aphexcms/ai-openai","_rev":"3-097a219b07f6131d874dd9ce08994a1e","name":"@aphexcms/ai-openai","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@aphexcms/ai-openai","version":"0.1.0","license":"MIT","_id":"@aphexcms/ai-openai@0.1.0","maintainers":[{"name":"rainbowasian96","email":"benjaminsinidol@gmail.com"}],"homepage":"https://github.com/IcelandicIcecream/aphex#readme","bugs":{"url":"https://github.com/IcelandicIcecream/aphex/issues"},"dist":{"shasum":"32163aa35add68b5141e43f68c3ccbd898757d0c","tarball":"https://registry.npmjs.org/@aphexcms/ai-openai/-/ai-openai-0.1.0.tgz","fileCount":5,"integrity":"sha512-AQN0B7mDUPYxWmnpQ0rSrGzEtwsf9fMKlZS9YbqsaAPA2YDImifsyX+C/mw5A7nI+Ii/zBZ21LDFWRT5wMmhHw==","signatures":[{"sig":"MEUCIGUfNgmNxpqXnKvI+aVxsRbu0rhPBl+KJR83XRWZGEktAiEA1yqJNyU4r4HqvyOHX6GOm8tSpG3s5rzXEx50AjAYb1s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13119},"main":"./src/index.js","type":"module","types":"./src/index.d.ts","exports":{".":{"types":"./src/index.d.ts","import":"./src/index.js","default":"./src/index.js"}},"gitHead":"657db9e3ec1f2251bc98fd2e132616a050545d6e","scripts":{"build":"tsc","prepack":"node ../../scripts/swap-package-paths.js ./package.json dist","postpack":"node ../../scripts/swap-package-paths.js ./package.json src","dev:local":"node ../../scripts/swap-package-paths.js ./package.json src"},"_npmUser":{"name":"rainbowasian96","email":"benjaminsinidol@gmail.com"},"repository":{"url":"git+https://github.com/IcelandicIcecream/aphex.git","type":"git","directory":"packages/ai-openai"},"_npmVersion":"11.12.1","directories":{},"_nodeVersion":"26.0.0","dependencies":{"openai":"^6.48.0","@aphexcms/cms-core":"workspace:^"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@aphexcms/cms-core":"workspace:^"},"peerDependencies":{"@aphexcms/cms-core":"workspace:^"},"_npmOperationalInternal":{"tmp":"tmp/ai-openai_0.1.0_1785601097177_0.8638166205919817","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@aphexcms/ai-openai","version":"0.1.1","license":"MIT","_id":"@aphexcms/ai-openai@0.1.1","maintainers":[{"name":"rainbowasian96","email":"benjaminsinidol@gmail.com"}],"homepage":"https://github.com/IcelandicIcecream/aphex#readme","bugs":{"url":"https://github.com/IcelandicIcecream/aphex/issues"},"dist":{"shasum":"698ed4c45b77d713d1b616b8eb78fcf287515540","tarball":"https://registry.npmjs.org/@aphexcms/ai-openai/-/ai-openai-0.1.1.tgz","fileCount":6,"integrity":"sha512-uStedswkP22qkXJGBwU1zLjw0kG8Hdns/6uk2/fQL0nS1q68sSpUXCa4s+ynpbjHnAppCwnuvF2BIv9WgPu2CA==","signatures":[{"sig":"MEQCICfhhf3K1TAh1l/urIoIUe+cEbTnsfJ9WjQbGC1/uqXLAiAw+rjCKcMKPwZyayZ3rtNbShPJiVfFOMh96zNQgacE7A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14084},"main":"./dist/index.js","type":"module","_from":"file:aphexcms-ai-openai-0.1.1.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"build":"tsc","dev:local":"node ../../scripts/swap-package-paths.js ./package.json src"},"_npmUser":{"name":"rainbowasian96","email":"benjaminsinidol@gmail.com"},"_resolved":"/private/var/folders/lg/xjmlrfd55zd3z62k81158q200000gn/T/839d04806a5943d09dabd57405ab1436/aphexcms-ai-openai-0.1.1.tgz","_integrity":"sha512-uStedswkP22qkXJGBwU1zLjw0kG8Hdns/6uk2/fQL0nS1q68sSpUXCa4s+ynpbjHnAppCwnuvF2BIv9WgPu2CA==","repository":{"url":"git+https://github.com/IcelandicIcecream/aphex.git","type":"git","directory":"packages/ai-openai"},"_npmVersion":"11.12.1","directories":{},"_nodeVersion":"26.0.0","dependencies":{"openai":"^6.48.0","@aphexcms/cms-core":"^9.7.0"},"publishConfig":{"access":"public","provenance":false},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@aphexcms/cms-core":"^9.7.0"},"peerDependencies":{"@aphexcms/cms-core":"^9.7.0"},"_npmOperationalInternal":{"tmp":"tmp/ai-openai_0.1.1_1785601536221_0.7767621274237606","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@aphexcms/ai-openai","version":"0.1.2","license":"MIT","publishConfig":{"access":"public","provenance":true},"repository":{"type":"git","url":"git+https://github.com/IcelandicIcecream/aphex.git","directory":"packages/ai-openai"},"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"dependencies":{"openai":"^6.48.0"},"peerDependencies":{"@aphexcms/cms-core":">=11.0.0"},"devDependencies":{"typescript":"^5.9.3","@aphexcms/cms-core":"^11.0.0"},"scripts":{"build":"tsc","dev:local":"node ../../scripts/swap-package-paths.js ./package.json src"},"_id":"@aphexcms/ai-openai@0.1.2","description":"OpenAI-compatible model backend for the in-admin agent in [AphexCMS](https://github.com/IcelandicIcecream/aphex).","bugs":{"url":"https://github.com/IcelandicIcecream/aphex/issues"},"homepage":"https://github.com/IcelandicIcecream/aphex#readme","_integrity":"sha512-DFKwGxrdAv577P/Vym7ZcDBRfO6wZlMtI3awzP/i4w55m2X5JF9T9p7Zxej9hMcpKxcDOlLB7NEOPk6qvmTrdw==","_resolved":"/tmp/7f288f5fec39af737f5b1b7e1ef81615/aphexcms-ai-openai-0.1.2.tgz","_from":"file:aphexcms-ai-openai-0.1.2.tgz","_nodeVersion":"24.20.0","_npmVersion":"11.19.1","dist":{"integrity":"sha512-DFKwGxrdAv577P/Vym7ZcDBRfO6wZlMtI3awzP/i4w55m2X5JF9T9p7Zxej9hMcpKxcDOlLB7NEOPk6qvmTrdw==","shasum":"813974af3f159d6e0b8225b90cbad341bb33ede2","tarball":"https://registry.npmjs.org/@aphexcms/ai-openai/-/ai-openai-0.1.2.tgz","fileCount":7,"unpackedSize":15962,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aphexcms%2fai-openai@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGP65WIWpgtnbVAPsdknrfpvzhpj8M6PferQtTb1qNoZAiBSqs6/G2HSrg8CE9AHzbc5oHV4tgW6LgZXvLEfh5txSw=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:ed5b7b52-1a2f-4a12-a737-fae851461fda"}},"directories":{},"maintainers":[{"name":"rainbowasian96","email":"benjaminsinidol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ai-openai_0.1.2_1788805978754_0.4528264040976011"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-01T16:18:16.993Z","modified":"2026-09-07T18:32:59.256Z","0.1.0":"2026-08-01T16:18:17.324Z","0.1.1":"2026-08-01T16:25:36.361Z","0.1.2":"2026-09-07T18:32:58.894Z"},"bugs":{"url":"https://github.com/IcelandicIcecream/aphex/issues"},"license":"MIT","homepage":"https://github.com/IcelandicIcecream/aphex#readme","repository":{"type":"git","url":"git+https://github.com/IcelandicIcecream/aphex.git","directory":"packages/ai-openai"},"maintainers":[{"name":"rainbowasian96","email":"benjaminsinidol@gmail.com"}],"readme":"# @aphexcms/ai-openai\n\nOpenAI-compatible model backend for the in-admin agent in [AphexCMS](https://github.com/IcelandicIcecream/aphex).\n\nImplements the `AIProviderAdapter` port from `@aphexcms/cms-core`. Points at anything speaking the OpenAI chat-completions API — OpenAI itself, OpenRouter, or a local router like Ollama's compatibility endpoint.\n\nThe agent is **off unless a provider is configured**: with no `aiProvider`, the route 404s rather than existing unauthenticated.\n\n## Install\n\n```bash\npnpm add @aphexcms/ai-openai\n```\n\n## Quick start\n\n```ts title=\"aphex.config.ts\"\nimport { createOpenAIAdapter } from '@aphexcms/ai-openai';\n\nexport default createCMSConfig({\n\tschemaTypes,\n\tdatabase: db,\n\taiProvider: createOpenAIAdapter({ apiKey: env.OPENAI_API_KEY }),\n\tagentModel: 'gpt-5.4-mini'\n});\n```\n\n`agentModel` is required whenever `aiProvider` is set — there is no default model, because the right one depends on which endpoint you pointed at.\n\n### OpenRouter\n\n```ts\nimport { createOpenRouterAdapter } from '@aphexcms/ai-openai';\n\naiProvider: createOpenRouterAdapter({ apiKey: env.OPENROUTER_API_KEY });\n```\n\n### A local endpoint\n\nAny OpenAI-compatible base URL works. `apiKey` can be a placeholder for a local router that doesn't check it:\n\n```ts\ncreateOpenAIAdapter({\n\tbaseURL: 'http://127.0.0.1:10531/v1',\n\tapiKey: 'local'\n});\n```\n\n## Customising the prompt\n\n`agentSystemPrompt` in `createCMSConfig()` replaces the built-in system prompt outright. The default one already describes the schema system and the tools available, so replace it only when you want different behaviour, not to append to it.\n\n## License\n\nMIT\n","readmeFilename":"README.md","description":"OpenAI-compatible model backend for the in-admin agent in [AphexCMS](https://github.com/IcelandicIcecream/aphex)."}