dotAI

dotAI integrates powerful AI tools into your dotCMS instance, allowing new horizons of automation — content and image generation, semantic searches, and more. Through workflows, dotAI is capable of performing batch operations — such as adding images to any content that's missing an image, or automatically generating SEO metadata to large swaths of content, adding content tags, and numerous other tasks.

dotAI Tool under Dev Tools toolgroup.

dotAI supports multiple AI service providers — OpenAI, Azure OpenAI, and Google Vertex AI (Gemini) — configured via the providerConfig JSON in the App settings. Additionally, the dotAI features will soon be available by default; at this moment, it requires one of two activation methods:

Requirements#


This feature requires the following:

  1. Credentials for your chosen AI provider (see App Configuration for provider-specific requirements);
  2. Postgres 18 with the pgvector extension installed.
    • If you're on dotCMS Cloud, we'll handle it!
    • For self-hosted customers, see below.

Self-Hosted#

For embeddings to function, a vector extension must be added to the Postgres database. The dotAI plugin will add this extension automatically, but this process requires dotCMS's database user has superuser privileges, ensuring extensions can be installed.

If the database user does not have sufficient rights, it may be necessary for IT or administrators to manually add the extension. The simplest implementation is via the pgvector/pgvector Docker tag, easily accessible via the command docker pull pgvector/pgvector. The image can be applied to a docker-compose.yml by adding it to the database section:

 db:
    image: pgvector/pgvector

Note also that these privileges are only required for the extension's installation, and not for its subsequent use.

App Configuration#


dotAI is configured via a single Provider Config (JSON) field in Settings > Apps > dotAI. All configuration — provider credentials, model selection, prompts, and behavioral settings — is expressed as a JSON object in this field.

The JSON has up to four top-level properties: chat, embeddings, image, and settings. Each section declares its own provider independently, so you can mix providers freely — for example, Vertex AI for chat and OpenAI for embeddings and images.

Common Fields#

The following fields are available in the chat, embeddings, and image sections across all providers. Provider-specific fields are documented in the sections below.

FieldDescription
providerThe AI provider to use. Accepted values: "openai", "azure_openai", "vertex_ai".
apiKeyAPI key for this provider. Masked as ***** in the UI after saving. Not used for Vertex AI when authenticating via Application Default Credentials.
modelModel name(s) to use. Supply a comma-separated list to enable fallback behavior — when the first model is unavailable, the next is tried. Example: "gpt-4o,gpt-4o-mini"
endpointCustom API endpoint URL. Required for Azure OpenAI; omit for standard OpenAI endpoints.
maxTokensMaximum tokens per response.
maxRetriesNumber of retry attempts on failure. Not supported for Vertex AI streaming chat.
temperature(chat section only) Controls response randomness (0–2).

Provider-Specific Fields#

Azure OpenAI (azure_openai)#

Prerequisites: An active Azure subscription with Azure OpenAI access enabled; an Azure OpenAI resource created in Azure AI Studio with one or more model deployments; the resource's API key and endpoint URL (found in Azure AI Studio → Your Resource → Keys and Endpoint).

FieldRequiredDescription
endpointYesAzure OpenAI resource base URL, e.g. https://my-resource.openai.azure.com/
deploymentNameYes*Name of the deployment in Azure AI Studio.
apiVersionRecommendedAzure API version string. Recommended: 2024-02-01.
dimensionsConditionalEmbedding vector dimensions. Required when using text-embedding-3-small or text-embedding-3-large.
sizeNoImage dimensions for image generation, e.g. 1024x1024.
timeoutNoRequest timeout in seconds.

*deploymentName or model is required. If your deployment name matches the model name exactly, model alone is sufficient; otherwise use deploymentName.

Note on reasoning models. Models in the o1, o3, and o4-mini families use max_completion_tokens instead of max_tokens at the API level. dotAI detects this automatically — set maxTokens as usual.

Note on API keys and multi-resource deployments. Azure scopes API keys to the resource, not to individual deployments. If your chat and embeddings deployments live in the same resource, both sections share the same apiKey and endpoint. If deployments span multiple resources, use the appropriate key and endpoint per section.

Google Vertex AI (vertex_ai)#

Prerequisites: A Google Cloud project with the Vertex AI API enabled; a service account with the Vertex AI User role or equivalent; either a downloaded service account key file (JSON) or workload identity configured (for GKE / Cloud Run).

Supported sections: chat only. Vertex AI Gemini does not support embeddings or image generation through this integration — those sections must use a different provider.

FieldRequiredDescription
projectIdYesGCP project ID, e.g. my-gcp-project.
locationYesGCP region where the model is available, e.g. us-central1.
credentialsJsonNoFull content of a GCP service account JSON key file, serialized as a single escaped JSON string. If omitted, Application Default Credentials (ADC) are used.
timeoutNoRequest timeout in seconds. Ignored for streaming chat.

model defaults to gemini-1.5-flash if omitted; recommended values include gemini-2.0-flash and gemini-1.5-pro. See the Vertex AI model garden for availability by region. us-central1 has the broadest coverage.

Authentication. Two options are supported:

  • Service account key file (recommended for on-premise / non-GCP deployments): paste the full content of your key file into credentialsJson. The value must be a single escaped JSON string — not an inline JSON object. To produce the correct format: cat my-key.json | python3 -c "import json,sys; print(json.dumps(sys.stdin.read()))"
  • Application Default Credentials (recommended for GKE / Cloud Run): omit credentialsJson. dotAI uses ADC automatically, respecting workload identity and environment-level credentials.

Provider Capability Summary#

Providerchatembeddingsimage
openaiYesYesYes
azure_openaiYesYesYes
vertex_aiYesNoNo

Settings#

The settings property carries behavioral and prompt configuration:

SettingDefaultDescription
rolePrompt"You are dotCMSbot..."Prompt describing the role the AI plays.
textPrompt"Use Descriptive writing style."Prompt describing the overall writing style of generated text.
imagePrompt"Use 16:9 aspect ratio."Aspect ratio or visual style guidance for image generation.
imageSize"1024x1024"Default dimensions of generated images.
listenerIndexer{}JSON object mapping index names to Content Types for auto-indexing. Most useful on the System Host to propagate indexes across sites. Example: { "default": "blog,news,webPageContent" }
temperature1Default temperature for chat completions.
embeddingsSplitAtTokens512Token chunk size for splitting content during embedding.
embeddingsMinimumTextLength64Minimum character length for a text chunk to be embedded.
embeddingsMinimumFileSize1024Minimum file size (bytes) for binary files to be embedded.
embeddingsFileExtensionspdf,doc,docx,txt,htmlFile extensions eligible for embedding.
embeddingsSearchThreshold.25Default similarity threshold for embedding searches.
embeddingsThreads3Number of concurrent embedding threads.
embeddingsThreadsMax6Maximum concurrent embedding threads.
embeddingsThreadsQueue10000Embedding thread queue depth.
embeddingsCacheTtlSeconds600Embeddings cache TTL in seconds.
embeddingsCacheSize1000Embeddings cache maximum size.
embeddingsDeleteOldOnUpdatetrueWhether to delete old embeddings when content is updated.
debugLoggingfalseEnable verbose debug logging.

Only include settings that differ from the defaults shown above — omitted keys fall back to their default values.

Each site can have its own providerConfig, or inherit the configuration from SYSTEM_HOST. To configure a specific site, select it from the site picker in Settings > Apps > dotAI before saving.

Once installed and configured, the dotCMS surfaces a variety of utilities. The section below provides a brief overview of each, and a link to further documentation.

Configuration Examples#

Minimal — OpenAI (standard)#

Sufficient for most OpenAI deployments. Omit any section you don't use.

{
  "chat": {
    "provider": "openai",
    "apiKey": "sk-...",
    "model": "gpt-4o",
    "maxTokens": 16384,
    "maxRetries": 3
  },
  "embeddings": {
    "provider": "openai",
    "apiKey": "sk-...",
    "model": "text-embedding-ada-002"
  },
  "image": {
    "provider": "openai",
    "apiKey": "sk-...",
    "model": "dall-e-3"
  }
}

OpenAI with custom settings#

Use the settings block only for values that differ from the defaults.

{
  "chat": {
    "provider": "openai",
    "apiKey": "sk-...",
    "model": "gpt-4o,gpt-4o-mini",
    "maxTokens": 16384,
    "temperature": 0.7,
    "maxRetries": 3,
    "endpoint": "https://your-proxy.example.com/v1/chat/completions"
  },
  "embeddings": {
    "provider": "openai",
    "apiKey": "sk-...",
    "model": "text-embedding-ada-002"
  },
  "image": {
    "provider": "openai",
    "apiKey": "sk-...",
    "model": "dall-e-3"
  },
  "settings": {
    "rolePrompt": "You are a helpful assistant for Acme Corp.",
    "textPrompt": "Be concise and professional.",
    "imagePrompt": "Use a clean, corporate visual style.",
    "imageSize": "1792x1024",
    "listenerIndexer": {
      "default": "blog,news,webPageContent"
    },
    "embeddingsSplitAtTokens": 256,
    "embeddingsSearchThreshold": 0.3,
    "debugLogging": false
  }
}

Azure OpenAI — chat and embeddings#

A minimal Azure configuration. Image generation here falls back to OpenAI; for a full Azure image setup see the example below.

{
  "chat": {
    "provider": "azure_openai",
    "apiKey": "YOUR_AZURE_API_KEY",
    "endpoint": "https://my-resource.openai.azure.com/",
    "deploymentName": "my-gpt4o-deployment",
    "apiVersion": "2024-02-01",
    "maxTokens": 16384
  },
  "embeddings": {
    "provider": "azure_openai",
    "apiKey": "YOUR_AZURE_API_KEY",
    "endpoint": "https://my-resource.openai.azure.com/",
    "deploymentName": "my-embeddings-deployment",
    "apiVersion": "2024-02-01"
  },
  "image": {
    "provider": "openai",
    "apiKey": "sk-...",
    "model": "gpt-image-1"
  }
}

If your deployment name matches the model name exactly, you can omit deploymentName and use model alone:

{
  "chat": {
    "provider": "azure_openai",
    "apiKey": "YOUR_AZURE_API_KEY",
    "endpoint": "https://my-resource.openai.azure.com/",
    "model": "gpt-5.4",
    "apiVersion": "2024-02-01",
    "maxTokens": 16384
  }
}

Azure OpenAI — full configuration with image generation#

Azure supports two endpoint types for image generation, selected automatically based on the endpoint URL. In early 2026, Microsoft retired DALL-E 3 image deployments on Azure OpenAI in favour of the gpt-image series.

  • *.openai.azure.com (Classic Azure OpenAI): requires deploymentName and apiVersion; supports gpt-image-1.
  • *.services.ai.azure.com (Azure AI Foundry): uses a plain OpenAI-style client; do not set apiVersion (it produces a warning if present); supports gpt-image-2.

Full configuration using the Foundry endpoint for images:

{
  "chat": {
    "provider": "azure_openai",
    "apiKey": "YOUR_AZURE_API_KEY",
    "endpoint": "https://my-resource.openai.azure.com/",
    "deploymentName": "my-gpt4o-deployment",
    "apiVersion": "2024-02-01",
    "maxTokens": 16384
  },
  "embeddings": {
    "provider": "azure_openai",
    "apiKey": "YOUR_AZURE_API_KEY",
    "endpoint": "https://my-resource.openai.azure.com/",
    "deploymentName": "my-embeddings-deployment",
    "apiVersion": "2024-02-01"
  },
  "image": {
    "provider": "azure_openai",
    "apiKey": "YOUR_FOUNDRY_API_KEY",
    "endpoint": "https://my-resource.services.ai.azure.com/openai/v1/",
    "model": "gpt-image-2",
    "size": "1024x1024"
  }
}

Google Vertex AI (Gemini) — chat only#

Vertex AI supports chat only; embeddings and images must use a separate provider.

{
  "chat": {
    "provider": "vertex_ai",
    "projectId": "my-gcp-project",
    "location": "us-central1",
    "model": "gemini-2.0-flash",
    "credentialsJson": "{ ... service account JSON ... }"
  },
  "embeddings": {
    "provider": "openai",
    "apiKey": "sk-...",
    "model": "text-embedding-ada-002"
  },
  "image": {
    "provider": "openai",
    "apiKey": "sk-...",
    "model": "gpt-image-1"
  }
}

To use Application Default Credentials instead of a key file, omit credentialsJson:

{
  "chat": {
    "provider": "vertex_ai",
    "projectId": "my-gcp-project",
    "location": "us-central1",
    "model": "gemini-2.0-flash",
    "maxTokens": 8192
  }
}

Per-Site Config#

To configure a specific site, go to Settings > Apps > dotAI, select the target site from the site picker, and save a separate providerConfig JSON.

To verify which host's config is being applied, check the configHost field in the GET response:

GET /api/v1/ai/completions/config?siteId=your-site-id
{
  "providerConfig": "{ ... }",
  "configHost": "SYSTEM_HOST"
}

If configHost returns the target site's hostname, the per-site config is active. Credentials are masked as ***** in the response.

Legacy Configuration#

Before the implementation of the provider configuration specified above, the dotAI App Configuration followed a different, multiple-field pattern. A full list of the legacy fields follows:

FieldDescription
API KeyYour account's API key; must be present to utilize OpenAI services.
Model NamesA comma-separated list of the models used to generate OpenAPI responses. Including multiple models also enables fallback behavior; when a specified model is not found, the next one is used. Example: gpt-4o-mini,gpt-3.5-turbo-16k,gpt-4o
Role PromptA prompt describing the role (if any) the text generator will play for the dotCMS user.
Text PromptA prompt describing the overall writing style of generated text.
Tokens per MinutePermits configurable rate limiting for text responses based on token use.
API per MinutePermits configurable rate limiting for text responses based on API call volume.
Max TokensPermits configurable rate limiting for token consumption per API response.
Completion model enabledIf checked, causes text responses to incorporate completions. Completions are useful for interactive chat modes and other dynamic uses, capable of incorporating response histories into future responses.
Image Model NamesA comma-separated list of the image models used to generate graphical responses. Including multiple models also enables fallback behavior; when a specified model is not found, the next one is used.
Image PromptA specification of output aspect ratio. If the ratio specified differs significantly from the Image Size (below), the image will "letterbox" accordingly.
Image SizeSelects the default dimensions of generated images.
Image Tokens per MinutePermits configurable rate limiting for image responses based on token use.
Image API per MinutePermits configurable rate limiting for image responses based on API call volume.
Image Max TokensPermits configurable rate limiting for token consumption per image generation API response.
Image Completion model enabledIf checked, causes image responses to incorporate completions. Completions are useful for interactive chat modes and other dynamic uses, capable of incorporating response histories into future responses.
Embeddings Model NamesA comma-separated list of the image models used to generate graphical responses. Including multiple models also enables fallback behavior; when a specified model is not found, the next one is used.
Embeddings Tokens per MinutePermits configurable rate limiting for embeddings responses based on token use.
Embeddings API per MinutePermits configurable rate limiting for embeddings responses based on API call volume.
Embeddings Max TokensPermits configurable rate limiting for token consumption per embeddings API response.
Embeddings Completion model enabledIf checked, causes embedding responses to incorporate completions. Completions are useful for interactive chat modes and other dynamic uses, capable of incorporating response histories into future responses.
Auto Index Content ConfigAllows App-level configuration of content indexes used as the basis for text generation. Takes a JSON mapping; each property name becomes an index, and each value is the Content Type it will take as its target content. Optional; indexes are also fully configurable under the dotAI Tool. Most useful when configured in the System Host, as this will instantiate the indexes across multiple sites.
Custom PropertiesAdditional key-value pairs for dotAI configuration.

Using dotAI#


The dotAI feature includes several components, detailed separately:

ComponentDescription
dotAI ToolThe dotAI admin-panel interface can be found via Tools -> dotAI, allowing direct usage, index definition, and general configuration of the feature.
AI BlocksdotAI's integration with the Block Editor field provides the most straightforward way to get started generating content.
AI WorkflowsAI Workflow Sub-Actions permit a range of asynchronous automations utilizing AI — such as generating entire contentlets on demand.
AI ViewtoolThe AI Viewtool, accessible through $ai, allows AI operations via Velocity script.
API ResourcesREST API endpoints allow AI operations to be performed headlessly.