Skip to main content

Set up the AI assistant

About five minutes, once per site. At the end of it you can type "make a registration form for the spaghetti evening on 12 September" into your admin and get a draft form back.

The assistant needs an AI provider connected to WordPress, with your own API key. LocalForm holds no key of its own and charges nothing for the feature - it asks whatever your site is connected to, and the provider bills you directly.

Before you start

Check all three, because each one hides the button rather than explaining itself:

You needHow to check
LocalForm Pro, activePlugins - see licensing if it is installed but not activated
WordPress 7.0 or newerDashboard → Updates. The AI client is part of core from 7.0
Administrator accessBuilding forms is an administrator's job, and so is this

1. Get an API key

Pick one of the three providers WordPress knows out of the box and create a key in its console:

ProviderWhere to get a key
Anthropic (Claude)console.anthropic.comAPI keys
OpenAIplatform.openai.com/api-keys
Google (Gemini)aistudio.google.com/apikey

Copy the key straight away - most consoles show it once and never again.

The account behind the key has to be able to pay. Building a form is a handful of short requests, so it costs cents rather than euros, but a key on an account with no billing set up is accepted by WordPress and then refused by the provider on the first real request.

2. Connect it in WordPress

  1. Go to Settings → Connectors. WordPress lists Anthropic, Google and OpenAI.
  2. Select Install on the one you chose. That installs and activates its provider plugin from WordPress.org.
  3. Paste your API key into the field that appears, and save.

That is the whole connection, and it is site-wide: any plugin using the WordPress AI client can now generate text, so you do this once no matter how many of them you have.

:::note Skip the "AI" plugin The Connectors screen also offers the AI plugin, which adds core's own editor features. The assistant does not need it, and its Enable AI toggle does not govern this panel. :::

Prefer the key out of the database? Define ANTHROPIC_API_KEY, OPENAI_API_KEY or GOOGLE_API_KEY in wp-config.php instead - see keeping the key out of the database.

3. Try it

Go to LocalForm → Forms. The Build with AI button sits next to Add New. Ask for something small:

Make a test form with a name and an email address.

A draft form appears within a few seconds. Look it over, then delete it.

If the button is not there at all, or the panel says no provider answered, work through if it is not working - it lists what each message usually means.

4. Decide whether to pick a model

You can stop after step 3. Left alone, the AI client picks the model, which on a provider offering several usually means its cheapest fast one - a sensible default, and a poor one if you are paying for something better.

To choose, go to LocalForm → Settings → AI Assistant and set:

  • Provider - binding. Ask for Google and only Google answers.
  • Model - a preference, written exactly as the provider spells it (claude-sonnet-4-5, gemini-2.5-pro). A model the provider no longer offers is passed over silently, so check the Answered by … line under the conversation to see what actually replied.

Whatever you pick has to support tool calling - the assistant builds forms by calling LocalForm's own abilities. Only tool-calling models are suggested in the list.

Now that it works

  • Forms → Build with AI starts a new form; the sparkle button in the builder's top bar changes the one you have open.
  • New forms arrive as drafts, so nothing reaches your visitors before you have read it.
  • Save your own edits before asking for a change - the builder reloads what was saved.
  • The assistant can list, read, create and update forms. It cannot delete a form, read a submission, or touch anything else on your site.

Ask for more than feels necessary; a request that names the questions is worth three that do not. There are examples of good and bad requests in Build with AI.