Turn AI on or off for a site
update_site_ai_settings
Turns AI on or off for a site. Monthly caps are set for the whole workspace with update_workspace_spending.
The answer is the same as get_site_ai_settings. Any member of the workspace whose role has API access can turn AI on or off, like the switch in the AI tab.
AI is on from the start for every site. Turning it off makes every AI request of the site answer 403 within a minute, from the live site and the preview alike, so every AI feature of the site stops answering until it is turned back on. The history and the key are kept. The tool tells the client to confirm with you before turning AI off on a published site, because its visitors notice at once. See Turn AI off and on.
There is no cap per site. The workspace owner caps what the AI of every site spends together, and everything the workspace spends, in Spending > Settings, or with update_workspace_spending. See Spending caps and alerts.
Request
Call it with a POST to https://api.modulify.ai/v1/update_site_ai_settings, sending the inputs below as a JSON object. The token needs the config:write scope.
It makes changes, so send an Idempotency-Key header whenever you might retry it. A retry with the same key gets the first answer back instead of running again.
curl -X POST https://api.modulify.ai/v1/update_site_ai_settings \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"projectId":"PROJECT_ID","enabled":true}'Over MCP, the same method is the update_site_ai_settings tool.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
projectId |
string | Yes | The site id. |
enabled |
boolean | Yes | True to turn AI on, false to turn it off. |
Response
Every call answers with the JSON envelope of success, message, data, code and version. data holds the result described above, and on a method that returns a total, count carries it. The response headers carry the call's X-Request-Id and what is left of your per-minute budget in X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. Errors explains every status code a call can answer with.