Skip to content
Available for new work
Pages in Blog

GuidePremium

AI keys and AI settings in CoullWorks Blog for Laravel

The AI keys and AI tabs of Settings, field by field: provider keys, the monthly spend cap, retention, models, disclosure line, voice notes, price table, answer sizes and the bulk queue.

Updated 16 November 2026Back to the package pageBuy

Two tabs of the Settings screen belong to the optional AI module: AI keys, where you store one key per provider, and AI, where you set limits, models and the bulk queue. They appear only when the module is on (coullworks-blog.ai.enabled) and the user has the ability blog.ai.keys. For how the screen works as a whole (saving, refused values, the blog switcher) read Settings. To use the writer once the keys are in, read AI Writer.

AI keys#

The AI keys tab with an Anthropic key set (ends in -key), and the OpenAI and Gemini keys not set

Three blocks, one per provider. Notice the line under each field: "A key is set (ends -key)" or "No key is set". The field itself is always empty.

Each block has the same four parts: a key field, a status line, a checkbox to remove the key, and a check button.

  1. Open Tools, Settings, AI keys.
  2. Paste the key into the block of the provider you want to use. The field hides what you paste, and has the placeholder Paste a key to set or replace it.
  3. Press Save settings. The key is stored encrypted for this blog. From then on the status line says A key is set (ends xxxx), showing only the last four characters.
  4. Press Check the Anthropic key (or the OpenAI or Gemini button). The package asks the provider to list its models with that key and shows a notification: Anthropic accepts the key. or Anthropic did not accept the key, or none is set.

The AI keys tab after pressing Check the Anthropic key, with the notification "Anthropic accepts the key."

The notification appears at the top right. It tells you the provider accepted the key; it does not say how much credit the account has left.

Anthropic key, OpenAI key and Gemini key#

  • Where: AI keys tab, one block per provider, in that order.
  • Values: the secret key from the provider's own dashboard. Default: none. Scope: the active blog: each blog keeps its own keys. Environment variable: none. The keys are stored by the package in its own encrypted table, not in .env.
  • What it changes: which providers the writer, the refresh tool and the queue can call. Anthropic and OpenAI can research the web and write. OpenAI and Gemini can make images. Gemini makes images only, so it has no text models.
  • The field is write only. Nothing the screen loads ever holds a key: the field stays empty, and only the last four characters are ever shown, in the status line. To replace a key, paste a new one and save.
  • Change it when: you are setting the module up, a key was rotated, or you want a blog to use a different account.

Remove the Anthropic key, the OpenAI key, the Gemini key#

  • Where: a checkbox under each key field.
  • Values: ticked or not. Default: not ticked.
  • What it changes: on save, the stored key of that provider is deleted. The status line then reads No key is set. A removal wins over a key typed in the same block.

Check the Anthropic key, the OpenAI key, the Gemini key#

  • Where: a grey button under each checkbox.
  • What it does: calls the provider with the stored key and reports whether it was accepted. It checks the key already saved, so save a newly pasted key first.
  • Notifications: Anthropic accepts the key. in green, or Anthropic did not accept the key, or none is set. in red.

If you start a run without a key, the writer does not fail silently: it shows a red notification, No API key for Anthropic, with the button Open Settings, AI keys. See AI Writer.

The AI tab#

The AI tab: monthly spend cap, retention, call limit, default models and the disclosure line, then the Writing, Largest answer per step, Model lists and Bulk queue sections

One long tab. Notice the grey numbers in the Largest answer per step and Model lists fields: they are the configuration's values, shown as placeholders, and an empty field uses them.

The top of the tab holds seven loose fields. Below them are four sections. Every value is checked before any is saved, and an empty optional value means "use the configuration". All fields are per blog and have no environment variable.

Monthly spend cap#

  • Where: first field.
  • Values: an amount in the configured currency (coullworks-blog.ai.currency, USD by default) with up to two decimals, for example 50 or 12.50. Default: empty, meaning no cap. Setting key: ai.monthly_cap.
  • What it changes: a step that would take the month's estimated spend past the cap is refused before any call to the provider. The queue stops starting items and says so on its own screen. Estimates come from the price table below, so they are estimates, not invoices.
  • Change it when: you want a hard stop on spend. A value that is not an amount is refused.

The AI tab with "abc" typed in the Monthly spend cap field and the red message "The monthly AI spend cap must be an amount in USD such as 50 or 49.99: digits with up to two decimal places, no currency symbol, no text. Leave it empty for no cap." under it

A refused value. The field turns red and the message names the format. The hint above it reads "In USD, estimated. Leave empty for no cap. A step that would pass it is refused before the call." Nothing is saved.

Keep stored AI output for (days)#

  • Values: 1 to 3650. Default: 365. Setting key: ai.retention_days.
  • What it changes: the scheduled prune (cwb:ai-prune) deletes stored AI output older than this. Runs, sources, claims and usage stay.

Provider calls per hour#

  • Values: 1 to 10000. Default: 20. Setting key: ai.rate_limit.
  • What it changes: the most provider calls this blog may make in an hour. Past it the next call is refused until the hour rolls over.

Default Anthropic model and Default OpenAI model#

  • Values: a model id chosen from the model list of that provider. Default: empty, which falls back to the configuration's default model for the provider (claude-opus-5-5 for Anthropic and gpt-6.1-sol for OpenAI on a fresh install). Setting keys: ai.default_model.anthropic and ai.default_model.openai, at most 128 characters.
  • What it changes: the model preselected on the brief screen and the refresh screen. The chosen default stays on offer even when the model list no longer names it.

Show the AI disclosure line on AI-assisted articles#

  • Values: On or Off. Default: On. Setting key: ai.disclosure_enabled.
  • What it changes: on a post that was written or refreshed with AI, the public page shows the disclosure line below. A post can override this in its editor under More (Default, Show or Hide).

Disclosure line#

  • Values: a sentence, at most 500 characters; tags are stripped on save. Default: "This article was written with the help of AI and reviewed by an editor." Setting key: ai.disclosure_line.
  • What it changes: the wording of the disclosure. An empty line falls back to the default.

Voice notes#

  • Where: Writing section.
  • Values: free text up to 4000 characters. A counter under the field reads "N of 4000 characters". Default: empty. Setting key: ai.voice_notes.
  • What it changes: added to the writing and refresh prompts after the writing rules. It is not sent with the research or the outline.
  • Change it when: the writer should follow your house style, for example "Plain British English, no exclamation marks."

Price table#

  • Where: Writing section, with a Use defaults link above the field.
  • Values: a JSON object of model ids to prices per million tokens (in, out) or per image (image), for example {"claude-sonnet-5-5":{"in":3,"out":15}}. Prices must be numbers that are not negative. Default: empty, which uses the built-in table. Setting key: ai.pricing.
  • What it changes: it replaces the built-in price of the models it names, and so changes the estimated cost on Past runs and the spend against the cap. Use defaults clears the field.
  • Refused when: the text is not a JSON object, or a row is not an object with in, out or image.

Largest answer per step: Research, Outline, Article, Refresh#

  • Where: Largest answer per step section, four number fields.
  • Values: 1000 to 200000 (tokens). Default: empty. The placeholder shows what applies then: 16000 for Research, 8000 for Outline, 32000 for Article and 16000 for Refresh. Setting keys: ai.max_tokens.research, ai.max_tokens.outline, ai.max_tokens.article and ai.max_tokens.refresh.
  • What it changes: the longest answer the provider may give for that step. A lower number is cheaper and may cut a long article short; a higher number allows longer output. Leaving a field empty removes the stored value, so the configuration applies.

Model lists: Anthropic text models, OpenAI text models, OpenAI image models, Gemini image models#

  • Where: Model lists section, four text fields.
  • Values: model ids separated by commas, each 1 to 128 characters. Default: empty, which uses the built-in list shown as the placeholder. Setting keys: ai.models.anthropic, ai.models.openai, ai.image_models.openai and ai.image_models.gemini.
  • What it changes: the models offered on the brief screen. Add a new model id here the day a provider releases it, without waiting for a package update.

Start queued items#

  • Where: Bulk queue section, a toggle.
  • Values: On or Off. Default: On. Setting key: ai.bulk.enabled.
  • What it changes: when off, the queue starts no items for this blog. Queued items wait.

Include images#

  • Values: On or Off. Default: Off. Setting key: ai.bulk.images.
  • What it changes: queue items also make images, which costs more.

Provider for bulk writing#

  • Values: Anthropic or OpenAI. Default: Anthropic. Setting key: ai.bulk.provider.
  • What it changes: the provider every queued item uses.

Items at once#

  • Values: 1 to 10. Default: 1. Setting key: ai.bulk.concurrency.
  • What it changes: how many queue items start at once for this blog.

Attempts per item#

  • Values: 1 to 10. Default: 3. Setting key: ai.bulk.max_attempts.
  • What it changes: a failed item is queued again 15 minutes later until it has been tried this many times, then it stays failed with its error.

What the module does around these settings#

The Past runs table, which records every run with its provider, tokens and estimated cost

Runs are kept for the retention period. The Estimated cost column is where the price table and the spend cap show their effect.

These behaviours are fixed by the package, not set on a screen, and they are why the settings above exist.

  • Spend guard. The monthly cap and the hourly call limit are checked before each provider call. A reservation priced from the largest answer is written first, so two calls at once cannot jump the cap.
  • Credential store. Provider keys are encrypted per blog. Only the last four characters are shown, the field is write only, and the check button calls the provider's model list.
  • Claims and sources. Research stores its sources and claims. Pinned sources are kept, dropped sources are excluded, and the sources that were used add citations to the post's structured data.
  • Writer block types. The writer is limited to heading, text, callout and table blocks (configuration ai.writer_block_types). Takeaways, FAQ, images and sources are added by code.
  • Retention. The prune deletes stored output older than the retention period. Runs, sources, claims and usage stay.
  • Disclosure. The disclosure line is shown on AI-assisted articles, with a per-article override.
  • Drafts only. The writer and the queue create drafts. Nothing is ever published by AI.
  • Prompts. The writing prompts are versioned files shipped with the package: research-v1, writer-v1, refresh-v1, image-v1, followed by the writing rules in humanizer-v2. Each run records the names it used. Developers can add instructions with the AiPromptBuilding event; the files themselves cannot be replaced from the admin.

Available for new work

UK based · PHP · Python · JS · TS. Every first call is free.