Customer intake API
POST /intake/chat accepts a public product-intake conversation without login.
This endpoint is being introduced with the front-page intake assistant; clients
must handle temporary unavailability during rollout. It has no account access,
private data access, tools, or ability to create resources.
A successful response is {"message":"..."} with one assistant reply and
Cache-Control: no-store. The request accepts 1–20 messages, each with role
user or assistant and 1–2,000 characters of text. The final message must be
from the user; whitespace-only messages and histories above 16,000 characters
are rejected. Replies are limited to 2,000 characters. Send conversation history
on each turn; this endpoint does not persist transcripts or create server sessions.
Messages are sent to the configured model provider to generate the reply.
Malformed histories receive 400; request bodies above 100 KiB receive 413.
Shared admission limits return 429 with Retry-After. Provider or admission
failures return 503 with a generic error; clients should retain their local
conversation and offer a manual retry. The server does not retry model calls.
The initial pilot admits at most 30 calls per socket peer in 10 minutes and 500 calls globally in a rolling 24-hour budget window, using existing Redis counters shared by server replicas. Proxy peers share their allowance; caller forwarding headers cannot select a different bucket. Redis failure prevents model execution. Hashed peer keys expire with their counters; transcripts and raw peer addresses are not written by this feature.
The model uses the existing server-only OPENROUTER_API_KEY and
BUILTIN_AGENT_MODEL configuration. Each call has a 25-second deadline, a
512-token output allowance, and a 32-KiB upstream response limit. Anonymous
callers cannot select a provider, model, system prompt, or tools. No credentials
are returned to the browser. Do not send secrets or sensitive personal details.
Homepage configuration
The Website intake settings are being introduced for the existing DreamLake
homepage. They control only whether intake is enabled and the public greeting;
this is not an arbitrary-organization chatbot or a configurable model prompt.
Only an active owner of the live fortyfive organization may read or change the
operator settings. Other organizations and their owners gain no control over the
global homepage. There is no new service, secret, database collection or migration.
GET /intake/config is anonymous and returns only:
Responses use Cache-Control: no-store. Existing unconfigured homepage settings
retain the original enabled state and greeting. A missing/deleted owner
organization, malformed persisted configuration or unavailable database fails
closed with 503, rather than silently reenabling intake. The visitor UI waits
for configuration before opening chat; a failed read offers a manual retry and
does not overwrite the browser's saved transcript.
Authenticated GET /intake/settings returns the same bounded fields after the
owner check. Authenticated PUT /intake/settings accepts exactly these settings:
The greeting is plain text, trimmed on save and limited to 300 characters. A
successful save returns the settings with the next revision. A stale revision
returns 409 (intake_settings_conflict); reload the saved settings before
editing again. Missing authentication returns 401; non-owners/inactive actors
are refused. The server updates only its websiteIntake organization metadata
entry, preserving unrelated metadata. Shared actor/organization write fences and
an in-transaction owner recheck prevent a stale authority check from authorizing
a write after membership or ownership changes.
Disabling intake is enforced by POST /intake/chat before admission/provider
spend: disabled configuration returns 503 (intake_disabled), and unavailable
configuration returns 503 (intake_config_unavailable). Already admitted/in-flight
replies may finish. Disabling does not erase local transcripts. Existing session
retention (30 days in this browser), optional/dismissible signup, provider limits,
server-only credentials and analytics content privacy are fixed behavior, not
operator-configurable permissions. The operator preview uses local sample
messages and makes no model request. The analytics link opens the existing
PostHog intake dashboard; a signup click is not a completed registration.
Deploy these API routes before the consuming settings/widget frontend. Existing
clients can continue using /intake/chat; the configuration defaults preserve
the prior behavior until an authorized owner saves a change. No operator write
or live model call is needed merely to verify the deployment's read contract.