🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

Gravity Forms OpenAI (ChatGPT) Integration Add-on

Updated 8 min read Gravity Forms AI
On this page
  1. Step 1: Install and Activate Your License
  2. Step 2: Connect Your OpenAI Account
  3. Step 3: Add an OpenAI Feed
  4. Text answer (ChatGPT)
  5. Live result in the form
  6. Moderation check
  7. Generate an image
  8. Transcribe an audio file
  9. Text to speech
  10. Conditional logic
  11. Step 4: Check Results on the Entry Screen
  12. Upgrading from Version 1.x
  13. Costs, Privacy and Limits
  14. Troubleshooting
  15. Frequently Asked Questions
  16. Which OpenAI models can I use?
  17. Does it work with the GravityExtra AI Form Builder?
  18. Can I show the AI answer to the visitor after submit?
  19. Will a visitor see my prompt?

The Gravity Forms OpenAI (ChatGPT) Add-On connects your forms to the OpenAI API with your own API key. Each OpenAI feed does one job for a submitted entry: write a text answer from a prompt with merge tags, check the text with OpenAI moderation, create an image, transcribe an uploaded recording or turn text into speech. Text answers can also be shown live in the form, before the visitor submits.

This guide covers version 2.0: installation and license, the API settings, every feed type, live results, the entry screen, upgrading from 1.x, limits, costs and troubleshooting.

System Requirements & Prerequisites

  • WordPress: 6.0 or higher
  • PHP: 7.4 or higher
  • Gravity Forms: 2.5 or higher (tested with 2.9 and 3.1)
  • OpenAI: an OpenAI API account with a secret API key and billing set up (platform.openai.com)
  • GravityExtra license: an active license key for this add-on

Step 1: Install and Activate Your License

  1. Go to Plugins → Add New → Upload Plugin, upload the add-on ZIP and click Activate. Updating from 1.x: upload the new ZIP and choose Replace current with uploaded.
  2. Go to Forms → Settings → OpenAI, enter your key in the Gravity Extra License section and click Active License.
  3. The page now shows the OpenAI API and Live AI results in forms sections. Future versions appear in Dashboard → Updates.

Until the license is active, OpenAI feeds do not run. Each entry then gets a note that says so, so nothing fails silently.

Step 2: Connect Your OpenAI Account

In Forms → Settings → OpenAI:

  • Secret API Key — create it in your OpenAI dashboard under API keys. Requests are billed to your OpenAI account.
  • Organization ID (optional) — only when your key belongs to several organizations.
  • Default text model — used by text feeds that do not choose their own model, for example gpt-4o-mini or gpt-4.1-mini. Type any model ID your account can use.
  • Request timeout — how long to wait for OpenAI, 5 to 600 seconds (default 60). Image generation can take up to a minute.
  • Check saved API key — save first, then click it; it asks OpenAI for your model list and shows whether the key works.
  • Requests per visitor per minute and Requests per form per day — limits for live results (defaults 5 and 200).

Step 3: Add an OpenAI Feed

Open a form, go to Settings → OpenAI and click Add New. Give the feed a name and choose What should this feed do? The screen then shows only the settings of that feed type. A form can have several feeds, for example a moderation check and a text answer.

OpenAI feed settings with the Responses API, model, instructions, prompt with merge tags, answer field and live result options
A text answer feed with instructions, a prompt with merge tags, the answer field and the live result options.

Text answer (ChatGPT)

  • OpenAI API — Responses API (recommended) or Chat Completions API.
  • Model — leave empty for the default text model.
  • Instructions (system) — how the AI should answer: tone, language, length. Merge tags work here.
  • Prompt — what to ask, with the visitor’s answers as merge tags, for example Write a short reply to: {Message:3}.
  • Save the answer to — the field that receives the answer (a Paragraph Text field is best). Leave it empty to keep the answer in an entry note only.
  • Entry note — also store the answer as a note.
  • Max output tokens and Temperature — optional. Some reasoning models do not accept a temperature; leave it empty for them.

The answer is saved before Gravity Forms sends notifications, so you can use the field in emails and confirmations.

Live result in the form

Tick Show the AI answer in the form before submit to fill the answer field while the visitor is still on the page. Choose how it starts:

  • With a button below the answer field — the visitor clicks it (set your own Button text).
  • Automatically — when the visitor leaves a field that is used in the prompt and all those fields have a value. The same answers are not sent twice.
  • Keep the live answer — on submit, a field that already holds the live answer is kept, so OpenAI is not asked a second time. Untick it to ask again on submit.
Customer care form with a suggested reply filled in by the Draft a reply with AI button before the visitor submits
The visitor clicked Draft a reply with AI; the answer is in the field and can still be edited.

How live results are protected

  • The prompt and instructions stay on your server; the page only knows the feed and field numbers.
  • Each request needs a valid security token for that form; feeds without a live result cannot be called.
  • Values longer than 5,000 characters are refused.
  • Limits per visitor per minute and per form per day stop abuse; the visitor then sees “Too many requests”.
  • Error details from OpenAI are written to the Gravity Forms log, never shown to visitors.

If your site uses full-page caching, exclude the form page from the cache or keep the cache shorter than 12 hours, so the security token on the page stays valid.

Moderation check

  • Text to check — merge tags of the fields to check, for example {Your post:2}.
  • Model — empty uses omni-moderation-latest.
  • Block the submission and show a message — the check runs before the entry is saved. If OpenAI flags the text, the visitor sees your message below the field and can change the text. Set Show the message below to choose the field.
  • Accept it and flag the entry — the entry is saved and gets a note with the flagged categories; choose Entry note only, Spam or Starred.

If OpenAI cannot be reached during a block check, the entry is accepted and an error note says that the check did not run, so you never lose a real submission.

Generate an image

  • Image prompt with merge tags, Model (default gpt-image-1; dall-e-3 also works), Size and Quality.
  • Save the image to — a File Upload field. The PNG is stored in the Gravity Forms uploads folder of the form and its link is added to the entry notes.

Transcribe an audio file

  • Audio file field — a File Upload field with the recording: mp3, mp4, m4a, wav, webm, ogg or flac, up to 25 MB (the OpenAI limit). Allow these extensions in the field settings.
  • Model (default gpt-4o-mini-transcribe; whisper-1 also works) and an optional Language code such as en.
  • Save the text to a field and/or an entry note. No recording uploaded = nothing happens.

Text to speech

  • Text to read with merge tags, up to 4,096 characters (longer text is cut and the note says so).
  • Model (default gpt-4o-mini-tts), Voice, File format and optional Voice instructions such as “Warm and calm” (not used by tts-1).
  • Save the audio file to a File Upload field, or a text or website field that receives the link.

Conditional logic

Every feed has Enable condition: run the feed only when, for example, a drop-down has a certain value. Live results respect the condition too.

Step 4: Check Results on the Entry Screen

Open the entry in Forms → Entries. Results are in their fields, and every feed writes a note: what was saved, which model answered, or why it failed. The OpenAI box on the right lists the feeds of the form with a Run again button, for example after you edited an answer or after a failed request. Run again does not check the feed condition and does not keep the live answer.

Gravity Forms entry with the AI reply, the OpenAI notes and the OpenAI box with the Run again button
Entry with the AI reply, the notes of the feed and the OpenAI box with Run again.

Upgrading from Version 1.x

  • Upload the 2.0 ZIP with Replace current with uploaded. Your API key, model setting and feeds are kept as they are.
  • Feeds made with 1.x keep running exactly as before: Chat Completions, the prompt sent as the user message, the answer saved to the same field and the note “Successfully executed prompt.”.
  • Activate your GravityExtra license after the update; until then feeds do not run and each entry gets a note.
  • When you open and save a 1.x feed in 2.0 it becomes a Text answer feed that uses the Responses API by default; switch OpenAI API to Chat Completions to keep the old request.

Costs, Privacy and Limits

  • OpenAI bills your account per request; images and long answers cost more than short text. Live results with an automatic start send one request each time the prompt fields change, within your limits.
  • Only the text you put in the prompt (or the uploaded audio file) is sent to OpenAI. Tell your visitors in your privacy policy that answers are processed by OpenAI.
  • Feeds run when the form is submitted, so very slow answers make the submission wait. Keep the timeout reasonable and the prompt short.
  • Streaming answers word by word is not included; the live result appears in one piece when it is ready.

Troubleshooting

Entry note or message What to do
not run, the GravityExtra license is not active Activate the license in Forms → Settings → OpenAI.
No OpenAI API key is saved Paste the key in the settings and click Save.
Request failed (HTTP 401 …): Incorrect API key provided Create a new key in your OpenAI dashboard and save it; click Check saved API key.
HTTP 404 … model does not exist or you do not have access Use a model ID your account can use, or leave the feed model empty for the default.
HTTP 429 … quota Add credit or raise the limits in your OpenAI billing settings.
The prompt is empty after the merge tags were filled in The fields used in the prompt were empty; add a condition or make them required.
Visitor sees Too many requests Raise the live limits in the settings, or switch the live result to a button.
Visitor sees This page has expired The page came from a cache older than the security token; exclude the form page from the cache.
cannot be transcribed Allow mp3, m4a, wav, webm, ogg or flac in the File Upload field; other file types are refused.

Frequently Asked Questions

Which OpenAI models can I use?

Any model ID your OpenAI account can use for that endpoint. Type it in the feed or as the default text model; the add-on does not limit the list.

Does it work with the GravityExtra AI Form Builder?

Yes. The AI Form Builder can reuse the API key saved in this add-on, and the key setting is unchanged in 2.0.

Can I show the AI answer to the visitor after submit?

Yes. Save the answer to a field and use its merge tag in the confirmation message or in a notification.

Will a visitor see my prompt?

No. Prompts and instructions are read on the server only. The page only knows which feed and field to fill.

Still need help?

Our support team answers tickets every day, usually within a few hours.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr