Setting Up AI

Setting Up AI

This guide walks you through enabling and configuring AI features in ElmapiCMS.

1. Add Your API Key

Open your .env file and add the API key for your preferred provider:

# OpenAI
OPENAI_API_KEY=sk-...
 
# Anthropic
ANTHROPIC_API_KEY=sk-ant-...
 
# Google Gemini
GEMINI_API_KEY=AI...

You only need one provider configured, but you can add multiple and switch between them in the settings.

2. Open AI Settings

Navigate to App Settings > AI from the left sidebar. This page is only accessible to administrators.

3. Enable AI Features

Toggle the AI Features switch to enable AI across the application. When disabled, the AI chat panel, inline content tools, and AI translation buttons will be hidden.

4. Select a Provider

Choose your AI provider from the dropdown. Each provider shows a status badge:

  • Configured (green): The API key is present in your .env file
  • No API key (amber): The API key is missing. Add it to .env and restart your app

5. Configure Settings

Model Override

Leave this field empty to use the provider's default model. If you want to use a specific model, enter its name (e.g., gpt-4o, claude-haiku-4-20250414, gemini-2.0-flash-lite).

The AI Assistant requires a model with tool calling support. Most modern models support this, but some smaller or older models may not. The inline content tools work with any text generation model.

Show Token Usage

When enabled, a small token counter appears at the bottom of the AI chat panel showing prompt and completion tokens used in the current conversation.

Max Output Tokens

Controls the maximum length of AI responses. The default of 4096 works well for most tasks.

ValueUse Case
1024Short responses
4096Normal (default)
8192Longer content
16384Very long content generation

Max Steps

Limits how many tool-calling rounds the AI assistant can perform per response. Each step allows the AI to call one tool and process the result. The default of 8 is enough for most tasks like creating a project with collections.

Lower values prevent the AI from running too many operations in a single response. Higher values allow more complex multi-step operations.

Conversation Memory

Sets how many previous messages the AI keeps in context when responding. The default of 10 (about 5 back-and-forth exchanges) balances context quality with token cost.

Older messages are still visible in the chat history. They just are not sent to the AI provider, so they do not affect the response.

6. Save

Click Save Changes to apply your settings. AI features will be available immediately.

Search documentation

Find guides and reference pages