Private AI
Run AI tasks on the server with your own AI key (OpenAI, Anthropic, Groq, OpenRouter, Mistral or Cloudflare Workers AI). The owner sets up a workflow once: model, hidden instructions, the JSON schema the answer must match, and which private files it may read as knowledge. A run sends only case data and gets back only validated JSON; instructions and files never reach the browser. Site visitors cannot call it. Paid plans.
Endpoints (5)
Create a workflow, or change one (only send what changes; every change raises config_version). Owner only. A new workflow needs label, provider, model, instructions and output_schema. The key of the provider must be in the vault (see get-workflows: provider_status). output_schema is a JSON Schema subset (type, properties, required, additionalProperties, items, enum, minLength, maxLength, minimum, maximum, minItems, maxItems, title, description) with "type": "object" or "array" at the top; other keywords are refused, so everything you write is enforced. allowed_refs lists the private files a run may read: {"type":"gated_file","file_id":990}, {"type":"private_asset","slug":"library/a.json"} or {"type":"private_asset","prefix":"library/"}; an empty list allows none. Admin sessions can run workflows (allow_admin) and a determined admin could get the model to repeat its instructions through a text field, so keep secrets out of instructions. Next: run once to test.
| Field | Type | Required | Description |
|---|---|---|---|
workflow_key |
string | ✓ Yes | Short id, lowercase letters, digits, - and _. Example: "case-review". |
label |
string | No | Human-readable name. |
provider |
string | No | "openai", "anthropic", "groq", "openrouter", "mistral" or "cloudflare-workers-ai". |
model |
string | No | Model id of that provider, e.g. "gpt-4o-mini" or "claude-sonnet-4-5". |
instructions |
string | No | Hidden instructions for the model (max per platform bounds, default 20000 characters). Never returned to a run or an admin session. |
output_schema |
array | No | JSON schema (subset) the answer must match. |
allowed_refs |
array | No | Private files a run may read as knowledge. Replaces the whole list. |
max_case_bytes |
integer | No | Max size of case_packet as JSON. Default 20000. |
max_knowledge_bytes |
integer | No | Max bytes of all knowledge files of one run together. Default 100000. |
max_refs_per_run |
integer | No | Max knowledge refs per run. Default 10. |
max_output_tokens |
integer | No | Max length of one answer. Default 2000. |
temperature |
number | No | 0-1, default 0.2. Not applied for providers "openai" and "anthropic" (their newer models refuse it). |
repair_attempts |
integer | No | How often an answer that does not match output_schema is sent back to the model to fix (0-2). Default 1. |
daily_cap |
integer | No | Budget brake: max AI calls per day (UTC) for this workflow, repairs included. Default 100. |
allow_admin |
boolean | No | May admin sessions (wsa_) run this workflow? Default true. |
is_active |
boolean | No | false pauses the workflow; run then answers PRIVATE_AI_INACTIVE. |
All workflows of this project (or one, with workflow_key) with today's AI calls against daily_cap, plus defaults, platform bounds and the supported schema keywords. The owner also gets instructions, output_schema, allowed_refs and provider_status (is the provider key in the vault); an admin session does not.
| Field | Type | Required | Description |
|---|---|---|---|
workflow_key |
string | No |
Delete a workflow and its usage counter permanently. Owner only. The run log (metadata only, see list-runs) stays until the project is deleted. To pause instead, use set-workflow with is_active false.
| Field | Type | Required | Description |
|---|---|---|---|
workflow_key |
string | ✓ Yes |
Run a workflow on the server. Send case_packet (the data of this case, a JSON object) and optionally knowledge_refs (private files from the workflow's allowed_refs; the server reads them itself, UTF-8 text only). Returns result (JSON that matches output_schema), run_id, attempts, token_usage and metadata of the files used (type, id, sha256, bytes) - never their content or the instructions. Errors: PRIVATE_AI_OUTPUT_INVALID (no valid answer after the repairs; context.errors names the problems), PRIVATE_AI_PROVIDER_ERROR, PRIVATE_AI_DAILY_CAP, REF_NOT_ALLOWED, CASE_TOO_LARGE, KNOWLEDGE_TOO_LARGE. Every AI call counts for daily_cap. Owner, admin session (when allow_admin) and server flows; never site visitors.
| Field | Type | Required | Description |
|---|---|---|---|
workflow_key |
string | ✓ Yes | |
case_packet |
array | No | Required by the handler: the case data as a JSON object (may be empty). |
knowledge_refs |
array | No | List of refs, e.g. [{"type":"gated_file","file_id":990}, {"type":"private_asset","slug":"library/a.json"}]. |
The run log of this project, newest first: status (ok, output_invalid, provider_error, limited), error_code, attempts, sizes, files used (metadata), token usage, caller type. Never case data, file content or answers.
| Field | Type | Required | Description |
|---|---|---|---|
workflow_key |
string | No | |
status |
string | No | |
limit |
integer | No | 1-100, default 25. |
MCP Tool Names
When using this integration through an AI assistant (Claude, ChatGPT, Cursor, etc.), the endpoints are available as MCP tools:
| Endpoint | MCP Tool Name |
|---|---|
| set-workflow | private-ai_set_workflow |
| get-workflows | private-ai_get_workflows |
| delete-workflow | private-ai_delete_workflow |
| run | private-ai_run |
| list-runs | private-ai_list_runs |
Website