Writes product titles, descriptions, attribute lists and translations into chosen fields of configured collections. Provider, model and API key are set in an admin settings global, and generation runs on save or through a single endpoint. A stored fingerprint of source content and targets prevents paying twice for unchanged content. Requires Payload 3.88 or newer and the ecommerce plugin.
Claude, ChatGPT, Gemini and Kimi for Payload: writes product descriptions, attribute lists and translations into the fields you choose, and never twice for the same content.
Installation
npm i payload-ai-manager1
Stars
0
Forks
0
Open Issues
2 weeks ago
Last Updated
22
Weekly Downloads
v1.0.1
npm Version
52.6 KB
Unpacked Size
0
Dependencies
10 since Sep 6
| Date | Stars |
|---|---|
| Dec 5, 2026 | 1 |
| Dec 4, 2026 | 1 |
| Dec 3, 2026 | 1 |
| Dec 2, 2026 | 1 |
| Dec 1, 2026 | 1 |
| Nov 30, 2026 | 1 |
| Nov 29, 2026 | 1 |
| Nov 28, 2026 | 1 |
| Nov 27, 2026 | 1 |
| Nov 26, 2026 | 1 |
| Nov 25, 2026 | 1 |
| Nov 24, 2026 | 1 |
| Nov 23, 2026 | 1 |
| Nov 22, 2026 | 1 |
| Nov 21, 2026 | 1 |
| Nov 20, 2026 | 1 |
| Nov 19, 2026 | 1 |
| Nov 18, 2026 | 1 |
| Nov 17, 2026 | 1 |
| Nov 16, 2026 | 1 |
| Nov 15, 2026 | 1 |
| Nov 14, 2026 | 1 |
| Nov 13, 2026 | 1 |
| Nov 12, 2026 | 1 |
| Nov 11, 2026 | 1 |
| Nov 10, 2026 | 1 |
| Nov 9, 2026 | 1 |
| Nov 8, 2026 | 1 |
| Nov 7, 2026 | 1 |
| Nov 6, 2026 | 1 |
| Nov 5, 2026 | 1 |
| Nov 4, 2026 | 1 |
| Nov 3, 2026 | 1 |
| Nov 2, 2026 | 1 |
| Nov 1, 2026 | 1 |
| Oct 31, 2026 | 1 |
| Oct 30, 2026 | 1 |
| Oct 29, 2026 | 1 |
| Oct 28, 2026 | 1 |
| Oct 27, 2026 | 1 |
| Oct 26, 2026 | 1 |
| Oct 25, 2026 | 1 |
| Oct 24, 2026 | 1 |
| Oct 23, 2026 | 1 |
| Oct 22, 2026 | 1 |
| Oct 21, 2026 | 1 |
| Oct 20, 2026 | 1 |
| Oct 19, 2026 | 1 |
| Oct 18, 2026 | 1 |
| Oct 17, 2026 | 1 |
| Oct 16, 2026 | 1 |
| Oct 15, 2026 | 1 |
| Oct 14, 2026 | 1 |
| Oct 13, 2026 | 1 |
| Oct 12, 2026 | 1 |
| Oct 11, 2026 | 1 |
| Oct 10, 2026 | 1 |
| Oct 9, 2026 | 1 |
| Oct 8, 2026 | 1 |
| Oct 7, 2026 | 1 |
| Oct 6, 2026 | 1 |
| Oct 5, 2026 | 1 |
| Oct 4, 2026 | 1 |
| Oct 3, 2026 | 1 |
| Oct 2, 2026 | 1 |
| Oct 1, 2026 | 1 |
| Sep 30, 2026 | 1 |
| Sep 29, 2026 | 1 |
| Sep 28, 2026 | 1 |
| Sep 27, 2026 | 1 |
| Sep 26, 2026 | 1 |
| Sep 25, 2026 | 1 |
| Sep 24, 2026 | 1 |
| Sep 23, 2026 | 1 |
| Sep 22, 2026 | 1 |
| Sep 21, 2026 | 1 |
| Sep 20, 2026 | 1 |
| Sep 19, 2026 | 1 |
| Sep 18, 2026 | 1 |
| Sep 17, 2026 | 1 |
| Sep 16, 2026 | 1 |
| Sep 15, 2026 | 1 |
| Sep 14, 2026 | 1 |
| Sep 13, 2026 | 1 |
| Sep 12, 2026 | 1 |
| Sep 11, 2026 | 1 |
| Sep 10, 2026 | 1 |
| Sep 9, 2026 | 1 |
| Sep 8, 2026 | 1 |
| Sep 7, 2026 | 1 |
| Sep 6, 2026 | 1 |
18−2 since Sep 6
| Date | Weekly downloads |
|---|---|
| Dec 5, 2026 | 18 |
| Dec 4, 2026 | 19 |
| Dec 3, 2026 | 25 |
| Dec 2, 2026 | 25 |
| Dec 1, 2026 | 27 |
| Nov 30, 2026 | 26 |
| Nov 29, 2026 | 33 |
| Nov 28, 2026 | 42 |
| Nov 27, 2026 | 51 |
| Nov 26, 2026 | 233 |
| Nov 25, 2026 | 233 |
| Nov 24, 2026 | 230 |
| Nov 23, 2026 | 225 |
| Nov 22, 2026 | 218 |
| Nov 21, 2026 | 209 |
| Nov 20, 2026 | 198 |
| Nov 19, 2026 | 9 |
| Nov 18, 2026 | 10 |
| Nov 17, 2026 | 11 |
| Nov 16, 2026 | 14 |
| Nov 15, 2026 | 14 |
| Nov 14, 2026 | 15 |
| Nov 13, 2026 | 19 |
| Nov 12, 2026 | 20 |
| Nov 11, 2026 | 19 |
| Nov 10, 2026 | 18 |
| Nov 9, 2026 | 16 |
| Nov 8, 2026 | 16 |
| Nov 7, 2026 | 15 |
| Nov 6, 2026 | 10 |
| Nov 5, 2026 | 11 |
| Nov 4, 2026 | 11 |
| Nov 3, 2026 | 12 |
| Nov 2, 2026 | 15 |
| Nov 1, 2026 | 13 |
| Oct 31, 2026 | 15 |
| Oct 30, 2026 | 15 |
| Oct 29, 2026 | 12 |
| Oct 28, 2026 | 11 |
| Oct 27, 2026 | 11 |
| Oct 26, 2026 | 8 |
| Oct 25, 2026 | 8 |
| Oct 24, 2026 | 7 |
| Oct 23, 2026 | 7 |
| Oct 22, 2026 | 9 |
| Oct 21, 2026 | 9 |
| Oct 20, 2026 | 7 |
| Oct 19, 2026 | 8 |
| Oct 18, 2026 | 7 |
| Oct 17, 2026 | 7 |
| Oct 16, 2026 | 7 |
| Oct 15, 2026 | 7 |
| Oct 14, 2026 | 10 |
| Oct 13, 2026 | 10 |
| Oct 12, 2026 | 8 |
| Oct 11, 2026 | 12 |
| Oct 10, 2026 | 12 |
| Oct 9, 2026 | 12 |
| Oct 8, 2026 | 11 |
| Oct 7, 2026 | 8 |
| Oct 6, 2026 | 11 |
| Oct 5, 2026 | 10 |
| Oct 4, 2026 | 7 |
| Oct 3, 2026 | 6 |
| Oct 2, 2026 | 9 |
| Oct 1, 2026 | 9 |
| Sep 30, 2026 | 12 |
| Sep 29, 2026 | 10 |
| Sep 28, 2026 | 10 |
| Sep 27, 2026 | 11 |
| Sep 26, 2026 | 17 |
| Sep 25, 2026 | 14 |
| Sep 24, 2026 | 14 |
| Sep 23, 2026 | 12 |
| Sep 22, 2026 | 12 |
| Sep 21, 2026 | 13 |
| Sep 20, 2026 | 14 |
| Sep 19, 2026 | 7 |
| Sep 18, 2026 | 8 |
| Sep 17, 2026 | 9 |
| Sep 16, 2026 | 13 |
| Sep 15, 2026 | 12 |
| Sep 14, 2026 | 12 |
| Sep 13, 2026 | 10 |
| Sep 12, 2026 | 10 |
| Sep 11, 2026 | 10 |
| Sep 10, 2026 | 10 |
| Sep 9, 2026 | 7 |
| Sep 8, 2026 | 10 |
| Sep 7, 2026 | 16 |
| Sep 6, 2026 | 20 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1341834252-root)<a href="https://payloaddirectory.dev/plugins/1341834252-root"><img src="https://payloaddirectory.dev/badge/1341834252-root.svg" alt="Payload Directory"></a>README
Claude, ChatGPT, Gemini and Kimi for Payload. Writes product titles, descriptions, attribute lists and translations into the fields you name and no others, and refuses to pay for the same content twice.
kind | Output | Default maxLength |
|---|---|---|
title | A product title on one line. Names the product, not its benefits. No quotes, no trailing full stop. | 70 |
description | A product description in plain prose. No headings, no markdown, no bullet points. | unlimited |
attributes | An array of Name: value strings, only for attributes the source material supports. | unlimited |
translation | The source material in the locale you name. Translates only — adds and removes nothing. | unlimited |
The 70 character default on title is where a product title stops being read in listings,
search results and browser tabs. Override it per target with maxLength.
Every target gets a switch under Fields to write in the settings global, labelled with the field and what is written into it. An editor can turn one off without touching the config or redeploying. A target that is off is not sent to the model at all, and the content already in that field is left exactly as it is — nothing is cleared.
Fields the plugin writes to carry a note under them in the edit view saying so. This is
Payload's admin.description, plain text rather than a custom component: components are the
part of the admin that changes between minor releases, and this plugin is built to survive
those untouched. A field that already has its own description keeps it.
| Requirement | Version | Declared as |
|---|---|---|
payload | >=3.88 <4 | peer dependency |
@payloadcms/plugin-ecommerce | >=3.88 <4 | peer dependency |
@anthropic-ai/sdk | >=0.60.0 <1 | optional peer dependency, needed only for Claude |
| Node | >=20 | engines |
The floor is the version this package was actually tested against, not the oldest that might work. Verified end to end on Payload 3.88.0 with the official ecommerce plugin, on both PostgreSQL and MongoDB. When a newer version is verified the floor moves up and a release goes out.
Requires Payload 3.88 or newer and @payloadcms/plugin-ecommerce 3.88 or newer.
pnpm add payload-ai-manager
Claude is called through the official Anthropic SDK, which is an optional peer dependency. Install it only if you intend to use Claude:
pnpm add @anthropic-ai/sdk
ChatGPT, Gemini and Kimi are called over their REST APIs with fetch and need nothing installed. If Claude is selected while the SDK is absent, generation fails with a message telling you to install it; nothing crashes and no other provider is affected.
import { aiManagerPlugin } from 'payload-ai-manager'
export default buildConfig({
plugins: [
aiManagerPlugin({
collections: {
products: {
sourceFields: ['title', 'brand', 'categories'],
targets: [
{ field: 'title', kind: 'title' },
{ field: 'description', kind: 'description', maxLength: 600 },
{ field: 'attributes', kind: 'attributes' },
{ field: 'descriptionEl', kind: 'translation', locale: 'Greek' },
],
auto: false,
},
},
}),
],
})
Then open AI Manager in the admin panel, choose a provider, point it at a key, and switch generation on. Nothing is sent anywhere until you do.
Measured on 21 August 2026 against @payloadcms/plugin-ecommerce 3.88.0 and the npm registry.
| Question | Answer |
|---|---|
| Does the ecommerce plugin generate any content? | No. Nothing in it calls a model |
| Is there already an AI plugin for Payload? | Yes, @ai-stack/payloadcms, actively maintained |
| Does it support Kimi? | No. Its published files contain no reference to moonshot or kimi |
| Does it know the ecommerce plugin, or product attributes? | No. Neither term appears in it |
| Does it record what it already generated? | No fingerprint, no already-generated guard |
| How large is it? | 1.6 MB, with 19 files importing React |
That is the gap: four providers including Kimi, aimed at a product catalogue, refusing to regenerate content that has not changed, in about 24 kB with no React anywhere.
Every provider was called at its real endpoint with a deliberately invalid key. All four rejected the credential and nothing else, which means all four accepted the shape of the request.
| Provider | Response to an invalid key |
|---|---|
| Claude | 401 authentication_error, "API key is invalid." |
| ChatGPT | 401, "Incorrect API key provided" |
| Kimi | 401, "Invalid Authentication" |
| Gemini | 400 INVALID_ARGUMENT, "API key not valid." |
Gemini reports a bad key as 400, not 401, so the error body is inspected before a 400 is classified. All four surface as an authentication failure carrying the provider's own wording.
The successful path was exercised against a local server answering in each vendor's response shape. No valid key has been used, so a successful generation from a real vendor has not been observed.
| Situation | Result |
|---|---|
| Model returns every field empty | Refused. Existing copy is left untouched |
| Model answers only some fields | Only those fields are written |
| Model returns text that is not JSON | Refused with INVALID_RESPONSE |
Model returns 900 characters against a maxLength of 400 | Truncated to 400 |
| Provider returns 429 | Refused with RATE_LIMIT |
Claude returns stop_reason: refusal | Refused with REFUSED |
Provider takes 6 seconds, auto off | The save takes 0.06 seconds. It does not wait |
| Prompt injection in a source field | Stays in the user message. It never reaches the system prompt |
__proto__ in the model's JSON | No prototype pollution. Only configured targets are read |
| Endpoint called with no token, or a bad one | 403 |
Both paths, automatic and manual, run through the same function. Six gates stand between a save and a paid API call, in this order:
force was passedFailing any of the first five is a skipped with a reason. Failing the sixth is a failed. Neither ever leaves a document half written.
Every generated document stores a fingerprint: a SHA-256 over the source field values and the target definitions, truncated to 32 characters.
Including the targets matters. Change your instructions, add a target or alter a locale, and the fingerprint changes, so the document is regenerated even though the product itself did not change.
The hash is stable in the ways that would otherwise cause false work. Key order does not affect it at any depth. A relationship counts as its id, so reading a document at depth 0 or depth 2 produces the same answer. A field that is absent and a field set to null are the same thing.
The system prompt is assembled from your targets: one line per field, worded differently for each kind — prose for a description, Name: value for attributes, translate-only for a translation. Above them sit the rules against invention. Below them, your house style.
The user message contains only the source fields you named. Whatever a catalogue editor typed stays there and is never promoted into the system prompt.
The afterChange hook marks req.context before saving its result, and returns early when it sees that mark. One save produces one API call, not a loop. A failure is logged and the save proceeds: losing generated copy is better than losing the document.
| Provider | Transport | Request shape | Default model |
|---|---|---|---|
| Claude | Official SDK, imported dynamically | output_config.format with a JSON schema, thinking: adaptive | claude-opus-5 |
| ChatGPT | fetch | response_format.json_schema, strict: true | gpt-4.1 |
| Kimi | fetch, same code as ChatGPT | identical, different base URL | kimi-k2-0905-preview |
| Gemini | fetch | responseSchema, with additionalProperties stripped | gemini-2.5-flash |
Kimi's API is OpenAI compatible, so it reuses that client with https://api.moonshot.ai/v1. Mainland China users set the base URL to https://api.moonshot.cn/v1. Gemini rejects additionalProperties, so that keyword is removed for Gemini only.
Every provider is asked for a JSON object matching a schema built from your targets, with all of them required.
| Option | Default | Meaning |
|---|---|---|
collections | required | Which collections take part, keyed by slug |
collections[slug].sourceFields | required | Fields read to build the prompt. A missing one is skipped, not an error |
collections[slug].targets | required | Fields written. At least one |
collections[slug].auto | false | Generate on create, and whenever the source fields change |
disabled | false | Stops generation, leaves fields and settings in place |
maxOutputTokens | 2048 | Upper bound per request |
settingsSlug | 'ai-manager' | Slug of the settings global |
statusField | 'aiStatus' | Name of the group recording what was generated |
Each target takes:
| Field | Required | Meaning |
|---|---|---|
field | yes | The field written. Dot paths are not supported |
kind | yes | description, attributes or translation |
locale | for translation | The target language, in words |
instructions | no | Extra wording appended for this target only |
maxLength | no | Applied to the result, not requested from the model |
A value that cannot be used is replaced by its default rather than applied: a negative maxLength becomes no limit, a maxOutputTokens of 0 becomes 2048, and 4096.9 becomes 4096. A target with an unknown kind, or a translation with no locale, is dropped rather than guessed at. A collection left without a usable target takes no part at all.
| Where | Field | Notes |
|---|---|---|
| each configured collection | aiStatus group | generatedAt, provider, model, fields, and a hidden indexed fingerprint |
new global ai-manager | provider, model, key, base URL, house style | Appears in the admin menu under Ecommerce |
The settings are an ordinary Payload global, which is why they appear in the menu without this package shipping a single React component.
The global carries two key fields, and the order matters.
API key environment variable holds the name of an environment variable. It is read at request time and never stored. This is the recommended field.
API key is the fallback, used only when the variable is empty or unset. It is written to your database in clear text, and its read access is closed, so neither REST nor GraphQL ever returns it. It exists because a shop owner without deploy access still needs a way in.
The House style field is appended to every prompt. Use it to say how the shop speaks, what to avoid, and which claims are not permitted.
POST /api/ai-manager/generate
{ "collection": "products", "id": 42, "force": false }
Requires an authenticated user, and reads the document with the caller's own access rights. force: true ignores the fingerprint.
| Response | Meaning |
|---|---|
{"status":"generated","fields":[...]} | Written. fields lists what changed |
{"status":"skipped","reason":"..."} | Nothing sent. Reason is disabled, not-configured, no-source or unchanged |
{"status":"failed","reason":"..."} | The provider or its answer failed. HTTP 502, prefixed with a code such as AUTH or RATE_LIMIT |
No successful generation from a real vendor has been observed. Every provider has been reached at its real endpoint and has accepted the shape of the request, but only with an invalid key. The successful path was exercised against a local recording server. Treat your first run with a real key as the real test.
Simultaneous requests for the same document each cost a call. Every Payload request runs in its own transaction, so requests fired at the same instant cannot see each other's uncommitted fingerprint: measured, five simultaneous calls produced five provider requests instead of one. Sequential requests deduplicate correctly, and that is the path a save or a button click takes. If you drive the endpoint from a script, serialise it.
A model can still be wrong. The prompt forbids inventing specifications and asks for an empty field rather than filler when the source is too thin. It cannot forbid a plausible sentence that happens to be false. Copy for a regulated product should be read before it is published.
Automatic mode costs money on every source change. It is off by default and stays off until you enable it per collection. The fingerprint prevents repeat work, not first work.
With auto enabled, a save waits for the provider. For a bulk import, leave auto off and drive the endpoint yourself.
Model names go stale. Providers retire models. Set the model field explicitly if a default stops resolving.
Changing settingsSlug or statusField later is a schema change. On PostgreSQL, Payload will ask how to migrate the renamed enum and table, and a non-interactive deploy will stall waiting for that answer. Decide both names before the first deploy, or run the migration deliberately.
One field, one value. Dot paths are not supported, so a target inside a group or an array cannot be addressed. Rich text fields receive plain strings.
MIT. Copyright George Vasiliades, https://github.com/Poseidonas
payload ai plugin
AI assistant in the Payload admin with multiple providers, CMS mentions and signed action proposals
54301/wk4v3
payload agent
AI chat agent that queries and manages Payload content from Telegram, Slack, WhatsApp and other chat platforms
5774/wk17v3
payload plugin ai chat
Adds ChatGPT-style chat to Payload collections using OpenAI models
3312/wk15v1
payload plugin ai completions
Generate field content in the Payload admin with OpenAI completions using configurable per-field prompts
2812/wk8v1
payload ai
AI text, image and voice generation for Payload fields and the Lexical editor with configurable providers
833.5k/wk568v3
seo
Fork of the official Payload SEO plugin that generates meta titles and descriptions with OpenAI
48115/wk335v3