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

Gravity Forms AI Gateway Premium Add-on Setup Guide

Updated 8 min read Gravity Forms AI
On this page
  1. Video walkthrough
  2. What the AI Gateway add-on does
  3. Before you start
  4. Step 1: Install and activate your licence
  5. Step 2: Choose your provider and enter your credentials
  6. Step 3: Add a feed to a form
  7. Step 4: Submit a test entry
  8. How generation, retries and the daily cap work
  9. Merge tags
  10. Notification events
  11. Bulk actions on the entry list
  12. For developers
  13. Privacy and security
  14. Troubleshooting

Video walkthrough

Gravity Forms AI Gateway Setup Guide: AI Provider Keys, Daily Cap & Prompt Feed (WordPress Side)
Video setup guide: Gravity Forms AI Gateway Watch on YouTube

What the AI Gateway add-on does

The Gravity Forms AI Gateway Premium Add-on generates text from a form submission through your own AI account and writes the answer back onto the entry. The moment a form is submitted, the add-on builds a prompt from the form, sends it to the provider you chose, and saves the generated text to a field you pick. You keep your own account, your own models and your own bill, and nothing passes through GravityExtra.

One switch chooses the provider. Azure OpenAI covers enterprise and EU workloads through your Azure deployment. AWS Bedrock reaches the models in your own AWS account, with each request signed from your IAM credentials. Grok, Hugging Face and Together connect through their chat endpoints with a single API key. Every form can have several feeds, and each feed has its own prompt, model and target field, so one submission can be summarised, answered, tagged or routed in as many ways as you need.

The add-on is built the same way as the rest of the GravityExtra range: the visitor never waits, the work runs in the background, the credentials are stored encrypted, and the result is recorded on the entry with a clear note.

Before you start

You need Gravity Forms 2.5 or newer, a GravityExtra licence key for this add-on, and an account with one of the five providers. For Azure OpenAI you need the resource name, an API version and a deployed model (the deployment name). For AWS Bedrock you need an IAM access key with permission to call Bedrock, the region your models run in, and the model id. For Grok, Hugging Face or Together you need an API key and a model name. You never share these with GravityExtra; they stay on your site, encrypted, and are only ever sent to the provider you picked.

Step 1: Install and activate your licence

Upload and activate the plugin like any other, then open Forms → Settings → AI Gateway and paste your licence key in the Gravity Extra License box. Activating the licence unlocks the settings and the feeds. The licence only controls updates and support; it does not sit between your site and your AI provider.

Step 2: Choose your provider and enter your credentials

On the same settings page, pick your provider from the Provider switch. The fields below it change to match:

  • Azure OpenAI – enter the Azure resource name (from your endpoint https://<resource>.openai.azure.com), the Azure API version, and your API key. The default model is the name of your deployment.
  • AWS Bedrock – enter the AWS region, the access key ID and the secret access key (and a session token only if you use temporary credentials). The default model is a Bedrock model id such as a Claude or Llama model in your account.
  • Grok, Hugging Face or Together – enter the API key for that provider. The default model is the model name you want to use.

Set the Default model, and, if you like, a Default max tokens and Default temperature. The Daily cap of generations stops the add-on for the rest of the day (UTC) once it has produced that many answers across all feeds, which keeps your spend predictable. Save the page.

The credentials are encrypted before they are stored, using your site keys, so a copied database alone cannot read them. The boxes never show a stored key again: leave them empty to keep what is saved, or type a new value to replace it. The Remove the stored credentials when saving checkbox clears them.

Press Check the connection. The add-on asks your provider to list the models of your account with the saved credentials. It generates nothing and spends no tokens; it just confirms that the credentials reach the provider. Save first if you changed anything.

https://gravityextra.com/wp-content/uploads/2026/10/gfaig-settings-scaled.png

Step 3: Add a feed to a form

Open a form, go to Settings → AI Gateway and add a feed. A feed has:

  • Feed name – a label for your own reference.
  • Provider – leave it on Use the account provider, or pick a different one for this feed (its credentials are the account credentials you saved).
  • Model – leave empty to use the default model, or set a different model or Azure deployment for this feed.
  • System prompt – optional instructions that set the role and style, for example “You are a support agent. Reply in two short sentences.” Merge tags work here.
  • Prompt – the prompt sent to the model, with merge tags that insert the visitor’s answers, for example “Summarise this message: {Message:4}”.
  • Max tokens and Temperature – optional per-feed overrides of the defaults.
  • Write the answer to – the field that receives the generated text. A hidden, single line or paragraph field works well. The answer is also available as the merge tag {aigateway_answer}.
  • Condition – turn this on to generate only for entries that match, for example only when the topic is “Support”.

Save the feed. You can add as many feeds as you like: one to summarise the message into a hidden field for your team, another to draft a reply, another to classify the enquiry into a category field for routing.

https://gravityextra.com/wp-content/uploads/2026/10/gfaig-editor.png

Step 4: Submit a test entry

Submit the form. The visitor sees the normal confirmation at once; the generation runs in the background a moment later. Open the entry and you will see the AI Gateway box with the status, the provider and the generated answer, and the answer written into the field you chose. The entry also gets a note recording what happened.

https://gravityextra.com/wp-content/uploads/2026/10/gfaig-entry-scaled.png

How generation, retries and the daily cap work

When an entry is saved, each feed whose condition matches is queued and a background job does the work, so the form never waits for the model and an error never reaches the visitor. For AWS Bedrock the request is signed with AWS Signature Version 4 from your IAM access key and sent to the Bedrock runtime in your region. For Azure OpenAI it goes to your deployment with your API key. For Grok, Hugging Face and Together it uses their chat completion endpoints with your key.

If the provider cannot be reached, or answers with a rate limit or a server error, the add-on waits and tries again with a growing back-off, honouring a Retry-After header when the provider sends one. A wrong key, an unknown model or an invalid request is reported as a clear failure rather than retried. Each answer counts towards the daily cap; once the cap is reached the add-on stops generating until the next UTC day, and the entry note explains why. You can always generate later from the entry list.

Merge tags

The add-on adds four merge tags you can use in notifications, confirmations and other feeds:

  • {aigateway_answer} – the generated text.
  • {aigateway_status} – the status of the generation (done, retrying or fail).
  • {aigateway_provider} – the provider that produced the answer.
  • {aigateway_model} – the model that produced the answer.

Each tag can target a specific feed by adding the feed id, for example {aigateway_answer_3}, which is useful when a form has more than one feed.

Notification events

On a form that has a feed, the add-on offers two notification events in the Gravity Forms notification settings:

  • AI Gateway: the answer was generated – sent when a feed produces an answer.
  • AI Gateway: the answer could not be generated – sent when a feed fails.

You can use these to email a draft reply to your team, or to alert someone when generation fails so nothing is missed.

Bulk actions on the entry list

The entry list has two bulk actions when a form has an active feed: Generate AI answer (skip done) runs the feeds for the selected entries that have not been generated yet, and Generate AI answer again (regenerates) produces a fresh answer for the selected entries. These are handy for back-filling older entries or for trying a new prompt on a sample.

For developers

A filter lets you change the prompt before it is sent, or cancel generation for an entry. Return the array to change it, or a non-array to cancel:

add_filter( 'gform_aigateway_request', function ( $args, $feed, $entry, $form ) {
    // $args has: system, prompt, model, max_tokens, temperature.
    $args['system'] .= ' Always answer in British English.';
    return $args;
}, 10, 4 );

Two actions fire with the result. gfaig_generation_done runs when an answer is generated (with the state, entry, feed and form), and gfaig_generation_failed runs when it fails (with the entry, feed, form and the reason). Use them to log results or trigger your own workflow.

Privacy and security

When a feed is active, the prompt built from the form (which may include answers the visitor typed) is sent to the provider you chose to generate text, which is written back onto the entry. The provider processes the data under its own terms, so review their terms and your own privacy policy, and keep prompts free of data you do not want to send. The credentials are stored encrypted and are only ever sent to the chosen provider’s own host, which is checked on every request. The add-on adds a short note to the WordPress privacy policy guide to help you describe this to your visitors.

Troubleshooting

Check the connection fails. Re-check the credentials and, for Azure, the resource name and API version; for AWS Bedrock, the region, access key ID and secret. Some keys are allowed to generate but not to list models, in which case the check reports that the credentials are known and generation still works.

No answer appears. Make sure the licence is active, the feed is active, its condition matches, and a field is chosen in Write the answer to. The entry note explains any failure, including a wrong key, an unknown model or the daily cap.

Generation is delayed. Background jobs run on WordPress cron, which fires on site traffic. On a quiet site a real cron job makes generation more prompt.

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