AI Settings

jekcms uses AI in several places — image alt-text generation, content assist in the post editor, bulk generation workflows, and more. The AI panel (admin/ai-settings.php) is where you plug in your API keys, pick models per feature, watch spend, and gate features by license tier.

Provider API keys

The top section holds your credentials:

  • OpenAI API keysk-... format. Used for GPT-4o, GPT-4o-mini, and o3-mini
  • Gemini API keyAI... format. Used for Gemini 1.5 Pro and Flash
  • Test button next to each — runs a one-token ping so you know the key works before saving

Keys are stored encrypted in config/secrets.php (AES-256 with the install's APP_KEY). They never appear in plaintext in logs or exports. To rotate, paste the new key and save — the old one is overwritten, no archive kept.

You can leave Gemini blank if you only use OpenAI, or vice versa. Features configured to use an unconfigured provider fall back to the provider with a valid key (with a warning in the admin banner).

Model selection per feature

Each AI-powered feature picks its own model. This is deliberate — alt-text doesn't need GPT-4o's firepower, but long-form drafting benefits from it. Defaults are tuned for cost:

| Feature | Default | Alternatives | |---------|---------|--------------| | Image alt-text | gpt-4o-mini | gpt-4o, gemini-1.5-flash | | Content assist (editor) | gpt-4o-mini | gpt-4o, o3-mini, gemini-1.5-pro | | Bulk generation | gpt-4o | o3-mini, gemini-1.5-pro | | Summarization | gpt-4o-mini | gemini-1.5-flash | | Translation | gpt-4o-mini | gemini-1.5-pro | | Moderation (comments) | gpt-4o-mini | gemini-1.5-flash |

Change a dropdown and hit Save — the new model is used on the very next call, no restart needed.

Usage meter

The middle section of the panel shows the current period at a glance:

  • Tokens consumed — input + output, split by provider
  • Estimated cost — computed from the published pricing for each model, updated daily from the provider's pricing page
  • Calls — total API calls, with a per-feature breakdown
  • Alert threshold — you set a dollar ceiling; when estimated cost crosses it, the panel shows a red banner and emails the admin

The meter resets on the first of each month by default. You can also set a rolling 30-day window instead if your billing cycle doesn't match calendar months.

Click any row for a drill-down chart of daily spend across the last 30 days — useful for catching runaway workflows.

Feature toggles

Each feature has an on/off switch. Turning one off is immediate — subsequent calls are rejected with a clear error in the UI, and no API call is made, so cost stops dead.

  • Image alt-text auto-gen — When enabled, uploading a new image through the media library auto-generates an alt-text suggestion. Editable before save.
  • Content assist — Enables the AI sidebar in the post editor (outline, rewrite, expand, summarize)
  • Bulk generation — Exposes the bulk-draft tool (see [Bulk Generation](/docs/automation/bulk-generation))
  • Comment moderation — Classifies new comments as spam / ok / review-needed
  • Translation — Adds translation buttons to posts for supported locales

Safety parameters

Under Advanced, you can tune the generation parameters per feature:

  • Temperature (0.0 – 2.0) — Low = deterministic, high = creative. Defaults: 0.2 for alt-text, 0.7 for content, 0.5 for summaries
  • Max tokens — Output ceiling. Defaults: 60 for alt-text, 2000 for content assist, 4000 for bulk gen
  • Stop sequences — Up to four strings that terminate generation. Useful for forcing structured output

Leave these alone unless you have a reason — the defaults are tested. Set max tokens too low and replies truncate mid-sentence; too high and cost balloons.

Call logs

Every AI call writes to storage/logs/ai.log with timestamp, feature, model, token counts, latency, and status. The admin viewer at AI → Logs surfaces the last 1,000 entries with filters by feature and status (success / error / rate_limited).

Use the log to:

  • Debug "why did this take 30 seconds" — latency is recorded per call
  • Find the request that triggered a cost spike — sort by token count descending
  • Spot rate limit patterns before they become user-visible issues

Logs rotate weekly, keeping four weeks on disk.

Rate limit tuning

AI providers throttle per-minute and per-day. jekcms queues calls that would exceed the configured ceiling rather than failing them outright.

  • Requests per minute — Default 60, raise if your OpenAI tier allows more
  • Tokens per minute — Default 150,000 (GPT-4o tier 1)
  • Concurrent calls — Default 4, raise for higher throughput on bulk operations

Hit a 429 from the provider? jekcms backs off automatically with exponential retry, logs the event, and surfaces a warning if sustained. Lower your configured ceilings so the queue smooths out the bursts.

Feature access by license tier

AI features are gated by tier:

  • DEV / PERai_basic: alt-text, content assist (limited to gpt-4o-mini and gemini-flash), comment moderation
  • STD — Same as PER plus translation
  • PRO / AGC / ENTai_pro: everything, all models, bulk generation, custom prompt templates, no internal rate caps

If a feature is disabled because of tier, the toggle is greyed out with an Upgrade link rather than hidden — so you know what you'd unlock.

Be the first to know

New features, release notes & CMS guides — a couple of emails a month, no spam.