# list_site_ai_requests

Source: https://modulify.ai/docs/api/ai/list-site-ai-requests

Lists the AI requests a site made, newest first, 50 to a page, with each one's model, status, tokens, credits and time taken.

- Title: List the AI requests of a site
- Scope: `config:read`
- Access: Read only
- Endpoint: `POST /v1/list_site_ai_requests`

The answer carries `items` and `nextCursor`. Pass `nextCursor` back as `cursor` for the next page, and it is null once there is nothing more. `limit` sets the page size, from 1 to 200.

Each item carries its `id`, when it was made (`at`), its `kind` (`chat` or `embedding`), the `model` it asked for and `servedModel`, the one that answered, which can differ from it, and `stream`, whether the answer was streamed. `status` is `ok` when it was answered, `error` when it failed and `aborted` when the answer was stopped partway, the **Answered**, **Failed** and **Stopped** of the **History** tab. `httpStatus` is the HTTP status it answered with, and `errorCode` the reason a failed one failed.

`inputTokens` and `outputTokens` are its tokens, `credits` what it cost, rounded to two decimals, so a short answer can show `0`, and `latencyMs` how long it took. `estimated` is true when the provider reported no token counts, so they were estimated, which the tab marks **Estimated**. A failed request costs nothing, and a stopped one is charged for what was written until then.

Each request stays for 30 days and shows up a few seconds after it ends. Modulify keeps these counts only, never what your visitors asked or what the AI answered, so no tool can show them. `get_site_ai_stats` counts the same requests over a period. See [Insights and history](https://modulify.ai/docs/built-in/ai#insights-and-history).

## Request

Call it with a `POST` to `https://api.modulify.ai/v1/list_site_ai_requests`, 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/list_site_ai_requests \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"projectId":"PROJECT_ID"}'
```

Over MCP, the same method is the [list_site_ai_requests tool](https://modulify.ai/docs/mcp/ai/list-site-ai-requests).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site id. |
| `cursor` | string | No | The `nextCursor` from the previous page. Omit it for the first page. |
| `limit` | integer | No | Requests per page, from 1 to 200. Defaults to 50. |

## 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.