ai-settings

6 endpoints.

GET/api/ai-settings Bearer token
Scopesettings:read

Read the AI settings

The models this build knows — which are offered, and what each still needs from the server's environment — the default model and reasoning level, the instructions every agent gets, and the agents' sandboxes. Superusers only.

Responses

StatusDescriptionBody
200The settings.AiSettings
401The access token is missing or invalid.ErrorResponse
403The caller is not a superuser. Also when the access token lacks `settings:read` (`insufficient_scope`).ErrorResponse
500The settings could not be read.ErrorResponse
PATCH/api/ai-settings Bearer token
Scopesettings:write

Change the AI settings

Sets the fields given; the rest keep their values. The default model must be among those offered. Sessions already started keep their model. Superusers only.

Request body

application/jsonrequiredUpdateAiSettingsRequest
FieldTypeRequiredDescription
enabled_model_idsarray of stringno

at most 50 items

default_model_idstringno

at least 1 character

thinking_levelstringno

one of "low" | "medium" | "high" | "xhigh" | "max"

instructionsstring | nullno

Null or blank for none.

at most 10000 characters

sandbox_networkstringno

one of "deny-all" | "allow-all" | "allowlist"

sandbox_allowed_domainsarray of stringno

at most 100 items

sandbox_timeout_minutesintegerno

minimum 5 · maximum 1440

Responses

StatusDescriptionBody
200The settings, after the change.AiSettings
400The body failed validation, names an unknown model, or leaves the default model unoffered.ErrorResponse
401The access token is missing or invalid.ErrorResponse
403The caller is not a superuser. Also when the access token lacks `settings:write` (`insufficient_scope`).ErrorResponse
500The settings could not be saved.ErrorResponse
GET/api/ai-settings/role-limits Bearer token
Scopesettings:read

List the AI role limits

Every rule, the audiences first and then the department roles by name. Superusers only.

Responses

StatusDescriptionBody
200Every rule.AiRoleLimitList
401The access token is missing or invalid.ErrorResponse
403The caller is not a superuser. Also when the access token lacks `settings:read` (`insufficient_scope`).ErrorResponse
500The rules could not be read.ErrorResponse
POST/api/ai-settings/role-limits Bearer token
Scopesettings:write

Add an AI role limit

Adds the rule for one audience or department role. Each has at most one rule. Superusers only.

Request body

application/jsonrequiredCreateAiRoleLimitRequest
FieldTypeRequiredDescription
audiencestringyes

one of "everyone" | "trainers" | "superusers" | "role"

department_role_idstring (uuid) | nullno

The department role, for `audience: role`; left out otherwise.

agents_enabledbooleanyes

May start agent sessions.

mcp_enabledbooleanyes

May call the MCP server with a token of their own.

daily_turn_limitinteger | nullyes

Agent turns a day (UTC). Null for no limit.

minimum 0 · maximum 2000000000

daily_token_limitinteger | nullyes

Model tokens a day (UTC), input and output together. Null for no limit.

minimum 0 · maximum 2000000000

max_sessionsinteger | nullyes

Open agent sessions at once; archived ones do not count. Null for no limit.

minimum 0 · maximum 2000000000

allowed_model_idsarray of stringyes

The models agents may run on; empty for every model the deployment offers.

at most 50 items

delegated_scopesarray of stringyes

The most an agent's delegated token may carry, before it is cut down to the person's own token's scopes. Empty: agents get no learning record tools.

at most 100 items

Responses

StatusDescriptionBody
201Every rule, the new one among them.AiRoleLimitList
400The body failed validation, names an unknown model or scope, or a role rule names no role.ErrorResponse
401The access token is missing or invalid.ErrorResponse
403The caller is not a superuser. Also when the access token lacks `settings:write` (`insufficient_scope`).ErrorResponse
404No department role has that id.ErrorResponse
409That audience or role already has a rule.ErrorResponse
500The rule could not be saved.ErrorResponse
PATCH/api/ai-settings/role-limits/{limit_id} Bearer token
Scopesettings:write

Change an AI role limit

Replaces a rule's limits; its audience stays. Superusers only.

Parameters

NameInTypeRequiredDescription
limit_idpathstring (uuid)yese.g. 1f0b8f7e-7c2b-4a0e-9d0a-5c4e2b1f3a6d

Request body

application/jsonrequiredUpdateAiRoleLimitRequest
FieldTypeRequiredDescription
agents_enabledbooleanyes

May start agent sessions.

mcp_enabledbooleanyes

May call the MCP server with a token of their own.

daily_turn_limitinteger | nullyes

Agent turns a day (UTC). Null for no limit.

minimum 0 · maximum 2000000000

daily_token_limitinteger | nullyes

Model tokens a day (UTC), input and output together. Null for no limit.

minimum 0 · maximum 2000000000

max_sessionsinteger | nullyes

Open agent sessions at once; archived ones do not count. Null for no limit.

minimum 0 · maximum 2000000000

allowed_model_idsarray of stringyes

The models agents may run on; empty for every model the deployment offers.

at most 50 items

delegated_scopesarray of stringyes

The most an agent's delegated token may carry, before it is cut down to the person's own token's scopes. Empty: agents get no learning record tools.

at most 100 items

Responses

StatusDescriptionBody
200Every rule, after the change.AiRoleLimitList
400The body failed validation, or names an unknown model or scope.ErrorResponse
401The access token is missing or invalid.ErrorResponse
403The caller is not a superuser. Also when the access token lacks `settings:write` (`insufficient_scope`).ErrorResponse
404No rule has that id.ErrorResponse
500The rule could not be saved.ErrorResponse
DELETE/api/ai-settings/role-limits/{limit_id} Bearer token
Scopesettings:write

Remove an AI role limit

Removes a rule: its audience gets nothing from it any more. Sessions already started are kept, but take no new turns unless another rule allows agents. Superusers only.

Parameters

NameInTypeRequiredDescription
limit_idpathstring (uuid)yese.g. 1f0b8f7e-7c2b-4a0e-9d0a-5c4e2b1f3a6d

Responses

StatusDescriptionBody
204The rule is gone.—
401The access token is missing or invalid.ErrorResponse
403The caller is not a superuser. Also when the access token lacks `settings:write` (`insufficient_scope`).ErrorResponse
404No rule has that id.ErrorResponse
500The rule could not be removed.ErrorResponse