The builder includes an optional AI Studio that creates whole pages and edits existing pages from a plain language prompt. It knows the 3B Portals platform: merge tags, conditional display, the standard components and their configuration, the design system and your org schema. It is enabled only when an AI API key is configured.
Set these fields on the Portal custom setting (Setup, Custom Settings, Portal):
| Field | Value |
|---|---|
AI_Provider__c |
openai or claude |
AI_Model__c |
The model id, for example gpt-5.5 or claude-sonnet-5 |
AI_API_Key__c |
Your OpenAI or Anthropic API key |
AI_Endpoint__c |
The 3B AI service endpoint, default https://ai.3bapi.com/ai |
All AI calls go through the 3B AI service, the same managed service used by 3B Forms Documents AI. The service calls your selected provider with your key and streams the answer back. Restrict builder access to admins, because the builder works with your key.
The call is made from the browser, so the endpoint host must be a Trusted URL (CSP). The package ships one for https://ai.3bapi.com. If you point AI_Endpoint__c at another host, add a Trusted URL for it (Setup, Trusted URLs, with Connect-src enabled).
The studio uses the configured model for your chosen provider.
If no key is present the studio does not initialise.
Open the studio from the launcher in the builder side panel. The left side is a conversation, the right side is a preview of the page.
{{contactUser.*}} tags show sample values. Switch between desktop and mobile widths.component_config.json are saved together.Nothing changes on the canvas until you apply. Discard clears the pending result. When a request would replace the whole page (for example "build a client dashboard" on a page that already has content), the result is flagged before you apply it.
The studio works on the page's top level sections. It does not write code against the builder.
| Stage | What you see |
|---|---|
| Schema | The studio reads the Salesforce objects your request needs, plus the Contact and the page's context object. |
| Plan | It decides which sections to replace, insert or remove. |
| Build | It writes each affected section, with the configuration of every standard component in it. A replaced section keeps everything your request does not mention. |
| Review | It checks the result against your intent and the platform rules, and corrects sections that need it. Skipped for a single small edit. |
| Apply | When you click Apply to page, the sections and component configurations are written to the canvas. Brand colours are added to the page CSS. |
Every stage uses the same knowledge: the platform rules, your brand settings, the standard component configuration, your org's custom blocks and the described schema.
{{contactUser.Id}}, {{contactUser.FirstName}}, {{contactUser.LastName}}, {{contactUser.Email}}, {{contactUser.MobilePhone}} for the logged in contact; {{record.Field}} and relationship paths for the context record; {{recordId}}, {{sessionKey}}, {{page.*}}, {{portal.*}}; repeat sections over child relationships with sort: and filter: directives; comment wrapped markers inside tables. See Merge tags and dynamic data.component-visibility and hide-if, including guest versus member variants and empty states. See Conditional display.config-id contract, :contactUser.Id style filter placeholders, [[Field]] item templates, and the attribute driven chart, dashboard, screen flow, iframe and custom LWC blocks. See Standard components: configuration model and security.#Page Name), @login and @logout.The brand panel holds the palette, fonts, rounding, vibe, tone, design and style notes, a creativity dial and the context object of the page. Settings persist in the browser and can be exported and imported as JSON. Brand colours are emitted as design system token overrides, so the preview, the canvas and the live portal render identically.
Set the context object when the page is opened with a recordId for a specific object (for example a Job Order page). The AI then uses {{record.Field}} tags and record scoped component filters for that object. Leave it empty for pages about the logged in contact.
| Symptom | Cause and fix |
|---|---|
| "Unsupported value: 'temperature'" from OpenAI | Fixed in version 11: reasoning models no longer receive a temperature. Update the builder static resource. |
| Studio missing from the builder | No AI_API_Key__c on the Portal setting for the current user or profile. |
| Components show as placeholders in the preview | Expected. Data loads once the page is applied and viewed in the canvas or the portal. |
| The plan targets the wrong section | Select the element you mean before prompting, or name the section heading in the request. |
| A request fails immediately with a 4xx error | Check the model id and the key; the message is shown in the conversation. |
| "Invalid x-api-key header" (401) | The service could not use the key. Re-enter AI_API_Key__c and reload the builder. |
| Network error in the browser console, nothing in the thread | The AI endpoint host is missing from Trusted URLs, so the browser blocked the request. |