# get_site_ai_settings

Source: https://modulify.ai/docs/api/ai/get-site-ai-settings

Reads whether AI is on for a site, where it stands, this month's usage, the workspace caps that limit it and the address the site calls, without the key.

- Title: Read the AI settings and usage of a site
- Scope: `config:read`
- Access: Read only
- Endpoint: `POST /v1/get_site_ai_settings`

AI is the service a site's own server code uses to call AI models through Modulify, with no account or key of its own, paid from the workspace credits. `enabled` says whether it is on, which it is from the start for every site, and `status` where it stands:

- `ready` while requests are answered.
- `off` while AI is turned off for the site, so every request answers `403`.
- `paused` while the site stopped spending. `pausedReason` says why: `no-credits` when the workspace has no credits left, or `cap-reached` when the workspace reached its monthly AI cap or its monthly spending cap. `pausedAt` says since when, and `pausedMessage` how it starts again.

While AI is paused, every request answers `402`. See [When AI pauses](https://modulify.ai/docs/built-in/ai#when-ai-pauses).

`month` covers this calendar month in UTC, with `period` as `YYYY-MM`: `requests`, `errors`, `inputTokens` and `outputTokens`, `creditsUsed`, what those requests cost, and `creditsBought`, the credits the site took from the workspace for AI this month. `balanceCredits` is the usage the site bought and has not used yet. These are the **This month** numbers of the **Overview** tab, where `balanceCredits` reads **Prepaid left**. `isPaid` says whether the workspace is on a paid plan.

`workspaceCaps` carries the monthly caps of the whole workspace that stop AI: `ai`, the AI cap of every site together, and `total`, the cap on everything the workspace spends, each null when it is not set, with `aiSpent` and `totalSpent`, what this month's spending counts against them. Only the workspace owner changes them, in **Spending** > **Settings** or with `update_workspace_spending`.

`creditRate` and `markup` turn a model's list price into credits: a request costs its list price times `markup`, divided by `creditRate`. The tool tells the client to always give you AI prices in credits, the way the **Models** list on the **Settings** tab shows them.

`url` is the base URL the site calls, the value of `MODULIFY_AI_URL`, and `modelsUrl` lists every model with its list price, with no key needed. `defaults.chat` and `defaults.embedding` name the models a request uses when it names none, `modulify/fast` and `modulify/embed`. `keyChangedAt` is when the key last changed. The key itself is never in the answer, and `get_site_ai_key` reads it. `canManage` says whether you hold the **Delete projects** permission, which `get_site_ai_key` and `rotate_site_ai_key` need.

`update_site_ai_settings` turns AI on or off. See [AI](https://modulify.ai/docs/built-in/ai).

## Request

Call it with a `POST` to `https://api.modulify.ai/v1/get_site_ai_settings`, sending the inputs below as a JSON object. The token needs the `config:read` scope.

It only reads and changes nothing, so retrying it is safe.

```bash
curl -X POST https://api.modulify.ai/v1/get_site_ai_settings \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"projectId":"PROJECT_ID"}'
```

Over MCP, the same method is the [get_site_ai_settings tool](https://modulify.ai/docs/mcp/ai/get-site-ai-settings).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site id. |

## Response

Every call answers with the [JSON envelope](https://modulify.ai/docs/api/requests-and-responses#the-response) 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](https://modulify.ai/docs/api/requests-and-responses#headers-on-every-method-call) 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](https://modulify.ai/docs/api/errors) explains every status code a call can answer with.