Docly Developers
Function API only Updated 17 Oct 2026

getAIModels()

Lists the AI models the site can use with promptAI.

Requires AI to be enabled on the workspace's subscription (otherwise error 1, "AI features are not enabled on your subscription"). The call runs as the user who published the site, and that user must be a Docly developer — otherwise it throws "Access denied" (error -2).

See also promptAI

Parameters

This function takes no parameters.

Returns

An object with models — a list of { Id, Name, Provider, IsDefault, Compliance }, sorted by name — and defaultModel, the id of the default model. Beta models are only listed when the publisher is an administrator, with "(BETA)" after the name. Compliance holds the model's EU/GDPR labelling, or null when it is not labelled.

Example

Normal JavaScript, running in the browser or on the Docly™ server.
let info = docly.getAIModels();

let list = [];
for (let m of info.models)
    list.push({ id: m.Id, name: m.Name, isDefault: m.IsDefault });

return { models: list, defaultModel: info.defaultModel };