Skip to content

AI mode and prompt budgets

AI mode is an owner-controlled, app-scoped analytics surface. It is optional: disabling it does not change collection, dashboards, exports, or the public SDK.

The current phase implements authentication, authorization, quota accounting, and transport. It does not call a model or return generated analysis yet. Prompt requests return 501 Not Implemented after authentication and app authorization. They do not consume allowance or create billing usage.

total_prompts is provisioned by the plan or server operator. An app owner can see it but cannot increase it through the allocation request.

Owners choose one allocation mode:

  • fluid: every enabled member draws from the shared app remainder.
  • equal: each enabled member receives floor(total / enabled members); an integer remainder stays unallocated.
  • custom: the owner assigns an explicit non-negative allowance per member, with a combined maximum no larger than the app total. The owner can assign their own allowance to zero.

When generated analysis is implemented, the app total and member allowance will be enforced atomically. A prompt is rejected if AI is disabled, the member has no access, the app pool is exhausted, or a non-fluid member allowance is exhausted.

GET /v1/sites/{siteId}/ai
PUT /v1/sites/{siteId}/ai
POST /v1/sites/{siteId}/prompt

The owner update body is:

{
"enabled": true,
"allocation_mode": "custom",
"members": [
{
"user_id": "user-id",
"ai_access": true,
"allocated_prompts": 250
}
]
}

The prompt body is { "prompt": "..." }. The current response is 501 Not Implemented; a future successful response will return the remaining app and member counts; it intentionally contains no generated answer in this phase.