Shop Context for Optimised Understanding & Targeting
Operator access
Sign in to review gateway usage and configuration. Details are available after authentication.
Welcome back
Sign in with your Google account to continue.
SCOUT
Choose a tool to get started
Gateway
AI completions, spend tracking, feature registry, and activity logs.
Enrichment
Shop intelligence, storefront scanning, and store context builder.
Signals
Extracting meaningful marketing intelligence from the noise.
Dashboard
Spend and traffic for this gateway. Figures persist to disk (see below) and survive process restarts.
Spend by app
| App | Month | Spend | Budget | Requests |
|---|
Response cache
| App | Cached entries |
|---|
How it works
SCOUT sits between your Shopify apps and the language model: one place for auth, policy, spend tracking, and operator visibility.
Connecting an app with an AI coding agent
The full integration contract — gateway completions, feedback, and enrichment — lives in one markdown brief served from this host at /llms.txt. No MCP server needed: paste the prompt below into Claude Code, Cursor, or any coding agent and it can wire an app up end to end.
Request path
- An app calls POST /ai/complete with a Bearer gateway key. The key identifies the app; do not rely on an app field in the JSON body in production.
- The gateway validates the feature id, prompt, and optional storeId / storeContext, then applies rate limits (per minute, per shop per UTC day).
- For each feature, the model sees the feature’s base system prompt plus a shared gateway runtime block (UTC clock, domain rules, safety expectations). That suffix is built server-side and matches what you preview on the Features page.
- Responses may be served from cache (keys include the UTC calendar day so “today” does not go stale). Usage and cost are recorded for the current month and shown on the dashboard.
This portal
After email + password sign-in, operators can review spend by app, inspect the live feature registry and gateway runtime text, browse recent completion logs (with optional shop filter), and adjust gateway settings (per-app access, disabled built-ins, custom features).
Cost ledger, request log, portal settings, and shop-context snippets are persisted under GATEWAY_DATA_DIR (or the default data directory on the host).
Other interfaces
- Dashboard JSON — GET /dashboard/* with GATEWAY_DASHBOARD_KEY for automation and monitoring without the browser UI.
- Health — GET /health for load balancers and deploy health checks.
API docs
Short reference for integrators and operators. Base URL is your gateway host; all paths are from the server root.
Integrating with an AI coding agent?
GET /llms.txt serves a self-contained markdown brief covering everything below in agent-ready form — auth, request contracts, error handling, enrichment, and a verification checklist.
Public
GET /health
Liveness JSON: status, timestamp, uptime. No authentication.
GET /llms.txt
Agent integration brief as text/markdown. No authentication; contains no secrets (placeholders only).
AI completion (app keys)
POST /ai/complete — headers: Content-Type: application/json, Authorization: Bearer <GATEWAY_KEY_*>.
| Field | Required | Notes |
|---|---|---|
| feature | Yes | Registry id for the calling app (e.g. sku_generator). |
| prompt | Yes | User text; validated length and control characters. |
| storeId | No | Shop hostname, e.g. shop.myshopify.com. |
| storeContext | No | Extra string or JSON for the model; size-capped. |
| skipCache | No | Boolean; if true, bypass response cache. |
Typical success body includes text, usage, costUsd, model, cached, storeId, responseTruncated. Errors use HTTP 4xx/5xx with a JSON message / error where applicable.
Dashboard JSON
Prefix Authorization: Bearer <GATEWAY_DASHBOARD_KEY> on every request.
| Method | Path | Description |
|---|---|---|
| GET | /dashboard/spend | Spend for all apps. |
| GET | /dashboard/spend/:app | Spend for one app key. |
| GET | /dashboard/features | Feature registry metadata. |
| GET | /dashboard/features/:app | Features for one app. |
| GET | /dashboard/cache | Cache stats. |
| POST | /dashboard/cache/clear | Clear response cache. |
| GET | /dashboard/limits | Effective caps and rate limits. |
Portal session API
Browser clients use the session cookie set at login. JSON endpoints are under /api/portal (send cookies; credentials: include in fetch).
| Method | Path | Description |
|---|---|---|
| GET | /api/portal/status | Auth state and optional email. |
| POST | /api/portal/auth/login | Body: email, password. |
| POST | /api/portal/auth/logout | Clear session. |
| GET | /api/portal/overview | Spend summary (session). |
| GET | /api/portal/features | Features + gateway runtime tail (session). |
| GET | /api/portal/logs | Recent requests; query limit, storeId. |
| GET | /api/portal/data | Aggregate bundle for scripts (session). |
| GET | /api/portal/apps | Per-app gateway toggles + recent change log. |
| POST | /api/portal/apps | Create a new app. Body: id, name, businessUnitId, environment, monthlyBudgetUsd. Audited in app_change_log. |
| PATCH | /api/portal/apps/:app/budget | Body: monthlyBudgetUsd (number, 0 = no cap, ≤999999.99). Optional reason. Audited in app_change_log. |
| POST | /api/portal/business-units | Create a new BU. Body: id, name, anthropicKeyEnv, status. Audited in app_change_log. |
| POST | /api/portal/apps/:app | Flip gatewayEnabled on or off; audited in app_change_log. |
| POST | /api/portal/features/:key | Insert/update a feature row in Postgres (writes feature_change_log). |
| DELETE | /api/portal/features/:key | Hard-delete a feature; recorded in feature_change_log. |
| GET | /api/portal/features/:key/history | Audit history for one feature. |
| POST | /api/portal/ai/suggest-feature | Draft a feature definition with AI (session). |
| GET | /api/portal/logs/export | CSV export of activity (session). |
UI routes GET / (dashboard), /portal/how-it-works, /portal/api-docs, /portal/features, /portal/activity, and legacy GET /portal (redirects to /) serve the same single-page app.
Features
Registry entries below show the base system prompt for each capability. Every completion appends a shared gateway runtime block (UTC date/time, policies). Usage reflects the current calendar month.
Gateway runtime context
Concatenated after the per-feature prompt on each completion. UTC date and time below update live; the rest matches what the gateway appends server-side.
Per-feature prompts
Activity
Recent completion calls with prompt and response previews. Newest first; saved on disk (up to 500 entries).
Spend (last 30 days)
No completion activity in the last 30 days.
Spend by feature (month-to-date)
No completion activity this month.
Business units
One Anthropic API key per business unit. Each app inherits its BU’s key. Spend figures reflect the current calendar month.
Access
Portal users and the role each one has. Every grant, demotion, and removal is written to portal_users_change_log.