Connect AI and give it a spending cap
The store works without AI. What AI adds is what needs writing or reasoning: drafting product copy, understanding what a customer asks in plain language, answering in chat, summarising reviews.
The key is yours and so is the bill. The system ships with the brakes on, but you pay for the calls.
1. Choose a provider and set its key
Section titled “1. Choose a provider and set its key”In the backend .env, only the one for the provider you are going to use:
ANTHROPIC_API_KEY=sk-ant-...# or OPENAI_API_KEY, GOOGLE_API_KEY, MISTRAL_API_KEY, OPENROUTER_API_KEYRestart the backend. The key never leaves the server: it is not stored in the database and does not travel to the browser.
| Provider | Key | Notes |
|---|---|---|
| Anthropic | ANTHROPIC_API_KEY |
Has no embedding model |
| OpenAI | OPENAI_API_KEY |
Works for chat and for meaning-based search |
GOOGLE_API_KEY |
||
| Mistral | MISTRAL_API_KEY |
|
| OpenRouter | OPENROUTER_API_KEY |
Access to models from several providers with one key |
| Ollama | none | On your own machine. No cost, and no data leaves |
For meaning-based search you need embeddings, and not every provider has them: OpenAI, Google, Mistral, OpenRouter, Voyage AI and Cohere do; Anthropic does not. You can use one for chat and another for embeddings.
2. Choose it in the panel
Section titled “2. Choose it in the panel”Panel → AI. You will see which keys the server found, and you can choose a
provider and model for each job. It is stored in the store, not the .env, so
changing it does not require a restart.
Press Test connection: it makes a real call to the provider and tells you how much that call cost. If it fails, the message comes from the provider, not made up.
3. Set the spending cap
Section titled “3. Set the spending cap”The default is €5 a day, resetting each day.
That cap matters more than it looks. Search and chat are public: anyone who visits your site uses them, and each use calls a paid provider. A normal limiter counts requests, not money — and someone who wants to hurt you stays under the request limit using the most expensive calls.
There are two separate brakes here:
- Per visitor: how many times per minute each one can call.
- Per daily spend: how many euros the store has run up, wherever it comes from.
The second is the one that really protects, because it measures the thing you want to protect.
Hitting the cap breaks nothing: search keeps working on keywords, and chat asks for an email so a person can answer.
4. Check what you are spending
Section titled “4. Check what you are spending”Panel → AI → Usage. Calls, cost and failures over the last 30 days, broken down by task. The costs are real, worked out from the model’s rate, not eyeballed.
If you set no key at all
Section titled “If you set no key at all”The store works just the same:
- Keyword and fuzzy search (it rescues typos and “600W” against “600 W”)
- Product pages, reviews, panel alerts
- Chat answers that it cannot right now, and asks for an email
What turns off is what requires a model: writing, summarising, understanding natural language, and the panel copilot.