A Singapore Government Agency Website

AI Models

Beta Feature: This node is currently in beta. Features and functionality may be subject to changes.

The AI Models Node lets you call a Large Language Model (LLM) directly from your workflow. It connects to the GovTech AI Platform Models using an OpenAI-compatible chat completions endpoint, so you can mix in generative AI for tasks like summarisation, classification, drafting, and structured extraction without standing up your own integration.

When to use: When your workflow needs an LLM response in the middle of a flow — for example, summarising a case description before creating a record, or classifying a free-text field before routing it through a Switch Node.

AI Models Support: For any enquiries or issues related to AI Models, please contact the Platform AI team at ai_programme@tech.gov.sg.

How Does It Work?

Prerequisites:

Setup Steps:

  1. Build your workflow using Graph Edit Mode (minimum setup: input node → AI Models node → output node, but you can add more nodes as needed).
  2. Click on the AI Models node settings to open its configuration.
  3. Configure the connection settings with your Platform AI Models API key.
  4. Select a model and write your user prompt.

Output:

By default, the AI Models Node returns the raw chat completion response from Platform AI Models, including the generated message, model metadata, and token usage. Subsequent nodes can read the assistant message at {{{choices[0].message.content}}} (use the field selector after running a simulation to discover the exact path).

If you enable Structured Output, the node instead returns a clean object keyed by the fields you define — making downstream steps easier to build.

Configuration

Connection Settings

API Key

Your Platform AI Models API key, used as a Bearer token when calling the chat completions endpoint.

Tip: Store the key as an environment variable and reference it through the field selector (e.g., {{{env.PLATFORM_AI_API_KEY}}}) so it isn’t pasted directly into the node configuration.

Parameters

Model

The Platform AI model to use for the request. Choose from the dropdown.

Important: Opus is currently classified as Restricted, do not put CCE content through. To avoid possible mishaps, we do not include CCE models from Platform AI Models.

At a glance:

  • OpenAI — GPT-5 family (including gpt-5, gpt-5-mini, gpt-5-nano, gpt-5.1, gpt-5.2, gpt-5.3-codex, gpt-5.4, gpt-5.4-pro), GPT-4.1 family, GPT-4o family, and the o-series reasoning models (o3, o3-mini, o4-mini).
  • Anthropic Claude — Claude 4 family across multiple hosting backends (Azure, AWS Bedrock, GCP Vertex AI, RSN), including claude-opus-4-7, claude-sonnet-4-6, and claude-haiku-4-5.
  • Google Gemini — Gemini 2.5 family and Gemini 3.x previews.

For the full and most up-to-date list of supported models, see the Platform AI Models reference.

Tip: Different models suit different jobs — pick a smaller/faster model (e.g. gpt-5-mini, claude-haiku-4-5, gemini-2.5-flash) for high-volume classification or extraction, and reserve larger models for complex reasoning or long-context tasks.

User Prompt

The instruction or question to send to the model. Use the field selector to inject upstream data into the prompt.

Example:

Summarise the following case description in three bullet points:

{{{trigger.data.description}}}

Structured Output

By default the model returns a single block of text. Turn on the Structured Output toggle in the Parameters section to instead have the node return a clean object with the exact fields you define — so downstream nodes can reference each value directly (e.g. {{{sentiment}}}) instead of parsing free text.

Defining fields:

When you enable the toggle, a field editor appears. Click Add Field to add each output field and configure:

  • Data Label — the output key name. Must be a valid identifier (letters, digits, and underscores; must start with a letter). Sibling labels must be unique, and a label cannot begin with an underscore (_).
  • Data Type — one of Text, Number, True/False, Date, List, or Object.
  • Prompt — a short description telling the model what to put in this field.

Fields can be nested up to 3 levels deep. An Object field must contain at least one nested field. For a List field:

  • No nested field → a list of text values.
  • One nested field → a list where every item is that type.
  • Two or more nested fields → a fixed-length tuple (one entry per nested field, in order) rather than a repeating list.

Note: At least one field is required when Structured Output is enabled.

Output shape:

With Structured Output on, the node returns only the object you defined — the usual chat-completion envelope (choices, model, token usage) is not included:

{
  "sentiment": "positive",
  "score": 0.9
}

Tip: Every field is treated as optional (nullable), so the model may legitimately return null for a field. Handle possible nulls in downstream nodes.

Example Use Case

Summarise an Inbound Case Description

Use the AI Models Node to produce a short summary of free-text content from a trigger payload.

Configuration:

Connection:
  API Key: {{{env.PLATFORM_AI_API_KEY}}}

Parameters:
  Model: gpt-5-mini
  User Prompt: |
    You are an assistant that summarises citizen case descriptions for officers.
    Produce a 2-3 sentence plain-text summary of the case below. Do not include personal data.

    Case description:
    {{{trigger.data.description}}}

Downstream usage:

In a later node (e.g. an Ownself Gather Update Partial Case or an Email node), reference the model’s reply with the field selector — typically at {{{choices[0].message.content}}} after running a simulation to confirm the exact path.

Error Handling

A non-exhaustive list of error codes that may be returned by the AI Models service is shown below. Refer to their full error message for more information.

Code Possible Cause Suggested Action
400 Invalid parameters Check request body for missing or incorrect fields
401 Invalid API key Verify that the API key is correct
404 Endpoint does not exist Verify that the URL is correct
429 Rate limit exceeded Reduce the rate of requests or reduce the size of requests
500 Internal server error -
503 Service unavailable Wait a while before making the request again

When to Use It?

Use the AI Models Node when:

  • You need to summarise, classify, or rewrite free-text content as part of a workflow.
  • You want to extract structured information from unstructured text using a prompt.
  • You are prototyping AI-assisted automation and want a managed, OpenAI-compatible endpoint without standing up your own integration.

Consider other options when:

  • You are processing documents (PDFs, scans, images) — use the AISAY Node instead, which is purpose-built for OCR and document key-information extraction.
  • You need to generate JavaScript code from natural language inside a Function node — use the Function node’s Coding Assistant instead.
Chat with me!
Bot Launcher