Version 2.2.5.20261030013242 · latest Download OpenAPI Markdown

AI assistant

Model connection settings and connection test, the model rating table, availability and quota, conversation history, and the assistant look.

aiAI assistantAuthentication: User19 endpoints

List my AI conversations

GET/api/v2/ai/conversations
Authentication: User

Get my AI conversation

GET/api/v2/ai/conversations/{id}
Authentication: User

Delete my AI conversation

DELETE/api/v2/ai/conversations/{id}
Authentication: User

Get my assistant look

GET/api/v2/ai/look
Authentication: User

Save my assistant look

PUT/api/v2/ai/look
Authentication: User

Request body application/json

FieldTypeRequiredDescription
namestringRequired Assistant name; empty means the default name.
petAiPetRequired Assistant figure: orb, cat, dog, bot, or ai (drawn from the custom parameters in spec).
Values ["orb","cat","dog","bot","ai"]
specAiLookSpec— Parameters of the AI custom figure (whitelisted values only; the panel draws it from fixed SVG parts). Absent from AiLook when never customised. Required when saving with pet ai or theme custom (code required); omitted means the stored one is kept. The server re-checks and normalises it (lowercase colours, primary darkened until white text is readable).
themeAiThemeRequired Assistant accent colour: blue, teal, sunset, morandi, ink, or custom (the three colours in the custom parameters, spec). Applies to the assistant panel only.
Values ["blue","teal","sunset","morandi","ink","custom"]

Get my uploaded assistant avatar

GET/api/v2/ai/look/avatar
Authentication: User

Upload my assistant avatar

PUT/api/v2/ai/look/avatar
Authentication: User

Remove my uploaded assistant avatar

DELETE/api/v2/ai/look/avatar
Authentication: User

Generate a custom assistant figure from a description

POST/api/v2/ai/look/generate
Authentication: User

Request body application/json

FieldTypeRequiredDescription
textstringRequired The look you want, at most 60 characters after control characters and angle brackets are removed.

Send a message to the AI assistant

POST/api/v2/ai/messages
Authentication: User

Request body application/json

FieldTypeRequiredDescription
contextAiContext— Current page context: only the page name and the ID of the open item; the server fetches the data. Pages with detailed data: home, attack_logs (ref = record ID), sites (ref = site ID); other pages pass only the name.
conversation_idinteger— Conversation to continue; omit to start a new one (titled from this message).
textstringRequired The look you want, at most 60 characters after control characters and angle brackets are removed.

List AI model ratings

GET/api/v2/ai/models
Authentication: Admin only

Cancel an AI assistant plan

POST/api/v2/ai/plans/cancel
Authentication: User

Request body application/json

FieldTypeRequiredDescription
plan_idAiPlanKeyRequired Plan id (random, 32 hex digits).

Execute an AI assistant plan

POST/api/v2/ai/plans/execute
Authentication: User

Request body application/json

FieldTypeRequiredDescription
passwordstring— Current login password.
plan_idAiPlanKeyRequired Plan id (random, 32 hex digits).
totp_codestring— Current 6-digit TOTP code; the account must have TOTP enabled.

Revise the parameters of an AI assistant plan

POST/api/v2/ai/plans/revise
Authentication: User

Request body application/json

FieldTypeRequiredDescription
domainstringRequired Site domain.
originstringRequired Origin address (IP or hostname).
plan_idAiPlanKeyRequired Plan id (random, 32 hex digits).
portintegerRequired Origin port.
upidintegerRequired Purchased package to use (must belong to the plan's owning tenant).

Get an AI assistant plan

GET/api/v2/ai/plans/{plan_id}
Authentication: User

Get AI assistant settings

GET/api/v2/ai/settings
Authentication: Admin only

Save AI assistant settings

PUT/api/v2/ai/settings
Authentication: Admin only

Request body application/json

FieldTypeRequiredDescription
api_keystring— API key; omit to keep the stored one, or send an empty string to clear it (which disables the assistant). Stored sealed and never returned.
api_typeAiApiTypeRequired API type: openai is OpenAI-compatible (/chat/completions, also used by most providers in mainland China); claude is the native Anthropic API (/messages); moonshot is Kimi (OpenAI-compatible with a different default address).
Values ["openai","claude","moonshot"]
base_urlstring— Service address (public HTTPS); empty if never saved.
modelstringRequired Model name.

Test AI assistant connection

POST/api/v2/ai/settings/probe
Authentication: Admin only

Request body application/json

FieldTypeRequiredDescription
api_keystring— API key; omit to keep the stored one, or send an empty string to clear it (which disables the assistant). Stored sealed and never returned.
api_typeAiApiTypeRequired API type: openai is OpenAI-compatible (/chat/completions, also used by most providers in mainland China); claude is the native Anthropic API (/messages); moonshot is Kimi (OpenAI-compatible with a different default address).
Values ["openai","claude","moonshot"]
base_urlstring— Service address (public HTTPS); empty if never saved.
modelstringRequired Model name.

Get AI assistant availability

GET/api/v2/ai/status
Authentication: User

AI assistant object

FieldTypeRequiredDescription
api_keystring— API key; omit to keep the stored one, or send an empty string to clear it (which disables the assistant). Stored sealed and never returned.
api_typeAiApiType— API type: openai is OpenAI-compatible (/chat/completions, also used by most providers in mainland China); claude is the native Anthropic API (/messages); moonshot is Kimi (OpenAI-compatible with a different default address).
Values ["openai","claude","moonshot"]
availableboolean— Whether the assistant is shown and usable; true but read-only for a delegated session (reason=delegated).
avatar_verinteger— Avatar version; 0 means no uploaded avatar (the chosen figure is shown), above 0 fetch it with GET /ai/look/avatar; grows on every change.
base_urlstring— Service address (public HTTPS); empty if never saved.
cert_idinteger— The requested certificate.
cnamestring— CNAME target from the create response; while waiting for DNS the user points the domain to it.
codestring— Failure detail: blocked (address rejected, such as private), auth (key rejected), rate_limited (upstream rate limit), timeout, refused (model refused), protocol (malformed response), http (other status code), connect (unreachable).
connect_msinteger— Connect time in milliseconds (latest request).
contextAiContext— Current page context: only the page name and the ID of the open item; the server fetches the data. Pages with detailed data: home, attack_logs (ref = record ID), sites (ref = site ID); other pages pass only the name.
conversation_idinteger— Conversation to continue; omit to start a new one (titled from this message).
created_atstring— Created at.
detailstring— Explanation for the admin (includes an upstream error excerpt, never the key).
domainstringRequired Site domain.
errorstring— Why the plan failed.
expires_atstring— The plan cannot be executed after this time.
fetched_onstring— Date the data was fetched.
first_token_msinteger— Slowest first-token time in milliseconds over the rounds run.
high_riskboolean— Re-authentication is required before executing.
idinteger— Conversation ID.
itemsAiConversation[]— Conversations (without messages).
key_setboolean— Whether an API key is set (the key itself is never returned).
kindAiPlanKind— create_site: add a site (HTTP first; the certificate is requested after DNS is set up); delete_site: delete a site (high risk, re-authentication required).
Values ["create_site","delete_site"]
messagesAiMessage[]— All messages (only when getting a single conversation).
modelstring— Model name.
namestring— Assistant name; empty means the default name.
okboolean— Whether the probe passed.
originstringRequired Origin address (IP or hostname).
outdatedboolean— Data is more than 90 days old; the panel shows that ratings may be outdated.
paramsAiPlanParams— Frozen plan parameters. Adding a site: domain, origin, port, upid, package (plus tenant_id when an admin creates for a tenant); deleting a site: site_id, with site_name and domains for review.
passwordstring— Current login password.
petAiPet— Assistant figure: orb, cat, dog, bot, or ai (drawn from the custom parameters in spec).
Values ["orb","cat","dog","bot","ai"]
plan_idAiPlanKeyRequired Plan id (random, 32 hex digits).
portintegerRequired Origin port.
probe_first_token_msinteger— Slowest first-token time in milliseconds over the 3 probe rounds; 0 if not passed.
probe_okboolean— Whether the save-time probe passed; reset when the model or key changes.
probe_round_msinteger— Slowest round time in milliseconds over the 3 probe rounds; 0 if not passed.
probed_atstring— When the probe passed; null if not passed.
readyboolean— Whether the settings are usable (key set, model set and probe passed); the license is checked separately, see /ai/status.
reasonstring— Why unavailable: unlicensed (not enabled), expired (license expired), not_configured (the admin has not connected a model), delegated (a delegated session; only with available=true, read-only, cannot send), demo (demo mode).
Values ["unlicensed","expired","not_configured","delegated","demo"]
reauth_methodsAiReauthMethod[]— Re-authentication methods available for a high-risk plan; empty otherwise.
revoking_untilstring— When the provider has revoked the license, usable until this time.
round_msinteger— Slowest round time in milliseconds over the rounds run.
roundsinteger— Rounds completed (3 when passed).
site_idinteger— The created site.
specAiLookSpec— Parameters of the AI custom figure (whitelisted values only; the panel draws it from fixed SVG parts). Absent from AiLook when never customised. Required when saving with pet ai or theme custom (code required); omitted means the stored one is kept. The server re-checks and normalises it (lowercase colours, primary darkened until white text is readable).
stateAiPlanState— proposed: waiting to run; running: in progress; wait_dns: site created, waiting for the DNS record (executing again requests the certificate); done; failed (see error); cancelled; superseded: replaced by a revised plan.
Values ["proposed","running","wait_dns","done","failed","cancelled","superseded"]
stepstring— Where a failed probe stopped: connect (unreachable or upstream error), tool (did not call the tool with the numbers), echo (wrong echo), first_token (first token too slow), round (round too slow).
Values ["connect","tool","echo","first_token","round"]
textstringRequired The look you want, at most 60 characters after control characters and angle brackets are removed.
themeAiTheme— Assistant accent colour: blue, teal, sunset, morandi, ink, or custom (the three colours in the custom parameters, spec). Applies to the assistant panel only.
Values ["blue","teal","sunset","morandi","ink","custom"]
titlestring— Title (start of the first question).
totp_codestring— Current 6-digit TOTP code; the account must have TOTP enabled.
updated_atstring— Time of the last message (retention counts from it).
upidintegerRequired Purchased package to use (must belong to the plan's owning tenant).
usageobject— Your usage and quota after this generation (already counted).
versionstring— Rating methodology version.