ai-search
3 endpoints.
/api/ai-search Bearer tokenRead the AI search configuration and index
What the deployment's environment configures for AI (semantic) search — the embedding provider and model, the media describer, the file size cap; never a key — and the state of the index: how many chunks of each kind of content it holds under the current model, how many an earlier model left behind, and the recent indexing runs. Superusers only.
Responses
| Status | Description | Body |
|---|---|---|
| 200 | The configuration and the index. | AiSearchStatus |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The caller is not a superuser. | ErrorResponse |
| 500 | The index could not be read. | ErrorResponse |
/api/ai-search/index/tick Bearer tokenTick the AI search index (cron)
Called hourly by the deployment's cron (`vercel.json`). Resumes a run a previous tick left unfinished; otherwise starts an incremental pass over the sources changed since the last completed run, within one invocation's time budget. Answers `disabled` while no embedding provider is configured. Authenticated by the deployment's `CRON_SECRET` as a bearer token, not by an OIDC access token.
Responses
| Status | Description | Body |
|---|---|---|
| 200 | What the tick did. | SearchIndexTickResult |
| 401 | The cron secret is missing or wrong. | ErrorResponse |
| 500 | The tick failed part-way; the next tick resumes the run. | ErrorResponse |
/api/ai-search/index/run Bearer tokenIndex now, or rebuild the index
Starts an indexing run outside the schedule and processes as much of it as one invocation's time budget allows; a larger index is finished by the hourly tick. `incremental` (the default) embeds the sources changed since the last completed run; `full` walks every source — what to do after switching embedding model, since it also drops the previous model's chunks. An unfinished earlier run is resumed instead of starting another, and while another invocation is still working on one the answer is `busy` with nothing started. Superusers only.
| Field | Type | Required | Description |
|---|---|---|---|
| mode | string | no | `incremental` (the default) or `full`. one of "incremental" | "full" · defaults to "incremental" |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | The run, with how far it got. | SearchIndexTickResult |
| 400 | The mode is not `incremental` or `full`. | ErrorResponse |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The caller is not a superuser. | ErrorResponse |
| 500 | The run failed part-way; the next tick resumes it. | ErrorResponse |