ai-settings
6 endpoints.
/api/ai-settings Bearer tokenRead 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
| Status | Description | Body |
|---|---|---|
| 200 | The settings. | AiSettings |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The caller is not a superuser. Also when the access token lacks `settings:read` (`insufficient_scope`). | ErrorResponse |
| 500 | The settings could not be read. | ErrorResponse |
/api/ai-settings Bearer tokenChange 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.
| Field | Type | Required | Description |
|---|---|---|---|
| enabled_model_ids | array of string | no | at most 50 items |
| default_model_id | string | no | at least 1 character |
| thinking_level | string | no | one of "low" | "medium" | "high" | "xhigh" | "max" |
| instructions | string | null | no | Null or blank for none. at most 10000 characters |
| sandbox_network | string | no | one of "deny-all" | "allow-all" | "allowlist" |
| sandbox_allowed_domains | array of string | no | at most 100 items |
| sandbox_timeout_minutes | integer | no | minimum 5 · maximum 1440 |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | The settings, after the change. | AiSettings |
| 400 | The body failed validation, names an unknown model, or leaves the default model unoffered. | ErrorResponse |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The caller is not a superuser. Also when the access token lacks `settings:write` (`insufficient_scope`). | ErrorResponse |
| 500 | The settings could not be saved. | ErrorResponse |
/api/ai-settings/role-limits Bearer tokenList the AI role limits
Every rule, the audiences first and then the department roles by name. Superusers only.
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Every rule. | AiRoleLimitList |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The caller is not a superuser. Also when the access token lacks `settings:read` (`insufficient_scope`). | ErrorResponse |
| 500 | The rules could not be read. | ErrorResponse |
/api/ai-settings/role-limits Bearer tokenAdd an AI role limit
Adds the rule for one audience or department role. Each has at most one rule. Superusers only.
| Field | Type | Required | Description |
|---|---|---|---|
| audience | string | yes | one of "everyone" | "trainers" | "superusers" | "role" |
| department_role_id | string (uuid) | null | no | The department role, for `audience: role`; left out otherwise. |
| agents_enabled | boolean | yes | May start agent sessions. |
| mcp_enabled | boolean | yes | May call the MCP server with a token of their own. |
| daily_turn_limit | integer | null | yes | Agent turns a day (UTC). Null for no limit. minimum 0 · maximum 2000000000 |
| daily_token_limit | integer | null | yes | Model tokens a day (UTC), input and output together. Null for no limit. minimum 0 · maximum 2000000000 |
| max_sessions | integer | null | yes | Open agent sessions at once; archived ones do not count. Null for no limit. minimum 0 · maximum 2000000000 |
| allowed_model_ids | array of string | yes | The models agents may run on; empty for every model the deployment offers. at most 50 items |
| delegated_scopes | array of string | yes | 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
| Status | Description | Body |
|---|---|---|
| 201 | Every rule, the new one among them. | AiRoleLimitList |
| 400 | The body failed validation, names an unknown model or scope, or a role rule names no role. | ErrorResponse |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The caller is not a superuser. Also when the access token lacks `settings:write` (`insufficient_scope`). | ErrorResponse |
| 404 | No department role has that id. | ErrorResponse |
| 409 | That audience or role already has a rule. | ErrorResponse |
| 500 | The rule could not be saved. | ErrorResponse |
/api/ai-settings/role-limits/{limit_id} Bearer tokenChange an AI role limit
Replaces a rule's limits; its audience stays. Superusers only.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| limit_id | path | string (uuid) | yes | e.g. 1f0b8f7e-7c2b-4a0e-9d0a-5c4e2b1f3a6d |
| Field | Type | Required | Description |
|---|---|---|---|
| agents_enabled | boolean | yes | May start agent sessions. |
| mcp_enabled | boolean | yes | May call the MCP server with a token of their own. |
| daily_turn_limit | integer | null | yes | Agent turns a day (UTC). Null for no limit. minimum 0 · maximum 2000000000 |
| daily_token_limit | integer | null | yes | Model tokens a day (UTC), input and output together. Null for no limit. minimum 0 · maximum 2000000000 |
| max_sessions | integer | null | yes | Open agent sessions at once; archived ones do not count. Null for no limit. minimum 0 · maximum 2000000000 |
| allowed_model_ids | array of string | yes | The models agents may run on; empty for every model the deployment offers. at most 50 items |
| delegated_scopes | array of string | yes | 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
| Status | Description | Body |
|---|---|---|
| 200 | Every rule, after the change. | AiRoleLimitList |
| 400 | The body failed validation, or names an unknown model or scope. | ErrorResponse |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The caller is not a superuser. Also when the access token lacks `settings:write` (`insufficient_scope`). | ErrorResponse |
| 404 | No rule has that id. | ErrorResponse |
| 500 | The rule could not be saved. | ErrorResponse |
/api/ai-settings/role-limits/{limit_id} Bearer tokenRemove 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| limit_id | path | string (uuid) | yes | e.g. 1f0b8f7e-7c2b-4a0e-9d0a-5c4e2b1f3a6d |
Responses
| Status | Description | Body |
|---|---|---|
| 204 | The rule is gone. | — |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The caller is not a superuser. Also when the access token lacks `settings:write` (`insufficient_scope`). | ErrorResponse |
| 404 | No rule has that id. | ErrorResponse |
| 500 | The rule could not be removed. | ErrorResponse |