Quickstart
Sapienic is one Node process: the site, the consoles, the REST API and the MCP server share a port and a database. The hosted service is https://sapienic.ai; run your own copy with the steps below. Every address on this page works on either: replace http://localhost:4600 with https://sapienic.ai.
-
Start the server. From the project folder, with Node 24 or later:
It prints the Site, Console, Docs and MCP addresses. By default that isTerminal
npm starthttp://localhost:4600. WithoutAISO_ROOTset, only the simulated engine is available.sapienic_statussays which engine a server has; for now sapienic.ai runs simulated only, and real Snapshot runs happen on a server that has the engine. -
Open the Console at
/console. -
Claim the staff account. The first visit asks you to create the owner account. Claiming only works from the machine the server runs on (localhost), so nobody else on the network can get there first. A hosted server with no local browser (a container) is claimed once with its
CLAIM_TOKENsecret:POST /api/v1/auth/claimwith{ "email", "password", "claim_token" }. -
Create an API key under Agents & API. Keys start with
sk_sap_and are shown once; only a hash is stored. Keys are managed in the Console only (staff), so a key cannot mint more keys. Businesses using the Workspace don’t get API keys; their pages call the workspace API with a session cookie. -
Connect an agent or call the API. See MCP or the REST API. Rehearse with
"engine": "simulated"first; it makes no paid calls.
Concepts
Clients
A client is one business you track, addressed by its slug (for example kayak_tours). It has two parts:
- Profile
- Name, website, industry, products and services, geography, operating model, competitors, target customer and unique value. Written once when the client is created and fixed afterwards.
- Brief
- Current goals, focus areas and competitive context. Replace it any time with
PUT /clients/:slug/brief. It is used to rank questions, so re-run setup after changing it.
website, autopilot and archived can be changed with PATCH /clients/:slug.
Runs and stages
A run executes one or more stages, in order. Runs wait in a queue and MAX_CONCURRENT_RUNS run at once (default 1).
| Stage | What it does | When |
|---|---|---|
| setup | Builds the ranked question bank: questions across the seven types, scored for buying intent, Google Trends popularity and a CPC proxy, then ranked by AI. | Once per client, and after the brief changes. |
| collect | Asks every selected engine the top questions in each type (per_group, default 10), with an optional follow-up turn. | Every snapshot. |
| analyze | Scores visibility, share of voice, sentiment, citations and gaps, and saves a report. | Every snapshot. |
Status moves from queued to running and ends as succeeded, failed or canceled. A run interrupted by a restart is marked failed so the queue keeps moving. Setup options: resume (skip finished phases, default true), dry_run (estimate cost only), templates_per_group and top_questions.
Engines
aiso- The real Python engine. Makes paid API calls to OpenAI, Anthropic, Perplexity and Google. Needs
AISO_ROOTand provider keys;sapienic_statusreports which providers are ready. simulated- Free and synthetic. Makes no calls and produces clearly labeled data, for rehearsing workflows and testing agents. Simulated reports are flagged
simulated: true.
If a run does not name an engine, it uses aiso when available for that client and simulated otherwise.
Reports and the visibility score
Every analyze stage saves a report, one snapshot in the client’s history. A report contains the visibility score, share of voice against competitors, sentiment (0–10), breakdowns by engine and by question type, gaps (high-intent questions where competitors are named and the client is not), listing opportunities, cited sources, drafted observations and history.
The AI visibility score is the percentage of answers to unbranded questions that name the client. Only G1 and G4–G7 count, so questions that already name a business cannot inflate it.
| Group | Question type | In score |
|---|---|---|
| G1 | Category & local discovery (unbranded) | Yes |
| G2 | Direct brand | No |
| G3 | Competitors & alternatives | No |
| G4 | Transactional / bottom funnel | Yes |
| G5 | Trust, reviews & risk | Yes |
| G6 | Fit, persona & occasion | Yes |
| G7 | Head-to-head choice | Yes |
When the score moves five points or more between snapshots, the activity feed records an alert.
Schedules
A schedule puts a client on autopilot. It queues runs daily, weekly or monthly at hour (0–23, server local time), on weekday for weekly (0 = Sunday) or monthday for monthly (1–28). The default stages are collect and analyze, which re-ask the existing question bank. Pause one with PATCH /schedules/:id and { "enabled": false }. A schedule with "task": "site" rebuilds the client’s website instead of queuing a run.
Websites
Sapienic can build a client’s website and keep it current. mode is site (a complete static website: home, services, about, FAQ and contact pages, llms.txt, a robots.txt that welcomes AI crawlers, sitemap.xml and schema.org data, with no JavaScript or third-party requests, a strict security policy on every page and a _headers file for hosts that read one) or kit (llms.txt, an FAQ page, structured data and AI crawler rules for the website the client already has; it never includes a home page). Pages come from the profile and the latest report. Each new report adds up to 4 of its gap questions to the FAQ, up to max_faq. Copy starts from templates; rewrite any block and later rebuilds keep it.
A build that changes anything goes live at once as a new numbered version, with a list of what changed; a build that changes nothing makes no version. Sites rebuild after every new report (auto_update) and on task: "site" schedules. Any version can be restored with the copy and settings it was built from. Sites stay inside Sapienic: a private preview and a .zip download.
Businesses can also build their own: /websites/build creates their account and a website draft, which they edit in the client app and send for review. Drafts never touch the live site. With STRIPE_PRICE_WEBSITE set, a self-service business pays once before its first draft reaches review; otherwise staff record the invoice first. Staff approve (only the customer’s changes are applied, on top of the live site) or send it back with a note.
Business modules
Beyond AI visibility, Sapienic runs the day-to-day of each business. Every module works per workspace: pass client=<slug> for a client, or leave it out for Sapienic’s own. Each has REST routes under its prefix, MCP tools (listed in the tool reference), triggers and actions for automations, and a section in the daily brief. Each works with a simulated provider until a real one is configured, so nothing costs money or reaches an outside service by default.
| Module | REST prefix | What it covers |
|---|---|---|
| Automations and the daily brief | /api/v1/automations | Rules, recipes, the run log and the brief (?format=md). Today page in the Console. |
| Business phone | /api/v1/phone | Numbers and routing, calls, voicemail, transcription queue, click-to-call and the simulator. Signed webhooks for SignalWire and other switches. |
| Invoicing and books | /api/v1/finance | Invoices, payments, recurring invoices, expenses, vendors, catalog, tax rates, reports and CSV exports. Hosted invoices at /invoice?t=. |
| Orders and inventory | /api/v1/orders | Sales orders, stock and movements, purchase orders, counts, reports. |
| Tax | /api/v1/tax | Profile and registrations, the deadline calendar, filings, sales tax worksheets, nexus, 1099s, estimates and the sourced rules. |
| Market watch | /api/v1/watch | Competitors, tracked pages, checks, changes, trends and the market brief (/watch/brief.md). |
| Domains | /api/v1/domains | Search, prices, orders, domains, DNS records and presets, renewals and settings. |
| Client app | /api/v1/app | The client app’s own API, signed in with an app session. Staff manage access under /api/v1/app/admin. |
| Data pool | /api/v1/pool | The combined contacts and companies across CRMs, and benchmarks. |
| Business email | /api/v1/email | Domains, mailboxes, threads filed in the CRM, sending and replies, DNS checks and signed inbound webhooks. |
| Shipping | /api/v1/shipping | Packages, tracking, purchases read from order emails, carrier rates and labels, and spending. |
| Payments (Stripe Connect) | /api/v1/connect | Each business’s own Stripe account, Payment Links for its website and Pay now on invoices. |
Workspace modules. The modules businesses use in the Workspace (/workspace) and the phone app live under /api/v1/app/… and are signed in with the workspace session, limited by the person’s role. They are not reachable with an API key and have no MCP tools yet: get-started trials, profile and two-step verification, company registration details, business lookup, people, roles, payroll (Gusto, Finch), bank and card feeds (Teller, Mercury, Ramp), tax return import, quotes and pricing, growth, website analytics, ad spend (Google Ads, Meta), DNS hosting, review requests, website chat, the brand guide, data export, the partner website check and Sapi.
MCP server
The MCP server lets an agent run the platform: create clients, launch runs, wait on them, read reports and raw answers, write notes and set schedules, and work every business module that has tools (CRM, websites, automations, phone, email, finance, orders, tax, market watch, domains, shipping, payments, the client app and the data pool). Its instructions, sent on connect, describe each module.
- Endpoint
POST https://sapienic.ai/mcp(hosted) orPOST http://localhost:4600/mcp(your own server)- Transport
- Streamable HTTP, stateless, JSON responses
- Auth
Authorization: Bearer sk_sap_…, an API key from the Console. A missing or unknown key gets401.
A typical session: list_clients or create_client, then run_pipeline, then get_run with wait_seconds until it finishes, then get_report, add_note with observations and schedule_runs for ongoing monitoring.
Claude Code
claude mcp add --transport http sapienic https://sapienic.ai/mcp \
--header "Authorization: Bearer sk_sap_…"
Any client that supports remote Streamable HTTP servers with custom headers can connect to /mcp the same way. For your own server, use http://localhost:4600/mcp.
Claude Desktop and other clients
For clients that only launch local processes, use the stdio bridge. It forwards every message to the running server, so there is still one runner and one database. Replace /path/to/sapienic with the absolute path to this project; Node 24 or later must be on the client’s PATH.
{
"mcpServers": {
"sapienic": {
"command": "node",
"args": ["/path/to/sapienic/src/mcp-stdio.ts"],
"env": {
"SAPIENIC_URL": "https://sapienic.ai",
"SAPIENIC_API_KEY": "sk_sap_…"
}
}
}
}
For your own server, set SAPIENIC_URL to http://localhost:4600. To try the bridge by hand: SAPIENIC_URL=http://localhost:4600 SAPIENIC_API_KEY=sk_sap_… npm run mcp:stdio.
Tool reference
Read live from GET /api/v1/meta/tools (public, no key needed), so it always matches this server.
Loading the tool reference…
Prompts
| Prompt | Arguments | What it does |
|---|---|---|
| visibility_ | client, engine? | Runs a full audit (setup if needed, collect, analyze), reads the gaps, and saves plain-language observations and the three most valuable next actions as a note. Suggests a monthly schedule and asks before creating it. |
| monthly_ | client | Compares the newest snapshot with the previous one and saves a short Monthly Notes entry: what changed, what we noticed, what is worth attention. |
| summarize_ | activity_id | Reads a logged call or meeting transcript, saves a short summary on it, and creates a follow-up task for each next step someone agreed to. Asks before moving the deal. |
| pipeline_ | client? | Reviews a CRM pipeline: stalled deals, overdue follow-ups and one next step per deal. Changes nothing. |
| website_ | client | Replaces a website’s template copy with plain-language copy built only from the profile, brief, report and notes, in one edit_site_content call, then lists what still needs facts from the client. |
| run_my_ | client? | Reads today’s business brief and works through it with the available tools, logging what it did and asking before anything that spends money or contacts a customer. |
| return_ | client? | Goes through missed calls and voicemails nobody has called back, and plans the callbacks. |
| market_ | client? | Writes the market brief’s narrative for the owner, saves it, and proposes what to do about competitors this week. |
| collections_ | client? | Reviews overdue and soon-due invoices and drafts polite follow-ups. Nothing is sent without asking. |
| month_ | client?, month? | Checks a month’s books for gaps, summarizes profit and loss, and prepares the accountant’s exports. |
| restock_ | client? | Reviews low stock and overdue purchase orders, then drafts reorders for approval. |
| ship_ | client? | Goes through orders waiting to ship: what can ship now, what’s short, what’s late. |
| tax_ | client? | Reviews the next 30 days of tax deadlines, anything missed, nexus warnings and 1099 prep, and suggests what to do. |
| prep_ | client?, year? | Lists vendors who need a 1099-NEC for a year and what’s missing, ready to hand to an accountant. |
| inbox_ | client? | Triages the inbox: what needs a reply, draft replies, new senders and junk. Asks before sending anything to a customer. |
| packages_ | client? | What’s arriving and going out today, and anything stuck. |
| onboard_ | lead_id, engine? | Turns a website snapshot order into a client and runs its first snapshot. |
Resources
| URI template | Type | Contents |
|---|---|---|
| sapienic:// | text/markdown | Latest AI visibility report as markdown. Listed for every client. |
| sapienic:// | text/plain | Draft llms.txt for the client’s website. |
REST API
Everything the MCP server does is also available over HTTP at /api/v1. Requests and responses are JSON unless noted. Creating something returns 201.
Authentication
Send an API key on every request:
Authorization: Bearer sk_sap_…The Console itself signs in with a session cookie; scripts and agents should use a key. GET /api/v1/meta/tools is the only public endpoint.
Errors
Errors use the HTTP status code and a JSON body:
{ "error": { "code": "bad_request", "message": "client slug is required" } }| Status | Codes you may see |
|---|---|
| 400 | bad_request |
| 401 | unauthorized |
| 403 | forbidden |
| 404 | not_found |
| 405 | method_not_allowed |
| 409 | conflict, engine_unavailable, no_providers, not_cancelable |
| 413 | too_large |
| 500 | internal |
Endpoints
Paths are relative to the server, for example http://localhost:4600/api/v1/clients.
| Method | Path | Description |
|---|---|---|
| Workspace | ||
| GET | /api/v1/status | Engine availability, provider keys, queue depth and counts. |
| GET | /api/v1/overview | Status, average visibility, every client, recent runs and schedules. |
| POST | /api/v1/sync | Re-scan the engine’s clients folder and import new profiles and collections. |
| GET | /api/v1/activity?client=&limit= | Activity feed: runs, alerts, notes, schedule changes. |
| GET | /api/v1/meta/tools | MCP tool definitions. Public. |
| Clients | ||
| GET | /api/v1/clients | Every client with its latest score, trend and last run. |
| POST | /api/v1/clients | Create a client. Same fields as the create_client tool. |
| GET | /api/v1/clients/:slug | Profile, brief, schedules, recent runs and notes. |
| PATCH | /api/v1/clients/:slug | Change website, autopilot or archived. |
| PUT | /api/v1/clients/:slug/brief | Replace the brief: { "brief": "…" }. |
| POST | /api/v1/clients/:slug/notes | Add a note: { "body": "…", "author": "…" }. |
| Results | ||
| GET | /api/v1/clients/:slug/report?report_id= | Latest report, or a specific one, as JSON. |
| GET | /api/v1/clients/:slug/report.md | The same report as markdown. |
| GET | /api/v1/clients/:slug/answers?q=&provider=&group=&mentions=client|missing|any&limit=&offset= | The raw AI answers. missing means unbranded answers that leave the client out. |
| GET | /api/v1/clients/:slug/questions?group=&limit= | The ranked question bank with intent, popularity and CPC-proxy scores. |
| GET | /api/v1/clients/:slug/llms.txt | Draft llms.txt, as plain text. |
| Runs | ||
| POST | /api/v1/clients/:slug/runs | Queue a run. See Start a run. |
| GET | /api/v1/runs?client=&status=&limit= | Recent runs, newest first. |
| GET | /api/v1/runs/:id?tail= | One run with per-stage progress and the last tail log lines. |
| POST | /api/v1/runs/:id/cancel | Cancel a queued or running run. |
| GET | /api/v1/runs/:id/stream | Server-sent events for one run: run, log. |
| GET | /api/v1/stream | Server-sent events for the workspace: run, activity. |
| Schedules | ||
| GET | /api/v1/schedules | Every schedule and when it runs next. |
| POST | /api/v1/clients/:slug/schedules | Create a schedule (body below). |
| PATCH | /api/v1/schedules/:id | Pause, resume or change cadence. |
| DELETE | /api/v1/schedules/:id | Remove a schedule. |
| Leads | ||
| POST | /api/v1/leads | Public: the website's order and contact forms post here. kind is snapshot or sales. Rate-limited per IP. With Stripe configured, a snapshot order’s response also carries checkout_url, a Stripe Checkout page to send the customer to. |
| GET | /api/v1/leads?status=&kind=&limit= | The leads inbox, newest first. |
| GET | /api/v1/leads/:id | One lead with every submitted field. |
| PATCH | /api/v1/leads/:id | Set status (new, contacted, qualified, won, lost, spam) or client_slug. |
| POST | /api/v1/leads/:id/checkout | Public: reopen checkout for an unpaid snapshot order (the cancel page’s “Return to checkout”). Returns { checkout_url }, or { paid: true }. |
| CRM | ||
Every CRM call takes client (a client slug, in the query string or the body) for that client’s own CRM. Leave it out for Sapienic’s own sales pipeline. Records never link across workspaces. Amounts are in cents. | ||
| GET | /api/v1/crm?client= | Pipeline stages with deal counts and amounts, open and overdue tasks, calls in the last 30 days, recent timeline entries, and every CRM workspace. |
| GET | /api/v1/crm/stages?client= | The workspace’s pipeline stages, in order. Each has an outcome: open, won or lost. |
| PUT | /api/v1/crm/stages | Replace the stages: { client?, stages: [{ id?, name, outcome? }] }. Keep an id to rename or reorder; stages left out are deleted, which is refused while deals are in them. |
| GET | /api/v1/crm/{companies|contacts|deals|tasks|activities} | List, with client, q and limit. Deals filter by status, stage, company_id, contact_id; tasks by status (open, done, all) and due (overdue, today, week); activities by kind and the linked record. |
| POST | /api/v1/crm/{companies|contacts|deals|tasks|activities} | Create one. A deal’s stage is a stage name or ID. An activity’s kind is note, call, meeting or email; a call without contact_id is matched to a contact by phone number. With provider and external_id it’s idempotent, so a phone system can post a call, then post it again with the transcript. |
| GET | /api/v1/crm/{type}/:id | One record with its related records, tasks and timeline. |
| PATCH | /api/v1/crm/{type}/:id | Change the fields you send. Move a deal with stage; finish a task with done: true; add a call’s summary. |
| DELETE | /api/v1/crm/{type}/:id | Delete permanently. Linked records stay and lose the link. |
| POST | /api/v1/tester/tests | Public: the website tester. { url } → the verdict (good, work, rebuild, unreachable or blocked), a 0–100 score, the main reasons, every check by group, the contact details the site lists, and the next step. A site that lists a phone or email becomes a website_test lead. Rate-limited per IP; the same address within 10 minutes returns the stored result. |
| GET | /api/v1/tester/tests/:id?wait= | Public: one test result. With wait (up to 30 seconds), waits for Google PageSpeed’s scores while pagespeed.status is running. |
| POST | /api/v1/tester/tests/:id/quote | Public: the results page’s quote form (name, email, optional phone, message). Puts the visitor on the site’s lead and sends lead.quote_requested. |
| GET | /api/v1/tester/tests?limit= | Recent website tests, newest first, with their lead. |
| POST | /api/v1/leads/:id/crm | Add a website lead to Sapienic’s pipeline as a company, contact and deal. Safe to repeat (created: false the second time). |
| Websites | ||
| GET | /api/v1/clients/:slug/site | The website: mode, settings, live version and history, every copy block (current text, template, rewritten or not), FAQ, waiting questions, listings to-do and schedules. site is null before one is built. |
| POST | /api/v1/clients/:slug/site | Create and build it: { mode?, auto_update?, settings? }. Settings: base_url, phone, email, address, hours, booking_url, industry (a business type preset such as plumber, spa or bakery; null detects it), accent, profiles, max_faq. |
| PATCH | /api/v1/clients/:slug/site | Change mode, settings or auto_update, then rebuild. |
| PATCH | /api/v1/clients/:slug/site/content | { blocks?: { key: text | null }, add_questions?, remove_questions? }, then rebuild. null returns a block to the template; removed questions aren’t added back. |
| POST | /api/v1/clients/:slug/site/build | Rebuild now. build.changed is false when nothing changed. |
| POST | /api/v1/clients/:slug/site/rollback | Make { version } live again, with its copy and settings, as a new version. |
| GET | /api/v1/clients/:slug/site/files?path=&version= | One generated file as JSON. |
| GET | /api/v1/clients/:slug/site/download?version= | The version as a .zip. |
| GET | /api/v1/clients/:slug/site/preview/:version/… | Private preview of current or a version number, with relative links that work under it. |
| DELETE | /api/v1/clients/:slug/site | Delete the website, every version and its schedules. |
| GET | /api/v1/site-reviews | Customers’ website drafts: sent for review first, then awaiting payment, changes requested and still editing. |
| GET | /api/v1/clients/:slug/site/draft | A customer’s draft: status, what changes compared with the live site, details, copy blocks, questions and payment. Preview it under /site/draft-preview/. |
| POST | /api/v1/clients/:slug/site/review | { action, note? }: approve (it goes live; self-service businesses must have paid), request_changes (the note is required and the customer sees it) or mark_paid (record an invoice). |
| POST | /api/v1/websites/signup | Public, from /websites/build only (same origin, rate-limited): creates the business, its owner account in the client app and a website draft, and signs them in. |
| Payments | ||
| POST | /api/v1/stripe/webhook | Stripe events, verified with STRIPE_WEBHOOK_SECRET against the raw body. Snapshot orders: checkout.session.* sets the lead’s payment_status. Plans: checkout.session.*, customer.subscription.updated/deleted and invoice.paid/payment_failed set the billing account’s status; charge.dispute.created, charge.refunded and radar.early_fraud_warning.created are flagged in the activity feed. Each event is processed once. Returns 503 while Stripe isn’t configured. |
| POST | /api/v1/billing/checkout | Public: the /signup form. plan is autopilot, agency or bureau; returns checkout_url. 503 plan_unavailable until that plan’s prices (and Metronome, for usage plans) are set. |
| GET | /api/v1/billing | Plans, what each still needs, billing accounts, their clients and this month’s usage. |
| POST | /api/v1/billing/accounts/:id/clients | Bill a client to an account ({ "client": slug }). For agencies this records one client_added. |
| DELETE | /api/v1/billing/accounts/:id/clients/:slug | Stop billing a client to that account. |
| POST | /api/v1/billing/accounts/:id/provision | Retry usage-billing setup: default card, Metronome customer and contract. |
| POST | /api/v1/billing/usage/flush | Send waiting usage to Metronome now (it’s also sent every minute). |
Run body
Every field is optional. Leave out stages to run all three.
{
"stages": ["setup", "collect", "analyze"],
"engine": "aiso",
"options": {
"per_group": 10,
"providers": ["openai", "claude"],
"followup": "Rank the businesses you mentioned.",
"resume": true,
"dry_run": false,
"templates_per_group": 150,
"top_questions": 75
}
}
engine"aiso"(real, paid) or"simulated"(free, synthetic).per_group- Collect: top questions asked per question type. Default 10.
providers- Collect: a subset of
openai,claude,perplexity,gemini. followup- Collect: a second turn sent after each answer.
nulldisables it. resume- Setup: skip phases already done. Default true.
dry_run- Setup: estimate cost only, make no API calls.
templates_per_group,top_questions- Setup: how many question templates to generate per type, and how many ranked questions to keep.
Schedule body
{
"cadence": "weekly",
"hour": 9,
"weekday": 1,
"monthday": 1,
"stages": ["collect", "analyze"],
"engine": "aiso"
}
cadence is daily, weekly or monthly. weekday applies to weekly schedules and monthday to monthly ones.
Start a run
Queue a free rehearsal run, then check on it:
export SAPIENIC_API_KEY=sk_sap_…
curl -X POST http://localhost:4600/api/v1/clients/kayak_tours/runs \
-H "Authorization: Bearer $SAPIENIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"stages":["collect","analyze"],"engine":"simulated","options":{"per_group":10}}'
# The response is the queued run. Use its "id":
curl -H "Authorization: Bearer $SAPIENIC_API_KEY" \
"http://localhost:4600/api/v1/runs/RUN_ID?tail=20"
Streaming
Both streams are server-sent events. The run stream sends the run first, then its log so far, then live updates until you disconnect.
curl -N -H "Authorization: Bearer $SAPIENIC_API_KEY" \
http://localhost:4600/api/v1/runs/RUN_ID/stream
event: run
data: {"id":"RUN_ID","status":"running",…}
event: log
data: {…}
Webhooks
Set SAPIENIC_WEBHOOK_URL and Sapienic will POST to it whenever a run finishes. report is null when the run produced no report (for example a setup-only run or a failure). Delivery times out after 10 seconds; failures are recorded in the activity feed.
{
"event": "run.succeeded",
"run": {
"id": "…",
"client": "kayak_tours",
"status": "succeeded",
"stages": ["collect", "analyze"],
"engine": "aiso",
"error": null,
"finished_at": "…"
},
"report": { "id": "…", "visibility": 25.4, "simulated": false }
}
event is one of run.succeeded, run.failed or run.canceled. New website leads send { "event": "lead.created", "lead": { … } } to the same URL, which is an easy way to post them to Slack or a CRM. A snapshot paid online sends { "event": "lead.paid", "lead": { … } } once. A visitor who asks for a quote from the website tester’s results sends { "event": "lead.quote_requested", "lead": { … } }. A new website version sends { "event": "site.updated", "site": { client, version, mode, cause, changes, download_url } }, which a deploy script can use to publish it.
Configuration
Set these as environment variables, or in a .env file in the project root, which is loaded at startup.
| Variable | Default | Purpose |
|---|---|---|
| PORT | 4600 | HTTP port. |
| HOST | 127.0.0.1 | Interface to listen on. Keep the default unless the server sits behind a proxy you trust. |
| PUBLIC_URL | http:// | The address people and agents use to reach the server. |
| DATA_DIR | ./data | Where the database and run files are kept. |
| AISO_ROOT | unset | Path to the Python engine repo. Without it, only the simulated engine runs. |
| AISO_PYTHON | auto | Python interpreter for the engine. Defaults to the engine’s virtualenv if found, else python3. |
| MAX_ | 1 | How many runs execute at once. The rest wait in the queue. |
| SAPIENIC_ | unset | Receives a POST when a run finishes. See Webhooks. |
| STRIPE_ | unset | Stripe API key for online snapshot payment. Prefer a restricted key (rk_…) with Checkout Sessions write access. Payment is on only when all three STRIPE_* settings are set. |
| STRIPE_ | unset | Signing secret (whsec_…) of the webhook endpoint pointing at /api/v1/stripe/webhook. |
| STRIPE_ | unset | Price ID (price_…) of the one-time snapshot. |
| STRIPE_ | unset | Autopilot’s one-time setup price and monthly recurring price. Both set: Autopilot is sold at /signup. |
| STRIPE_ | unset | One-time setup prices for agency workspaces and member programs (usage is billed by Metronome). |
| METRONOME_ | unset | Metronome token for usage billing. A sandbox token reaches only sandbox data. |
| PAGESPEED_ | unset | Google PageSpeed Insights key. When set, each website test also runs Google’s mobile speed test and its scores join the result. Free; the tested address is sent to Google. |
| METRONOME_ | unset | The rate card contracts use; node tools/metronome-setup.ts creates it. |
| TRUST_ | unset | Set to 1 behind a reverse proxy so rate limits see the real visitor address. |
| CLAIM_ | unset | One-time secret that lets a hosted server’s staff account be claimed without localhost. Unset: only localhost can claim. |
Every other setting (Sapi’s models, phone, email, domains, payroll, bank feeds, ad spend, Turnstile and more) is described in .env.example. Each provider stays simulated or off until its settings are present.