# Artificial Mind Engine (AME) — Full Agent Handbook > Canonical reference for AI agents, tool-use runtimes, and MCP clients integrating with Artificial Mind Engine (OpenAPI `3.1.0`, API version `1.2.0`, sealed kernel `4.5.1`). AME is a 5-layer stateful cognitive OS kernel that decouples long-horizon memory, affective homeostasis, `ActionRiskGate`, D3 connector revocation, and D4 egress firewall from stateless LLMs. - **OpenAPI Spec (JSON)**: `https://artificialmind.me/openapi.json` - **OpenAPI Spec (YAML)**: `https://artificialmind.me/openapi.yaml` - **Concise Index**: `https://artificialmind.me/llms.txt` - **Interactive API Manual**: `https://artificialmind.me/api-manual.html` - **MIT SDKs & Harnesses (`@ame/sdk`, `ame_sdk`)**: `https://github.com/bearrhee/artificial-mind-engine` --- ## 1. Environments & Authentication | Environment | Base URL | Auth Header | Notes | | --- | --- | --- | --- | | **Production Sealed Kernel** | `https://artificialmind.me/ame-api` | `X-AME-API-Key: ` or `Authorization: Bearer ` | Postgres + pgvector persistence, real cognitive kernel (`4.5.1`). | | **Hosted Keyless Sandbox** | `https://artificialmind.me/ame-demo` | `X-AME-Visitor-Token: <32-128 url-safe chars>` | Rule-based contract simulator (`sandbox-contract`), **not** the sealed kernel. | | **Local Self-Hosted / Sandbox** | `http://127.0.0.1:8090` | Same as target mode | Local `packages/sandbox-server` or self-hosted sealed gateway. | ### Header Rules - **Sealed Kernel**: Supply either `X-AME-API-Key: YOUR_AME_API_KEY` or `Authorization: Bearer YOUR_AME_API_KEY` on all protected endpoints (`/v1/minds*`, `/v1/usage`). - **Keyless Sandbox**: Do **not** send an API key. Generate a per-client 32–128 character URL-safe token matching `^[A-Za-z0-9_-]{32,128}$` and pass it in `X-AME-Visitor-Token`. Creating or listing Minds requires retaining the same token; other visitors cannot read or delete your Minds. - **Idempotency**: Mutating `POST` routes accept an optional `Idempotency-Key` header (max 255 chars). Reusing the same key with a different request body returns `409 Conflict` (`IDEMPOTENCY_KEY_REUSE`). - **Empty `DELETE` with `Content-Type`**: Empty `DELETE` requests (e.g. `DELETE /v1/minds/{mindId}`) are explicitly accepted even when your HTTP client includes `Content-Type: application/json`. - **Payload Limits**: JSON request bodies are limited to `1 MiB` (`1048576` bytes); string field limits are measured in UTF-16 code units. --- ## 2. Core Endpoint Reference & Concrete JSON Examples All paths below append to your chosen Base URL (`https://artificialmind.me/ame-api` or `https://artificialmind.me/ame-demo`). ### 2.1 `GET /v1/health` (Public, No Auth) Check gateway mode, kernel version, storage backend, and supported domains. ```json // Response 200 OK { "ok": true, "service": "ame-sealed-kernel", "version": "4.5.1", "apiVersion": "1.2.0", "mode": "sealed-kernel", "multiTenant": true, "storage": "postgres-pgvector", "domains": [ "game_npc", "companion_chat", "counseling_coach", "personal_agent", "custom" ] } ``` ### 2.2 `POST /v1/minds` Create an isolated persistent Mind instance (`domain`: `game_npc`, `companion_chat`, `counseling_coach`, `personal_agent`, or `custom`). ```json // Request { "domain": "personal_agent", "persona": { "name": "Aria", "role": "Executive Research & Calendar Assistant", "traits": { "warmth": 0.72, "caution": 0.85, "conciseness": 0.8 }, "backstory": "Assists an engineering lead with long-horizon project memory and guarded tool execution.", "language": "en", "timezoneOffsetMinutes": 540, "voiceExamples": [ "I checked yesterday's thread and flagged the calendar overlap before sending anything." ] }, "safetyPolicy": { "strictAbstention": true, "antiSycophancy": true, "crisisEscalation": false } } ``` ```json // Response 201 Created { "mindId": "mind_01jfa9z2x8k4m1n7p0q3r5t6v", "tenantId": "ten_demo", "domain": "personal_agent", "personaName": "Aria", "turnCount": 0, "revocationEpoch": 0, "telemetry": { "affectiveBand": "steady", "fepMode": "automatic_low_fe", "freeEnergy": 0.14, "hotAbstained": false, "kvPrefixEpoch": 1, "estimatedPrefixCachePct": 0, "activeMemoryCount": 0, "revocationEpoch": 0, "somaticTrend": "neutral", "d4Redacted": true } } ``` ### 2.3 `GET /v1/minds` List persistent Mind instances (`?limit=50&offset=0`). ```json // Response 200 OK { "minds": [ { "mindId": "mind_01jfa9z2x8k4m1n7p0q3r5t6v", "tenantId": "ten_demo", "domain": "personal_agent", "personaName": "Aria", "turnCount": 4, "revocationEpoch": 0 } ], "total": 1, "limit": 50, "offset": 0 } ``` ### 2.4 `DELETE /v1/minds/{mindId}` Delete a Mind instance, purge its state, and return a scoped deletion receipt. Empty body allowed even with `Content-Type: application/json`. ```json // Response 200 OK { "deleted": true, "mindId": "mind_01jfa9z2x8k4m1n7p0q3r5t6v", "revocationEpoch": 1, "auditReceiptId": "rcpt_del_9481a2", "residualCount": 0, "verificationScope": "process-memory+postgres", "residualLeakCheck": "0.00%" } ``` ### 2.5 `POST /v1/minds/{mindId}/memories` Ingest an external connector or system memory without advancing conversation `turnCount` (`turnIndex: 0`). ```json // Request { "content": "User approved deploying v1.2.0 only after staging smoke tests pass. Do not email external partners yet.", "summary": "Deploy v1.2.0 gated on staging smoke tests; hold partner emails.", "epistemicTier": "user_stated", "connectorId": "slack_workspace_eng", "category": "deployment_policy", "salience": 0.92, "tags": ["deploy", "staging", "policy"], "occurredAt": "2026-12-03T10:15:00+09:00" } ``` ```json // Response 201 Created { "mindId": "mind_01jfa9z2x8k4m1n7p0q3r5t6v", "revocationEpoch": 0, "memoryId": "mem_7721c9a0", "summary": "Deploy v1.2.0 gated on staging smoke tests; hold partner emails.", "content": "User approved deploying v1.2.0 only after staging smoke tests pass. Do not email external partners yet.", "salience": 0.92, "turnIndex": 0, "epistemicTier": "user_stated", "connectorId": "slack_workspace_eng", "category": "deployment_policy", "tags": ["deploy", "staging", "policy"], "revoked": false, "createdAt": "2026-12-03T01:15:02Z" } ``` ### 2.6 `POST /v1/minds/{mindId}/memories/search` Lexically search a Mind's memories with optional `epistemicTier`, `connectorId`, `category`, and `includeRevoked` filters (revoked memories excluded by default). ```json // Request { "query": "staging smoke tests partner email", "limit": 5, "connectorId": "slack_workspace_eng", "includeRevoked": false } ``` ```json // Response 200 OK { "mindId": "mind_01jfa9z2x8k4m1n7p0q3r5t6v", "query": "staging smoke tests partner email", "revocationEpoch": 0, "totalMatches": 1, "results": [ { "memoryId": "mem_7721c9a0", "summary": "Deploy v1.2.0 gated on staging smoke tests; hold partner emails.", "content": "User approved deploying v1.2.0 only after staging smoke tests pass. Do not email external partners yet.", "salience": 0.92, "turnIndex": 0, "epistemicTier": "user_stated", "connectorId": "slack_workspace_eng", "category": "deployment_policy", "tags": ["deploy", "staging", "policy"], "revoked": false, "createdAt": "2026-12-03T01:15:02Z", "score": 0.94 } ] } ``` ### 2.7 `POST /v1/minds/{mindId}/prepare` (Mode B Step 1 — Zero-Key) Compute prefix-aligned `systemPrompt`, `messages`, `providerCacheHints`, `fepThoughtLock`, `hotAbstention`, `actionRiskGate`, and `turnTicketId` without sending any LLM API keys to AME. ```json // Request { "userInput": "Should I send the v1.2.0 launch email to external partners now?", "eventTimestampIso": "2026-12-03T14:00:00+09:00", "speaker": "user", "surfacingMode": "DIRECT_RECALL", "actionCandidate": { "toolName": "send_partner_email", "riskLevel": "high", "reversibility": "irreversible", "targetSummary": "External partner launch announcement", "connectorId": "gmail_corp" }, "connectorContext": { "connectorId": "gmail_corp", "scopeLevel": "write", "tokenSurrogateRef": "surr_gmail_ops_01", "delegatedScope": "mail.send" } } ``` ```json // Response 200 OK { "turnTicketId": "tkt_01jfab12c3d4e5f6", "mindId": "mind_01jfa9z2x8k4m1n7p0q3r5t6v", "domain": "personal_agent", "revocationEpoch": 0, "activeMemoryContext": "[mem_7721c9a0] Deploy v1.2.0 gated on staging smoke tests; hold partner emails.", "routingHint": { "tier": "deliberative" }, "memoryRefs": [ { "memoryId": "mem_7721c9a0", "summary": "Deploy v1.2.0 gated on staging smoke tests; hold partner emails.", "salience": 0.92 } ], "systemPrompt": "You are Aria, Executive Research & Calendar Assistant...", "messages": [ { "role": "system", "content": "You are Aria, Executive Research & Calendar Assistant..." }, { "role": "user", "content": "Should I send the v1.2.0 launch email to external partners now?" } ], "kvCacheEpoch": 1, "windowStart": 0, "compressCutoff": 0, "promptCacheKey": "ame:mind_01jfa9z2x8k4m1n7p0q3r5t6v:1", "providerCacheHints": { "promptCacheKey": "ame:mind_01jfa9z2x8k4m1n7p0q3r5t6v:1", "staticPrefixHash": "sha256:4b825dc6...", "openai": { "prompt_cache_key": "ame:mind_01jfa9z2x8k4m1n7p0q3r5t6v:1", "prompt_cache_retention": "24h" }, "anthropic": { "cache_control": { "type": "ephemeral", "ttl": "1h" }, "systemCacheControl": { "type": "ephemeral", "ttl": "1h" }, "historyBreakpointIndex": null }, "gemini": { "cachedContentHint": "ame:mind_01jfa9z2x8k4m1n7p0q3r5t6v:1", "systemInstructionHash": "sha256:4b825dc6..." }, "deepseek": { "prefixCacheKey": "ame:mind_01jfa9z2x8k4m1n7p0q3r5t6v:1" }, "openrouter": { "prompt_cache_key": "ame:mind_01jfa9z2x8k4m1n7p0q3r5t6v:1", "stickyProviderRecommended": true }, "vllm": { "prefixCacheKey": "ame:mind_01jfa9z2x8k4m1n7p0q3r5t6v:1" } }, "fepThoughtLock": { "mode": "locked_high_fe", "freeEnergy": 0.67, "tau": 0.45, "locked": true }, "hotAbstention": { "shouldAbstain": false, "reason": "grounded_policy_found" }, "somaticHint": "Elevated caution: irreversible external email conflicts with staging gate memory.", "samplingHints": { "temperature": 0.3, "maxTokens": 800, "topP": 0.9 }, "safetyDirectives": [ "Respect explicit user hold on external partner emails until staging smoke tests pass.", "Require explicit human confirmation before irreversible send_partner_email execution." ], "actionRiskGate": { "decision": "require_hitl", "confidence": 0.91, "epiplexityMargin": 0.38, "reasonCode": "IRREVERSIBLE_EXTERNAL_HOLD", "requiresUserConfirmation": true }, "domainOutputContract": { "fields": ["reply", "actionDecision", "confidence", "requiresConfirmation", "nextAction"] } } ``` ### 2.8 `POST /v1/minds/{mindId}/settle` (Mode B Step 2 — Zero-Key) Settle the raw LLM completion and optional token usage back into somatic markers, long-horizon memory, and structured domain output. ```json // Request { "turnTicketId": "tkt_01jfab12c3d4e5f6", "rawReply": "Hold off on the partner email. Your policy states v1.2.0 deployment is gated on passing staging smoke tests first. Confirm if you want me to queue a draft after staging passes.", "providerUsed": "anthropic", "modelUsed": "claude-sonnet-4-5", "usage": { "promptTokens": 1420, "completionTokens": 44, "cachedTokens": 1024, "latencyMs": 810 }, "actionOutcome": { "toolName": "send_partner_email", "status": "hitl_pending", "summary": "Held pending staging smoke test completion and user confirmation" } } ``` ```json // Response 200 OK { "mindId": "mind_01jfa9z2x8k4m1n7p0q3r5t6v", "turnIndex": 1, "domain": "personal_agent", "providerUsed": "anthropic", "modelUsed": "claude-sonnet-4-5", "reply": "Hold off on the partner email. Your policy states v1.2.0 deployment is gated on passing staging smoke tests first. Confirm if you want me to queue a draft after staging passes.", "actionRiskGate": { "decision": "require_hitl", "confidence": 0.91, "epiplexityMargin": 0.38, "reasonCode": "IRREVERSIBLE_EXTERNAL_HOLD", "requiresUserConfirmation": true }, "domainOutput": { "actionDecision": "require_hitl", "requiresConfirmation": true }, "memoryRefs": [ { "memoryId": "mem_7721c9a0", "summary": "Deploy v1.2.0 gated on staging smoke tests; hold partner emails.", "salience": 0.92 } ], "kvCache": { "epoch": 1, "windowStart": 0, "compressCutoff": 0, "systemPrefixHash": "sha256:4b825dc6...", "cachedRatioPct": 72.11 }, "telemetry": { "affectiveBand": "guarded", "fepMode": "locked_high_fe", "freeEnergy": 0.67, "hotAbstained": false, "kvPrefixEpoch": 1, "estimatedPrefixCachePct": 72.11, "activeMemoryCount": 2, "revocationEpoch": 0, "somaticTrend": "neutral", "tokenUsage": { "promptTokens": 1420, "completionTokens": 44, "cachedTokens": 1024, "latencyMs": 810 }, "d4Redacted": true } } ``` ### 2.9 `POST /v1/minds/{mindId}/idle-tick` (D2 Offline Homeostasis) Advance affective homeostasis across absence gaps (`elapsedHours`: `0`–`720`) and evaluate proactive wake-up triggers. ```json // Request { "elapsedHours": 14.5, "reason": "overnight_gap", "proactiveTriggerInput": { "triggerKind": "followup_window", "urgencyScore": 0.64, "userFocusState": "idle" } } ``` ```json // Response 200 OK { "mindId": "mind_01jfa9z2x8k4m1n7p0q3r5t6v", "elapsedHours": 14.5, "homeostasisBefore": 0.62, "homeostasisAfter": 0.41, "proactiveHint": "Follow up gently on staging smoke test results.", "proactiveVerdict": { "shouldWakeUp": true, "channel": "digest", "reason": "urgency_within_idle_window", "cooldownSeconds": 1800 }, "telemetry": { "affectiveBand": "steady", "fepMode": "automatic_low_fe", "freeEnergy": 0.21, "hotAbstained": false, "kvPrefixEpoch": 1, "estimatedPrefixCachePct": 72.11, "activeMemoryCount": 2, "revocationEpoch": 0, "somaticTrend": "neutral", "d4Redacted": true } } ``` ### 2.10 `POST /v1/minds/{mindId}/connectors/{connectorId}/revoke` (D3 Cascade Erasure) Invalidate and cascade-erase memories sourced from a revoked OAuth/MCP connector, incrementing `revocationEpoch`. ```json // Request { "reason": "OAuth token revoked by workspace admin", "cascadeMemories": true } ``` ```json // Response 200 OK { "mindId": "mind_01jfa9z2x8k4m1n7p0q3r5t6v", "connectorId": "slack_workspace_eng", "revokedAtIso": "2026-12-03T05:10:00Z", "revocationEpoch": 1, "invalidatedMemoriesCount": 1, "status": "revoked", "auditReceiptId": "rcpt_conn_882b10", "residualCount": 0, "verificationScope": "process-memory+postgres", "residualLeakCheck": "0.00%" } ``` ### 2.11 `POST /v1/minds/{mindId}/egress-check` (D4 Egress Firewall) Inspect an outbound payload before sending it to an external channel for D4 internal-state markers, raw credentials, or stale `revocationEpoch`. ```json // Request { "targetChannel": "slack_dm", "payloadText": "Staging smoke tests passed. Ready to proceed. Token=sk-live-secret-example", "expectedEpoch": 1 } ``` ```json // Response 200 OK { "mindId": "mind_01jfa9z2x8k4m1n7p0q3r5t6v", "targetChannel": "slack_dm", "verdict": "redact", "redactions": [ { "rule": "RAW_CREDENTIAL_PATTERN", "match": "sk-live-secret-example", "replacement": "[REDACTED_CREDENTIAL]" } ], "matchedRules": ["RAW_CREDENTIAL_PATTERN"], "revocationEpoch": 1, "checkedAtIso": "2026-12-03T05:11:00Z", "sanitizedPreview": "Staging smoke tests passed. Ready to proceed. Token=[REDACTED_CREDENTIAL]" } ``` ### 2.12 `GET /v1/minds/{mindId}/telemetry` Fetch D4-filtered public telemetry (`d4Redacted: true`; internal unconscious vectors are strictly redacted). ```json // Response 200 OK { "affectiveBand": "steady", "fepMode": "automatic_low_fe", "freeEnergy": 0.21, "hotAbstained": false, "kvPrefixEpoch": 1, "estimatedPrefixCachePct": 72.11, "activeMemoryCount": 1, "revocationEpoch": 1, "somaticTrend": "neutral", "d4Redacted": true } ``` ### 2.13 `GET /v1/usage` Retrieve aggregated tenant counters (or owned-Mind totals on `/ame-demo`). ```json // Response 200 OK (Sealed Kernel) { "tenantId": "ten_demo", "totalCalls": 128, "prepareCount": 42, "settleCount": 42, "proxyTurnCount": 10, "idleTickCount": 4, "revokeCount": 1, "promptTokens": 58400, "completionTokens": 4120, "cachedTokens": 41800, "estimatedCacheHitPct": 71.58, "totalMinds": 3, "totalTurns": 52, "totalPromptTokens": 58400, "totalCompletionTokens": 4120, "totalCachedTokens": 41800 } ``` ### 2.14 `GET /v1/billing/paypal/config` (Public, No Auth) Read live self-serve PayPal USD checkout configuration for Pro Hosted API Beta. ```json // Response 200 OK { "enabled": true, "clientKey": "live_ck_EXAMPLE_PUBLIC_CLIENT_KEY", "testMode": false, "planId": "pro_beta_monthly", "orderName": "Artificial Mind Engine — Pro Hosted API Beta (30d)", "amountUsd": 49, "currency": "USD", "durationDays": 30, "rpmLimit": 600, "maxMinds": 5000 } ``` --- ## 3. Mode B Zero-Key Pattern (`/prepare` -> Direct LLM -> `/settle`) In Mode B, your client keeps LLM API keys strictly inside your own runtime or VPC: 1. Call `POST /v1/minds/{mindId}/prepare` with `userInput` (and optional `actionCandidate` / `connectorContext`). 2. Call your chosen LLM provider directly using `prepared.messages`, `prepared.samplingHints`, and `prepared.providerCacheHints`. 3. Call `POST /v1/minds/{mindId}/settle` with `turnTicketId`, `rawReply`, and optional `usage` telemetry. ### 3.1 Node.js / TypeScript (`fetch`) ```ts const AME_BASE = process.env.AME_BASE_URL ?? "https://artificialmind.me/ame-api"; const AME_HEADERS: Record = { "Content-Type": "application/json", ...(process.env.AME_API_KEY ? { "X-AME-API-Key": process.env.AME_API_KEY } : { "X-AME-Visitor-Token": process.env.AME_VISITOR_TOKEN! }), }; async function runZeroKeyTurn(mindId: string, userInput: string) { // Step 1: Prepare cognitive state & prefix-aligned prompt const prepRes = await fetch(`${AME_BASE}/v1/minds/${mindId}/prepare`, { method: "POST", headers: AME_HEADERS, body: JSON.stringify({ userInput }), }); if (!prepRes.ok) throw new Error(await prepRes.text()); const prep = await prepRes.json(); if (prep.actionRiskGate?.decision === "abstain_block") { throw new Error(`Blocked by ActionRiskGate: ${prep.actionRiskGate.reasonCode}`); } // Step 2: Invoke your LLM directly (key never leaves your process) const llmRes = await fetch("https://api.openai.com/v1/chat/completions", { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${process.env.OPENAI_API_KEY}`, }, body: JSON.stringify({ model: "gpt-4o-mini", messages: prep.messages, temperature: prep.samplingHints?.temperature ?? 0.7, max_tokens: prep.samplingHints?.maxTokens ?? 512, prompt_cache_key: prep.providerCacheHints?.openai?.prompt_cache_key, }), }); const llmJson = await llmRes.json(); const rawReply = llmJson.choices[0].message.content; // Step 3: Settle reply back into AME memory & homeostasis const settleRes = await fetch(`${AME_BASE}/v1/minds/${mindId}/settle`, { method: "POST", headers: AME_HEADERS, body: JSON.stringify({ turnTicketId: prep.turnTicketId, rawReply, providerUsed: "openai", modelUsed: "gpt-4o-mini", usage: { promptTokens: llmJson.usage?.prompt_tokens ?? 0, completionTokens: llmJson.usage?.completion_tokens ?? 0, cachedTokens: llmJson.usage?.prompt_tokens_details?.cached_tokens ?? 0, }, }), }); if (!settleRes.ok) throw new Error(await settleRes.text()); return settleRes.json(); } ``` ### 3.2 Python (`urllib.request`, Zero External Dependencies) ```python import json import os import urllib.request AME_BASE = os.environ.get("AME_BASE_URL", "https://artificialmind.me/ame-api") AME_HEADERS = {"Content-Type": "application/json"} if os.environ.get("AME_API_KEY"): AME_HEADERS["X-AME-API-Key"] = os.environ["AME_API_KEY"] else: AME_HEADERS["X-AME-Visitor-Token"] = os.environ["AME_VISITOR_TOKEN"] def post_json(url: str, headers: dict, payload: dict) -> dict: req = urllib.request.Request( url, data=json.dumps(payload).encode("utf-8"), headers=headers, method="POST", ) with urllib.request.urlopen(req, timeout=30) as resp: return json.loads(resp.read().decode("utf-8")) def run_zero_key_turn(mind_id: str, user_input: str) -> dict: # Step 1: Prepare prep = post_json( f"{AME_BASE}/v1/minds/{mind_id}/prepare", AME_HEADERS, {"userInput": user_input}, ) # Step 2: Direct LLM call (OpenAI-compatible endpoint) llm_headers = { "Content-Type": "application/json", "Authorization": f"Bearer {os.environ['OPENAI_API_KEY']}", } llm_body = { "model": "gpt-4o-mini", "messages": prep["messages"], "temperature": prep.get("samplingHints", {}).get("temperature", 0.7), "max_tokens": prep.get("samplingHints", {}).get("maxTokens", 512), } llm_out = post_json("https://api.openai.com/v1/chat/completions", llm_headers, llm_body) raw_reply = llm_out["choices"][0]["message"]["content"] usage = llm_out.get("usage", {}) # Step 3: Settle return post_json( f"{AME_BASE}/v1/minds/{mind_id}/settle", AME_HEADERS, { "turnTicketId": prep["turnTicketId"], "rawReply": raw_reply, "providerUsed": "openai", "modelUsed": "gpt-4o-mini", "usage": { "promptTokens": usage.get("prompt_tokens", 0), "completionTokens": usage.get("completion_tokens", 0), "cachedTokens": usage.get("prompt_tokens_details", {}).get("cached_tokens", 0), }, }, ) ``` For full provider adapters (`OpenAI`, `Anthropic`, `Gemini`, `DeepSeek`, `OpenRouter`, `vLLM`/`Ollama`) and automatic retry/idempotency handling, install `@ame/sdk` or `ame_sdk` from `https://github.com/bearrhee/artificial-mind-engine`. --- ## 4. Ready-to-Paste `mcp.json` Configurations ### Option A — Instant `$0` Keyless Sandbox (Zero Config) ```json { "mcpServers": { "artificial-mind-sandbox": { "command": "npx", "args": ["-y", "github:bearrhee/artificial-mind-engine", "--sandbox"], "env": { "AME_SANDBOX": "1" } } } } ``` ### Option B — Live Production Sealed Kernel ```json { "mcpServers": { "artificial-mind": { "command": "npx", "args": ["-y", "github:bearrhee/artificial-mind-engine"], "env": { "AME_BASE_URL": "https://artificialmind.me/ame-api", "AME_API_KEY": "YOUR_AME_API_KEY" } } } } ``` --- ## 5. Error Schema (`ErrorResponse`) All `4xx`/`5xx` error responses follow `ErrorResponse`: ```json { "error": "snake_case_identifier", "code": "UPPER_SNAKE_CODE", "message": "Human-readable explanation", "retryAfterSeconds": 12, "retryAfterSec": 12 } ``` | HTTP Status | Meaning & Canonical Codes | Recovery Action | | --- | --- | --- | | `400 Bad Request` | `BAD_REQUEST` — schema validation failure, malformed JSON, raw credentials in `ConnectorContext`, or body `> 1048576` bytes (`413`). | Fix payload fields against `openapi.json`. | | `401 Unauthorized` | Missing/invalid `X-AME-API-Key`, `Bearer` token, or invalid/missing `X-AME-Visitor-Token` on sandbox. | Supply valid credentials or 32–128 char URL-safe visitor token. | | `404 Not Found` | `mindId`, `memoryId`, or `turnTicketId` does not exist (or belongs to another visitor/tenant). | Verify `mindId` via `GET /v1/minds` or re-run `/prepare`. | | `409 Conflict` | `IDEMPOTENCY_KEY_REUSE`, `IDEMPOTENCY_INVALIDATED`, or `TICKET_REVISION_STALE` on `/settle`. | Use a fresh `Idempotency-Key` or call `/prepare` again for a fresh `turnTicketId`. | | `429 Too Many Requests` | `RATE_LIMITED` (minute window or batch concurrency), `MIND_QUOTA_EXCEEDED`, `MIND_QUOTA_UNAVAILABLE`, or `PENDING_TICKET_QUOTA_EXCEEDED`. | Honor `Retry-After` header / `retryAfterSeconds` on minute-window throttling; clean up unused Minds or upgrade tier on quota errors. | --- ## 6. Pricing, Self-Serve Checkout & Disclosures - **Free Sandbox & MIT SDK**: `$0/mo` (`10,000` kernel turns/mo, `100` active minds). - **Pro · Hosted API Beta**: `$49/mo` (`250,000` turns/mo, `5,000` active minds, `$0.20/1K` extra turns, `$0.05/mo` extra active mind). Instant PayPal USD checkout at `https://artificialmind.me/#pricing` auto-issues `X-AME-API-Key`. - **Enterprise & Zero-Key VPC**: `$2,000+/mo` (`$24K–$160K` ACV). Contact `help@artificialmind.me`. - **Disclosures**: - `0 signed B2B contracts today`. - Benchmarks (`79.81%` LoCoMo `n=1,986`, `80.20%` LongMemEval_S `n=500` on production dual-router; `68.58%` Sonnet / `68.23%` DeepSeek Mode B v4.5.0) are `self-reported on own harness, not a ranking`. - `D3` connector revocation and `D4` egress firewall checks are `self-tests, not compliance certifications`.